-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
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. I added a few suggestions, and one question, should we implement also the import for fvm and evm?
Also, did you test the CLI or only through the RPC server? Thanks!
identity/src/evm/persistent.rs
Outdated
fn put(&mut self, info: KeyInfo) -> Result<()> { | ||
self.memory.put(info)?; | ||
fn put(&mut self, info: KeyInfo) -> Result<Self::Key> { | ||
let addr = self.memory.put(info)?; | ||
// TODO: We can flush to disk only after certain number of `put` is called. |
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.
Would you mind explaining me what do you mean with this TODO?
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 mean to flush to disk only after some buffer mechanism, so that we dont have to flush every time when we call put.
@@ -11,6 +12,9 @@ use crate::cli::commands::get_ipc_agent_url; | |||
use crate::cli::{CommandLineHandler, GlobalArguments}; | |||
use crate::sdk::{IpcAgentClient, LotusJsonKeyType}; | |||
|
|||
const FVM_WALLET: u8 = 0; |
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 not an enum?
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 might not be able to pass enum to clap/cli, or at least not that easy. So use a number is just easier.
short, | ||
help = "The network the key belongs to, 0 for fvm, 1 for evm" | ||
)] | ||
pub network_type: u8, |
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.
Would it be possible to make it an enum or even two different boolean flags --fvm
and --evm
?
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 bool is better, but not sure how we can enforce only one flag should be set. I can check it in code, but if we have more, then we need to update the code every time.
* fix evm key store filename * fix evm key store filename * hex encode evm private key * add missing crate * more logs * log * fix join subnet * fix join subnet * fix top down target subnet to parent * fix top down target subnet to child * fix itest * fix create itest * itest use agent from
* initial impl * change address type * integrate evm key store * fix provider * remove private key in config * rename fvm_keystore to fvm_wallet * Import evm wallet (#251) * import evm wallet * lint * Fix keystore after integration testing (#252) * fix evm key store filename * fix evm key store filename * hex encode evm private key * add missing crate * more logs * log * fix join subnet * fix join subnet * fix top down target subnet to parent * fix top down target subnet to child * fix itest * fix create itest * itest use agent from * Update identity/src/evm/persistent.rs --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>
* add evm key store * add headers * fix formatting * relax trait bound * update trait bound * add features * add features * add more tests * lint * shift code location * lint * Integrate evm key store (#249) * initial impl * change address type * integrate evm key store * fix provider * remove private key in config * rename fvm_keystore to fvm_wallet * Import evm wallet (#251) * import evm wallet * lint * Fix keystore after integration testing (#252) * fix evm key store filename * fix evm key store filename * hex encode evm private key * add missing crate * more logs * log * fix join subnet * fix join subnet * fix top down target subnet to parent * fix top down target subnet to child * fix itest * fix create itest * itest use agent from * Update identity/src/evm/persistent.rs --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * Fix evm keystore comments (#253) * increase timeout to support mainnet/calibration (#250) * fix comments * update comment * update comment * specify key type for fvm keys * fix serde type * lint * lint * fix import evm format * increase timeout * List subnet (#254) * add subnet support * update status mapping * update gateway abi --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com> --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com>
* update config to new format * Update src/config/deserialize.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * create and join for evm * update abi * update ethers * update params * add debug log * temp solution * log more * swap order * add root * update create subnet constructor * use u128 for value over u64 * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * update based on review * update ipc crate * update evm * update route * update subnet registry abi * fix err * fix err * update route * lint * generalize checkpointing (#227) * initial commit * update subnet id contract * initial commit * add submit checkpoint placeholder: * lint * add checkpoint skeleton * update get bottom up checkpoints * update crates * add list top down msgs * wip * update new checkpoint * initial bottom up impl * Update src/manager/evm/conversion.rs Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * Update src/manager/evm/conversion.rs Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * Initial impl for top down (#233) * initial impl for top down * lint * merge files * add initialization * add logs * update account checks * update testing * update testing * update admin token in tests * more logs * logs for setup * update init * add more error messages * update abi * update method name * Query validator set (#234) * support eth query validator set * fix lint * Update src/manager/evm/manager.rs Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * logging * filter non managed validators * update filter manager * fix configuration number * support fvm address in evm * fvm worker equal addr * add worker addr * from address hash * fix has submitted check * more logs * fix epoch 0 * fix epoch 0 * more error logs * wrap call * fix error * fix error * fix error * Integrate new subnet registry implementation (#237) * integrate new subnet registry impl * evm manager fix addr * Update bottom up checkpoint previous checkpoint hash (#238) * consistent prev hash * update last executed epoch * lint * Fund and release implementation (#239) * add fund * add release * integrate new contracts and integration --------- Signed-off-by: Alfonso de la Rocha <adlrocha@tutamail.com> Co-authored-by: cryptoAtwill <willes.lau@protocol.ai> Co-authored-by: cryptoAtwill <108330426+cryptoAtwill@users.noreply.github.com> * fix get top down messages with nonce * add more logs * fix type conversion * more logs in error * more logs to conversion * tmp fix bottom up ipc address * diff address * log error * more logs * fix value conversioin * update types * update tests * update cargo * update crate versions * fix test * Apply suggestions from code review * fix fmt * address review * Fevm checkpoint (#228) * create and join for evm * update abi * update ethers * update params * add debug log * temp solution * log more * swap order * add root * update create subnet constructor * use u128 for value over u64 * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * Update src/manager/evm.rs Co-authored-by: adlrocha <adlrocha@tutamail.com> * update based on review * update ipc crate * update evm * update route * update subnet registry abi * fix err * fix err * update route * lint * generalize checkpointing (#227) * initial commit * update subnet id contract * initial commit * add submit checkpoint placeholder: * lint * add checkpoint skeleton * update get bottom up checkpoints * update crates * add list top down msgs * Updates from Integration testing (#230) * update evm config * update no create subnet * Fevm fvm checkpoint (#232) * wip * update new checkpoint * initial bottom up impl * Update src/manager/evm/conversion.rs Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * Update src/manager/evm/conversion.rs Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * Initial impl for top down (#233) * initial impl for top down * lint * merge files --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> --------- Co-authored-by: adlrocha <adlrocha@tutamail.com> Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * fix linting * update test infra * update tests * increase timeout to support mainnet/calibration (#250) * Add evm key store (#245) * add evm key store * add headers * fix formatting * relax trait bound * update trait bound * add features * add features * add more tests * lint * shift code location * lint * Integrate evm key store (#249) * initial impl * change address type * integrate evm key store * fix provider * remove private key in config * rename fvm_keystore to fvm_wallet * Import evm wallet (#251) * import evm wallet * lint * Fix keystore after integration testing (#252) * fix evm key store filename * fix evm key store filename * hex encode evm private key * add missing crate * more logs * log * fix join subnet * fix join subnet * fix top down target subnet to parent * fix top down target subnet to child * fix itest * fix create itest * itest use agent from * Update identity/src/evm/persistent.rs --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> * Fix evm keystore comments (#253) * increase timeout to support mainnet/calibration (#250) * fix comments * update comment * update comment * specify key type for fvm keys * fix serde type * lint * lint * fix import evm format * increase timeout * List subnet (#254) * add subnet support * update status mapping * update gateway abi --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com> --------- Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com> * Import private key for evm (#255) * import private key for evm * handle 0x * docs to deploy IPC Solidity in calibration (#246) * docs to deploy IPC Solidity in calibration * update with evm support * Update docs/calibration-solidity.md Co-authored-by: Jorge Soares <547492+jsoares@users.noreply.github.com> --------- Co-authored-by: Jorge Soares <547492+jsoares@users.noreply.github.com> --------- Signed-off-by: Alfonso de la Rocha <adlrocha@tutamail.com> Co-authored-by: adlrocha <adlrocha@tutamail.com> Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com> Co-authored-by: Jorge Soares <547492+jsoares@users.noreply.github.com>
Add import evm wallet to RPC and cli functions.