-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EDB Connect: Add db query tool #1963
Conversation
0ef7251
to
c7fdfd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
(minor comment)
"exe": "main", | ||
"key": "testnet.pem", | ||
"debug": true, | ||
"heapSize": 4096, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be 1024.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
"exe": "main", | ||
"key": "testnet.pem", | ||
"debug": true, | ||
"heapSize": 4096, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me, does the enclave allocate the memory preemptively? If so this might be a bit huge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good shout I think it might allocate greedily. I'll cut it in half and check it still works
} | ||
|
||
// Starts a loop that reads user input and runs queries against the Edgeless DB until user types "exit" | ||
func startREPL(db *sql.DB) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we tested how special characters behave here, considering its coming from stdio? I imagine since its in app the terminal won't be doing any ad hoc bs, but ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you press like keys like up and ctrl on the keyboard it does create some garbage characters I think, let me have a look see if I can improve that. Didn't see any weird rendering with the query responses though (although it's not very pretty, nicer formatting and option to dump response to CSV would be useful upgrades).
Why this change is needed
EDB is a black box, for testnet debugging we want to be able to peek at data, do maintenance tasks, identify expensive queries etc.
EDB Connect is a REPL-like command line tool that lets you execute arbitrary queries against the secure EDB on a node.
This PR adds a script
./edb-connect.sh
to the obscurouser home dir, which when executed pulls the latest edb-connect image and starts the CLI tool. It tries to clean up after itself and should support simultaneous running on the same box.This PR also adds a github action that can be run from main or any branch to publish a new 'latest' edb-connect image. This allows us to tweak the tool when debugging without having to do a network upgrade or manual fiddling to get the changes.
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks