-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[R4R] #1255 make keybase opened with readonly option for query-purpose cli commands #2489
Conversation
de3e740
to
9f606d9
Compare
9f606d9
to
b227b0e
Compare
client/keys/utils.go
Outdated
@@ -83,9 +84,9 @@ func ReadPassphraseFromStdin(name string) (string, error) { | |||
} | |||
|
|||
// initialize a keybase based on the configuration | |||
func GetKeyBaseFromDir(rootDir string) (keys.Keybase, error) { | |||
func GetKeyBaseFromDir(rootDir string, readonly bool) (keys.Keybase, error) { |
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.
my humble proposal:
set readonly
to true by default to increase security. and make a separate method GetKeyBaseFromDirWithWritePerm(rootDir string)
and call it where needed.
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.
I like this proposal. Do you mind modifying this @ackratos ?
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.
will do that thanks @melekes , glad to see you here:)
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.
fixed @melekes @jackzampolin
b227b0e
to
0c070be
Compare
Codecov Report
@@ Coverage Diff @@
## develop #2489 +/- ##
========================================
Coverage 60.28% 60.28%
========================================
Files 150 150
Lines 8589 8589
========================================
Hits 5178 5178
Misses 3067 3067
Partials 344 344 |
I found my failed test This PR #2474 failed it too: Is this a known one or is there anyone working on fixing it? |
@ackratos I think we fixed this in the latest develop. Please try rebasing. |
0c070be
to
9dd1d44
Compare
COOL, rebased. |
@ackratos Just a couple of linting errors now:
|
aa9d96b
to
57de66a
Compare
fixed, sorry didn't check that:( |
Looks like |
…r parallelization between gaiacli
57de66a
to
6c623b2
Compare
Hey, I'm the author of #2544. I'd be happy to drop my PR in favor of this 👍 |
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.
I'd add a CloseDB()
function to the KeyBase
interface to allow the caller to explicitly release the lock on the db. This is a not blocking request from me though, I'm happy to merge this.
@alessio Lets merge this and add the |
Oh and I'd like to see some tests too! :) |
Yes, go ahead please.
Thanks for contribution, and keep up the great work!
…On Mon, Oct 22, 2018 at 7:36 PM, cong ***@***.***> wrote:
@ackratos <https://github.com/ackratos> I've made some changes to your
PR: #2555 <#2555>
Thanks, approved that. I think I can close my PR right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2489 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN_7A0z2sJOH-o53bkP3czjXPoLC-zsks5unoCrgaJpZM4XaaDF>
.
--
Alessio Treglia | [email protected]
0416 0004 A827 6E40 BB98 90FB E8A4 8AE5 311D 765A
|
I don't have permission to click the merge button, would you like do that? |
thanks for reviewing & merging this. Do you know when this change will be released? thx |
Very soon! Track progress here: #2588 |
Thanks again for your contribution @ackratos! |
This is a PR for #1255
make keybase opened with readonly option for query-purpose to support better parallelization between gaiacli
This change enabled parallelization between read and write of keys db via gaiacli, so most of operations can be parallelized except multiple add/update keys to keys db at the same time (but sending transactions and serve rest-server can be parallelized!) in trust mode
There are more work to do to supprt non-trust mode, which have to made change to tendermint code. The remainning work mostly reside on make open and close dbprovider in verifier fine grained.
just like golevel db, the cleveldb interface in tendermint should also expose readonly option to up-level caller:
This was manually tested:
gaiad start
gaiacli rest-server --chain-id test-chain-2UzoT6 --insecure true --trust-node
gaiacli query account cosmos1uw7nvnfccr3fnumtjs82qvvn3z8uzw7fdznn3t --chain-id test-chain-2UzoT6
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests - investigating the failed test case
Updated relevant documentation (
docs/
) - no need update docsAdded entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: