-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: use cmd to setup data committee #3
base: develop
Are you sure you want to change the base?
Conversation
* Hotfix v0.1.4 to main (0xPolygonHermez#2250) * fix concurrent web socket writes * fix eth_syncing * fix custom trace internal tx call error handling and update prover * add test to custom tracer depth issue; fix internal call error and gas used * fix custom tracer for internal tx with error and no more steps after it * remove debug code * Make max grpc message size configurable (0xPolygonHermez#2179) * make max grpc message size configurable * fix state tests * fix tests * fix tests * get SequencerNodeURI from SC if empty and not IsTrustedSequencer * Optimize trace (0xPolygonHermez#2183) * optimize trace * fix memory reading * update docker image * update prover image * fix converter * fix memory * fix step memory * fix structlogs * fix structlogs * fix structlogs * fix structlogs * fix structlogs * fix structlogs * fix structlogs * fix structlogs * update prover image * fix struclogs * fix memory size * fix memory size * fix memory size * refactor memory resize * refactor memory resize * move log for the best fitting tx (0xPolygonHermez#2192) * fix load zkCounters from pool * remove unnecessary log.info * add custom tracer support to CREATES opcode without depth increase (0xPolygonHermez#2213) * logs * fix getting stateroot from previous batch (GetWIPBatch) * logs * Fix GetWipBatch when previous last batch is a forced batch * fix forcedBatch trusted state * Revert "fix getting stateroot from previous batch (GetWIPBatch)" This reverts commit 860f0e7. * force GHA * add pool limits (0xPolygonHermez#2189) * Hotfix/batch l2 data (0xPolygonHermez#2223) * Fix BatchL2Data * Force GHA * remove failed txs from the pool limit check (0xPolygonHermez#2233) * debug trace by batch number via external rpc requests (0xPolygonHermez#2235) * fix trace batch remote requests in parallel limitation (0xPolygonHermez#2244) * Added RPC.TraceBatchUseHTTPS config parameter * fix executor version --------- Co-authored-by: tclemos <[email protected]> Co-authored-by: tclemos <[email protected]> Co-authored-by: Toni Ramírez <[email protected]> Co-authored-by: agnusmor <[email protected]> Co-authored-by: agnusmor <[email protected]> Co-authored-by: Thiago Coimbra Lemos <[email protected]> * fix test * fix test --------- Co-authored-by: tclemos <[email protected]> Co-authored-by: tclemos <[email protected]> Co-authored-by: Toni Ramírez <[email protected]> Co-authored-by: agnusmor <[email protected]> Co-authored-by: agnusmor <[email protected]> Co-authored-by: Thiago Coimbra Lemos <[email protected]>
* effective GasPrice refactor * bugs fixes and finalizer tests fixes * fix typo * fix calculate effective gasprice percentage * fix test gas price
…#2258) * effective gas price returned by the rpc in the receipt * linter
…#2260) * bugfix: fixing l2blocks timestamp for the fist batch Signed-off-by: Nikolay Nedkov <[email protected]> * fix finalizer unit test --------- Signed-off-by: Nikolay Nedkov <[email protected]>
…ssword from etherman.Config that are not in use
…ermez#2200-add-documentation-for-node-config-file-2
* fix fea2scalar and gas used * suggestion * fix fea2scalar * suggestion
* fix pending tx when duplicate nonce * set pool.transaction.failed_reason to NULL when updating an existing tx * add more log details when adding tx to AddrQueue * fix query to add tx to the pool. Fix lint errors * change failed_reason for tx discarded due duplicate nonce
…ermez#2273) * Return a tx from the pool only if it is * fix TestGetTransactionByHash --------- Co-authored-by: agnusmor <[email protected]>
…xPolygonHermez#2200-add-documentation-for-node-config-file-2 Feature/0xPolygonHermez#2200 generate json-schema + docs for node config file and network_custom
…t forkId is under 5. Signed-off-by: Nikolay Nedkov <[email protected]>
…add-check-for-fork-id-to-skip-effectivePercentage improve: adding check to skip appending effectivePercentage if current forkId is under 5.
…om config param. Signed-off-by: Nikolay Nedkov <[email protected]>
…stop-sequencer-on-batch-num feat: adding functionality to stop sequencer on specific batch num from config param.
Signed-off-by: Nikolay Nedkov <[email protected]>
… log conversion (0xPolygonHermez#2280) * fix and check order * linter
…d-print-for-X-Real-IP patch: adding print for X-Real-IP in JSON-RPC
Rename to cdk
Updated README
Updated README
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.
nice work! let's discuss whether we want to support multiple DAC member registration at the same time or not
return err | ||
} | ||
if !ctx.Bool(config.FlagYes) { | ||
fmt.Println("*WARNING* Are you sure you want to setup committee? [y/N]: ") |
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 think we should also print out some key info here (e.g. the URL, the address)
return err | ||
} | ||
|
||
dataCommitteeContract := c.DataAvailability.L1.DataCommitteeAddress |
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.
there is dacSC defined below, this name is a bit confusing
I think we can rename dataCommitteeContract
to dacSCAddress
return err | ||
} | ||
|
||
const nSignatures = 1 |
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.
in this command, we assume the user is always going to only add 1 DAC member. I think we should support multiple per the interface
function setupCommittee(
uint _requiredAmountOfSignatures,
string[] calldata urls,
bytes calldata addrsBytes
)
so here nSignatures will be a user param
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.
agree
if err != nil { | ||
return err | ||
} | ||
log.Infof("decrypting dac member key from: %v", c.DataAvailability.PrivateKey.Path) |
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.
why do we use fmt.Println
sometimes and log
in other places? do you know the differences?
} | ||
dacMemberAddress := dacMemberKey.Address | ||
fmt.Println("dacMemberAddress: ", dacMemberAddress) | ||
dacServiceURL := fmt.Sprintf("http://%s:%d", c.DataAvailability.RPC.Host, c.DataAvailability.RPC.Port) |
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.
what if the service url is HTTPS? if we ask the user to specify the URL, this problem will be resolved
addrsBytes := []byte{} | ||
urls := []string{} | ||
|
||
// load dac member from keystore file |
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 don't think we need to load the DAC member from the keystore file. also given that if we were to support multiple DAC member, we need to load multiple files and that will need multiple passwords to decrypt those files which can be too complicated.
can we keep it simple by just asking the user to specify the list of DAC member addresses and URLs in the config file?
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.
yes, in general, the admin is the one who sends the L1 tx to setup the committee, but this admin:
- shouldn't be part of the committee
- shouldn't know the private keys of the committee
this is intentional, as the hole idea is that the DAC and the admin of the network are different entities
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.
The DAC config shouldn't be part of the config of the node. Instead, the CLI to setup the committee should have a custom input (either in the form of a config file, or directly through the CLI) that has the following data:
- N required signatures
- List of DAC members {address, URL}
&cli.StringFlag{ | ||
Name: config.FlagPassword, | ||
Aliases: []string{"pw"}, | ||
Usage: "the password do decrypt the key store file", |
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.
Usage: "the password do decrypt the key store file", | |
Usage: "the password to decrypt the key store file", |
return err | ||
} | ||
|
||
const nSignatures = 1 |
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.
agree
addrsBytes := []byte{} | ||
urls := []string{} | ||
|
||
// load dac member from keystore file |
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.
yes, in general, the admin is the one who sends the L1 tx to setup the committee, but this admin:
- shouldn't be part of the committee
- shouldn't know the private keys of the committee
this is intentional, as the hole idea is that the DAC and the admin of the network are different entities
@lesterli let's also modify the test at https://github.com/Snapchain/cdk-validium-node/blob/develop/test/e2e/datacommittee_test.go to use the CLI to register the committee so we can test this new feature |
Summary
make run-validium
in the makefileTest Plan
docker pull snapchain/cdk-validium-node
make run-validium