Skip to content
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

fix keypair/private_key discrepancy for sov-cli #811

Merged
merged 8 commits into from
Sep 7, 2023

Conversation

dubbelosix
Copy link
Contributor

@dubbelosix dubbelosix commented Sep 7, 2023

Description

This PR aims to fix a bug related to the sov-cli rpc submit-batch command. The bug causes an error message: Error: missing field private_key at line 1 column 129.

The issue seems to be related to the recent ed25519 upgrade, where the serialized JSON file only contains the key_pair and not the private_key and address.

Changes

  • changed existing key formats to all consistently use the sov_cli::wallet_state::PrivateKeyAndAddress format
  • changed relevant tests
  • changed some other keyfiles to also use the new format
  • ensured the new keyfiles private keys are consistent with the bech addresses in the files
  • changed README instructions
  • modified demo-rollup Makefile to reference the correct key when submitting transactions

How to Test

  1. Run the demo-rollup workflow with make clean, make start, make test-create-token from the demo-rollup folder and ensure that a new token is created as per the README
  2. Ensure that other functionalities related to key management are not affected by this change.

Fixes

Fixes #810

@dubbelosix dubbelosix marked this pull request as ready for review September 7, 2023 12:34
@dubbelosix dubbelosix requested a review from bkolad September 7, 2023 12:34
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #811 (fd4ff81) into nightly (a16af40) will decrease coverage by 0.1%.
Report is 1 commits behind head on nightly.
The diff coverage is 100.0%.

Files Changed Coverage Δ
...-system/module-implementations/sov-bank/src/lib.rs 95.4% <ø> (ø)
module-system/sov-cli/src/workflows/keys.rs 81.3% <100.0%> (+0.2%) ⬆️

... and 4 files with indirect coverage changes

📢 Have feedback on the report? Share it here.

@dubbelosix dubbelosix added this pull request to the merge queue Sep 7, 2023
Merged via the queue into nightly with commit 9efc47a Sep 7, 2023
@dubbelosix dubbelosix deleted the dub/sovcli_bugfix branch September 7, 2023 21:23
neysofu pushed a commit that referenced this pull request Sep 14, 2023
Add risc0-adapter to packages_to_publish.txt

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

Allow modules to query token names (#821)

* Add public function for fetching token names

* Add test coverage

* lint

fix keypair/private_key discrepancy for sov-cli (#811)

* fix keypair/private_key discrepancy

* formatting

* changes to use consistent format

* README changes

* linting fixes

* remove checked in rollup_config.toml

* fix token address in git workflow

---------

Co-authored-by: dubbelosix <dub@006.com>

Initializes pending block on begin slot + genesis block (#803)

* Initialize pending_block in begin_slot_hook properly

* add timestamp handling

* simplify unwrap

* simplify basefee calculation, genesis block will be handled in genesis

* Initialize genesis block

* improvements

* fix tests

* add tests

* fix test

* Add expect

* Move to lazy_static global test_config

* simplify

* fix

* one more fix

Add missing derive to BcsCodec (#823)

Bug fix: StateMap::Keys are not consistent across platforms (#804)

* Bug fix: Introduce EncodeLike trait.

This PR removes our StateMap key encoding based on std::Hash, which was
not consistent across platforms. Instead, this PR introduces the
`EncodeLike<Ref, Target>` trait which marks that Ref can be encoded
like Target by the implementing codec.

This PR also removes the SingletonKey type, which required special
handling in codecs. Instead, of using this placeholder, this PR
implements auxiliary methods on the working set for dealing with
singletons

* Remove rollup config changes

* fix test: qualify conversion

* Add missing bounds for fuzzing

* fix docs

* clarify zsts in comment

* allow separate codecs for keys/values

* Split key and value codecs

* Fix fuzzing feature

* Introduce StateCodec trait to allow EncodeLike with SplitCodec

* add doc comments

* Fix fuzz and test targets

* Fix test

* fix docs

Fix Cargo.lock, packages_to_publish.txt

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

Update Cargo.lock

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

Update Cargo.lock

Signed-off-by: Filippo Costa <filippo@sovlabs.io>
neysofu pushed a commit that referenced this pull request Sep 14, 2023
Add risc0-adapter to packages_to_publish.txt

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

Allow modules to query token names (#821)

* Add public function for fetching token names

* Add test coverage

* lint

fix keypair/private_key discrepancy for sov-cli (#811)

* fix keypair/private_key discrepancy

* formatting

* changes to use consistent format

* README changes

* linting fixes

* remove checked in rollup_config.toml

* fix token address in git workflow

---------

Co-authored-by: dubbelosix <dub@006.com>

Initializes pending block on begin slot + genesis block (#803)

* Initialize pending_block in begin_slot_hook properly

* add timestamp handling

* simplify unwrap

* simplify basefee calculation, genesis block will be handled in genesis

* Initialize genesis block

* improvements

* fix tests

* add tests

* fix test

* Add expect

* Move to lazy_static global test_config

* simplify

* fix

* one more fix

Add missing derive to BcsCodec (#823)

Bug fix: StateMap::Keys are not consistent across platforms (#804)

* Bug fix: Introduce EncodeLike trait.

This PR removes our StateMap key encoding based on std::Hash, which was
not consistent across platforms. Instead, this PR introduces the
`EncodeLike<Ref, Target>` trait which marks that Ref can be encoded
like Target by the implementing codec.

This PR also removes the SingletonKey type, which required special
handling in codecs. Instead, of using this placeholder, this PR
implements auxiliary methods on the working set for dealing with
singletons

* Remove rollup config changes

* fix test: qualify conversion

* Add missing bounds for fuzzing

* fix docs

* clarify zsts in comment

* allow separate codecs for keys/values

* Split key and value codecs

* Fix fuzzing feature

* Introduce StateCodec trait to allow EncodeLike with SplitCodec

* add doc comments

* Fix fuzz and test targets

* Fix test

* fix docs

Fix Cargo.lock, packages_to_publish.txt

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

Update Cargo.lock

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

Update Cargo.lock

Signed-off-by: Filippo Costa <filippo@sovlabs.io>
preston-evans98 pushed a commit that referenced this pull request Sep 14, 2023
* fix keypair/private_key discrepancy

* formatting

* changes to use consistent format

* README changes

* linting fixes

* remove checked in rollup_config.toml

* fix token address in git workflow

---------

Co-authored-by: dubbelosix <dub@006.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sov-cli submit batch breaks with "Error: missing field private_key at line 1 column 129"
2 participants