-
Notifications
You must be signed in to change notification settings - Fork 108
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
Hash-encode keys in StateMap
instead of serializing them with a codec
#718
Conversation
Codecov Report
|
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 approach looks good! I have one question on why we still use serialization, even after the introduction of the Hasher
of stdlib
335aecd
to
b4eecd4
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.
Very good, will help a lot with the ergonomics
Signed-off-by: Filippo Costa <filippo@sovlabs.io>
* Chain state module (Sovereign-Labs#598) * WIP: Add optimsitic sync * WIP: implement chain state module * WIP: Add attester incentives * Can compile * Does compile * Start working on attester incentives * Implement attestation processing * Finish unbonding * Improve events * Rename sov-attester-incentives to optimistic-workflow * Refactor * Start working on apply_sync_data_blob * Refactoring apply_tx_blob * Refactoring files * Rewriting unbonding * Refactor attestation processing * Refactor process challenge * Refactoring * Fixing compile issues * Does compile * Everything compiles * Add 2 phase unbonding back * Updating tests * Changing bonding proof * Changing bonding proof * Fixing get_with_proof * Fixing chain updates * Change STF interface to work on slot level * Removing Misbehavour hint from parameters * Fixing prover * Update docs * Adding chain state * Starting chain state * Fix lint * Fixing warnings * Integrating slot hooks * Populating todos * Adding data generation for different modules * Implementing automatic bank data generation * Fixing stf * Compiles * Fixing chain-state test, adding EncodeCall trait * Fixing lints * Chain state testing * Simple chain state module tests * All tests pass * Fixing lints * Fixing comments PR * Fixing comments PR * nit fix * Fixing PR comments * Deleting borsh compat * Adding back github and config files * Specifying commit for jmt * Update module-system/sov-state/src/storage.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing comments PR * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing error handling * Fixing lints * Fixing lints * Fix lints * Update rollup-interface/src/state_machine/mocks.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Addressing PR comments * Including PR comments * Update Cargo.toml Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Adding back genesis and call * Fix lints * Lint * Restoring default context * Fixing imports * Fixing prover compiles * Fix prover compiles * Fixing end slot hook * Reorganizing integration tests * Reorganizing integration tests * Adding unit tests for chain-state * Update chain state tests * Update apply slot signature * Fix demo-prover * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fix lints * Format demo-prover * Fix feature data generators * Update examples/demo-stf/Cargo.toml Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing pr comments * Fix lint * Removing call from chain-state because provided by blanket --------- Co-authored-by: Preston Evans <preston.b.evans@gmail.com> Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Refactoring buf reader (Sovereign-Labs#593) * WIP: Add optimsitic sync * WIP: implement chain state module * WIP: Add attester incentives * Can compile * Does compile * Start working on attester incentives * Implement attestation processing * Finish unbonding * Improve events * Rename sov-attester-incentives to optimistic-workflow * Refactor * Start working on apply_sync_data_blob * Refactoring apply_tx_blob * Refactoring files * Rewriting unbonding * Refactor attestation processing * Refactor process challenge * Refactoring * Fixing compile issues * Does compile * Everything compiles * Add 2 phase unbonding back * Updating tests * Changing bonding proof * Changing bonding proof * Fixing get_with_proof * Fixing chain updates * Refactoring buf reader * Change STF interface to work on slot level * Removing Misbehavour hint from parameters * Fixing prover * Update docs * Adding chain state * Starting chain state * Fix lint * Fixing warnings * Integrating slot hooks * Populating todos * Adding data generation for different modules * Implementing automatic bank data generation * Fixing stf * Compiles * Fixing chain-state test, adding EncodeCall trait * Fixing lints * Chain state testing * Simple chain state module tests * All tests pass * Fixing lints * Fixing comments PR * Fixing comments PR * nit fix * Fixing PR comments * Deleting borsh compat * Adding back github and config files * Specifying commit for jmt * Update module-system/sov-state/src/storage.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing comments PR * Applying PR comments * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing error handling * Fixing lints * Fixing lints * Fix lints * Refactor buf reader * Update rollup-interface/src/state_machine/mocks.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Addressing PR comments * Including PR comments * Update Cargo.toml Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Adding back genesis and call * Fix lints * Lint * Restoring default context * Fixing imports * Fixing prover compiles * Fix prover compiles * Fixing end slot hook * Reorganizing integration tests * Reorganizing integration tests * Adding unit tests for chain-state * Update chain state tests * Update apply slot signature * Fix demo-prover * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fix lints * Format demo-prover * Fix feature data generators * Merge with chain-state and fix lints * Update examples/demo-stf/Cargo.toml Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing pr comments * Fix lint * Fix lints --------- Co-authored-by: Preston Evans <preston.b.evans@gmail.com> Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Add missing docs for bank, prover-incentives, demo-rollup and const-rollup-config (Sovereign-Labs#592) * WIP: Add optimsitic sync * WIP: implement chain state module * WIP: Add attester incentives * Can compile * Does compile * Start working on attester incentives * Implement attestation processing * Finish unbonding * Improve events * Rename sov-attester-incentives to optimistic-workflow * Refactor * Start working on apply_sync_data_blob * Refactoring apply_tx_blob * Refactoring files * Rewriting unbonding * Refactor attestation processing * Refactor process challenge * Refactoring * Fixing compile issues * Does compile * Everything compiles * Add 2 phase unbonding back * Updating tests * Changing bonding proof * Changing bonding proof * Fixing get_with_proof * Fixing chain updates * Missing docs bank * Missing docs prover-incentives * Missing docs const-rollup-config * demo-rollup missing docs, finish missing docs * Refactoring buf reader * Fixing lint error * Change STF interface to work on slot level * Removing Misbehavour hint from parameters * Fixing prover * Update docs * Adding chain state * Starting chain state * Fix lint * Fixing warnings * Integrating slot hooks * Populating todos * Adding data generation for different modules * Implementing automatic bank data generation * Fixing stf * Compiles * Fixing chain-state test, adding EncodeCall trait * Fixing lints * Chain state testing * Simple chain state module tests * All tests pass * Fixing lints * Fixing comments PR * Fixing comments PR * nit fix * Fixing PR comments * Deleting borsh compat * Adding missing_docs * Adding back github and config files * Specifying commit for jmt * Update module-system/sov-state/src/storage.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing comments PR * Fix rpc macro * Fixing missing docs * Applying PR comments * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing error handling * Fixing lints * Fixing lints * Fix lints * Refactor buf reader * Fixing tests * Update rollup-interface/src/state_machine/mocks.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Addressing PR comments * Including PR comments * Update Cargo.toml Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Adding back genesis and call * Fix lints * Lint * Restoring default context * Fixing imports * Fixing prover compiles * Fix prover compiles * Fixing end slot hook * Reorganizing integration tests * Reorganizing integration tests * Adding unit tests for chain-state * Update chain state tests * Update apply slot signature * Fix demo-prover * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/host.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fix lints * Format demo-prover * Fix feature data generators * Merge with chain-state and fix lints * Update examples/demo-stf/Cargo.toml Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Update adapters/risc0/src/guest.rs Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * Fixing pr comments * Fix lint * Fix doctests demo rollup * Add folder generated by README test to gitignore --------- Co-authored-by: Preston Evans <preston.b.evans@gmail.com> Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> * EVM: Recovering transaction signer in the EVM module. (Sovereign-Labs#639) * Refactor `CelestiaAddress` (Sovereign-Labs#551) * Refactor CelestiaAddress and its internal representation * Correct comparison for sender (Sovereign-Labs#660) * Remove `associated_type_defaults` making Sovereign SDK stable compatible (Sovereign-Labs#649) * Based Sequencer with Soft Confirmations: deferring blob from execution (Sovereign-Labs#596) * Introducing blob deferring * Exposing is_allowed_sequencer method. Filter non registered sequencers * Add next-test as default runner for `make test` * Allow custom (de)serialization logic for `#[state]` (Sovereign-Labs#648) * Allow custom state encodings * Use Default::default to build codecs * Improve tests for sov-modules-macros * Stricter type bounds for better error messages * Don't reexport sov_state::codec * t.pass test * Bump tokio from 1.29.1 to 1.31.0 (Sovereign-Labs#659) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.29.1 to 1.31.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.29.1...tokio-1.31.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Filippo Neysofu Costa <filippo@sovlabs.io> * Add Demo NFT module docs (Sovereign-Labs#642) * Make Sequencer Outcome generic over address (Sovereign-Labs#652) * Mock refactoring in `rollup-interface/src/state_machine/mocks` (Sovereign-Labs#661) * Add a benchmark/profiler to count cycles in demo-prover (Sovereign-Labs#577) * extract data_gen into its own function * temp push * add prover cycles * include multiple transactions * reduce txns * temp switch * cycle tracker macro * another temp commit * merge main and nightly * use run_without_prover for bench/profile * working metrics * add zk-cycle-utils. missed it * temporary commit * pass features to risc0 vm * feature gate all the bench things * cleanup and testing * check in readme * checking some cargo locks in prep for merge * some fixes * revert rollup config toml * working merge * cleanup and documentation * simplify the macro for generating the wrapped function * format fixes * README changes * simplify code as per lint * lint fix * add profiler to analyze trace * fix cargo lock * really fix Cargo.lock * trace options * cargo fmt * fix log error * fix prover bench * add docs and address comments * prover bench readme * add a skip proving option to demo-prover * add tests for macros * demo prover format * remove commented code * formatting --------- Co-authored-by: dubbelosix <dub@006.com> * Simplify generics in `AppTemplate`. (Sovereign-Labs#662) * Move module-template tests into dir (Sovereign-Labs#665) * Use DaService in `sov-ethereum`. (Sovereign-Labs#668) * Rename jupiter to celestia (Sovereign-Labs#670) * Config preferred sequencer via bool (Sovereign-Labs#672) * `sov-sequencer-registry` module docs (Sovereign-Labs#674) * Fix sov-sequencer-registry docs * Fix docs about callmessage * `RollupConfig` cleanup (Sovereign-Labs#677) * Typo in ledger_rpc.rs (Sovereign-Labs#678) * fixed typo in ledger_rpc.rs * Fix RPC method name in sov-stf-runner docs --------- Co-authored-by: Filippo Costa <filippo@sovlabs.io> * Rollup strcture in demo-rollup (Sovereign-Labs#680) * Optimistic (Sovereign-Labs#650) * Optimistic * Attester incentives module * Reverting typo * Tests attester-incentives * Adding test helper and lint * Lint * Adding tests * Finishing positive test * Refactor tests * Refactor tests * Adding negative test * Valid challenge * Invalid challenge * Adding unbonding tests * Lint fix * Lint * Make lint * Make lint * PR comments + fix tests * Lint * Fixing comments * Refactoring + finishing adding tests * Fix lint * Fix lint * Fixing PR comments * Fixing important comment * Fix nits * Fixing multi-attestation * Fixing nits * Fixing nits * Fixing lints * Fixing all comments PR * Celestia docker compose: several nodes (Sovereign-Labs#682) * Bump parking_lot from 0.11.2 to 0.12.1 (Sovereign-Labs#696) Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.11.2 to 0.12.1. - [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md) - [Commits](Amanieu/parking_lot@0.11.2...0.12.1) --- updated-dependencies: - dependency-name: parking_lot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump serde from 1.0.183 to 1.0.185 (Sovereign-Labs#698) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.183 to 1.0.185. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.183...v1.0.185) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump quote from 1.0.32 to 1.0.33 (Sovereign-Labs#701) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.32 to 1.0.33. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](dtolnay/quote@1.0.32...1.0.33) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tokio from 1.31.0 to 1.32.0 (Sovereign-Labs#702) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.31.0 to 1.32.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.31.0...tokio-1.32.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Filippo Neysofu Costa <filippo@sovlabs.io> * Run CI even for *.md changes (Sovereign-Labs#704) * Fix typos in documentation (Sovereign-Labs#687) * fix typos * fix typos * fix typo * fix typos * fix typo * fix typo * fix typo * fix typo * fix typo * fix typo * fix typo * Update examples/demo-rollup/benches/README.md Fix typo * Trigger CI --------- Co-authored-by: Filippo Neysofu Costa <filippo@neysofu.me> Co-authored-by: Filippo Costa <filippo@sovlabs.io> * Update README.md (Sovereign-Labs#683) * Update README.md To make getting started section more digestable. * Update README.md --------- Co-authored-by: Filippo Neysofu Costa <filippo@sovlabs.io> * `PairOfCodecs` default (Sovereign-Labs#703) * Make "native" feature non default (Sovereign-Labs#664) * Disabling default native feature * Fixes after rebase * Functionality for submitting several blobs in single DA block (Sovereign-Labs#690) * Introduce sciprts for testing deferred blob execution * Clean up logging * Scripts for make demo * Improve logging * Use preferred sequencer * Log transaction hash in batch builder * Refactor `sov-cli` into a library (Sovereign-Labs#708) * WIP: add rpc to cli wallet * Test key commands * WIP allow generic callmsg parsing * It kinda works * Switch to tryfrom * It works! needs cleanup * It works a bit better * Use new frontend trait * Import from files and json * Test import flows * Rename to fileNameArg * Implement tx submission via rpc * Update sov-cli in demo-stf * Cleanup diff * Cleanup diff * Remove unneeded json file * lint * remove sov-cli from guest * lint * Fix tests * Remove outdated clap test * Fix sequencer tests * Add build step to makefile * Remove stray ':' from Makefile * Update test for cli_wallet derive * DA mock implementation (Sovereign-Labs#686) * Minor fixes in demo-rollup to filter out transaction registrations (Sovereign-Labs#712) * Implement State Vectors (Sovereign-Labs#685) * impl. StateVec * remove remove func. impl. set_all * fix set_all * add tests * fix naming * borrow values * impl. get_or_err * example without tests yet * formatting * docs: document sov-vec-setter * lint: sov-vec-setter * fix fn order * string test case * linting * Add tests for sov-vec-setter and StateVec * Update doc for set_all * Fix Clippy warnings * Fix StateVec::clear() bug --------- Co-authored-by: orkunkilic <orkunmahirkilic@gmail.com> Co-authored-by: Filippo Costa <filippo@sovlabs.io> * Improvements to `StateVec` (Sovereign-Labs#688) Signed-off-by: Filippo Costa <filippo@sovlabs.io> * Hash-encode keys in `StateMap` instead of serializing them with a codec (Sovereign-Labs#718) * Use Hash to serialize keys * Better naming conventions for Storage/Cachekey * Fix docs * Fix merge issues Signed-off-by: Filippo Costa <filippo@sovlabs.io> --------- Signed-off-by: Filippo Costa <filippo@sovlabs.io> * Split AddressTrait (Sovereign-Labs#720) * Removing extra bound on RollupAddress where it is not needed * Update demo-simple-stf docs * Public export * Remove unused H160 * EVM remove receipt type (Sovereign-Labs#719) * Use `MockAddress` in `sov-sequencer-registry` tests. (Sovereign-Labs#725) * Fix `#[state(codec_builder = ...)]` test (Sovereign-Labs#723) Signed-off-by: Filippo Costa <filippo@sovlabs.io> * Add create-token integration test (Sovereign-Labs#716) * Use update proofs * Add basic module integration tests * Randomize port in tests * Revert "Use update proofs" This reverts commit e5bfaca. * address code review; reorganize * Add ws subscription for slots * fix lints * Fix bash snippet in README interpreted as test * Fixing `where` bounds for rpc_gen (Sovereign-Labs#726) * Generate docs in rpc macros (Sovereign-Labs#729) * Add missing docs to generated rpc * Remove allow(missing_docs) from query modules * remove println * add missing docs for attester-incentives * EVM test cleanup (Sovereign-Labs#732) * Fix CI (Sovereign-Labs#734) * Add docs for examples/demo-prover (Sovereign-Labs#730) Co-authored-by: dubbelosix <dub@006.com> * Use MockAddress in demo-rollup benches. (Sovereign-Labs#738) * Fix Blob address type in benches * fix lint * Bump serde from 1.0.185 to 1.0.188 (Sovereign-Labs#746) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.185 to 1.0.188. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.185...v1.0.188) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump reqwest from 0.11.18 to 0.11.20 (Sovereign-Labs#745) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.18 to 0.11.20. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](seanmonstar/reqwest@v0.11.18...v0.11.20) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * CLEANUP: remove sov-election module since we don't need it and modify tests using it to use sov-bank (Sovereign-Labs#739) * cleanup sov election * fix unused import * fix removed arguments to genesis config * remove extra argument for create_demo_genesis_config * add a bad nonce test case as well * formatting :( * another place where private key for election module needs to be removed * linter suggestions --------- Co-authored-by: dubbelosix <dub@006.com> * Update `end_slot_hook` (Sovereign-Labs#742) * add root_hash to end_sloot_hook * update end slot hook * support experimental * allow unused variables * fix experimental flag for hooks in evm * Migrate to buildjet (Sovereign-Labs#748) * Migrate to buildjet * Switch back to swatinem cache * No default feature in CI (Sovereign-Labs#741) Signed-off-by: Filippo Costa <filippo@sovlabs.io> * Allow modules to mint on their own authority (Sovereign-Labs#728) * Allow modules to mint on their own authority * Fix typos in token::mint signature * Allow modules to create tokens * Fix nits * lint * Fix tests * Fix tests * Modify risc0 tracer util to print function stack to enable better debugging (Sovereign-Labs#711) * stack analysis * fix issues * some more changes * minor changes --------- Co-authored-by: dubbelosix <dub@006.com> * Remove unnecessary generic from `MockBlob` (Sovereign-Labs#749) * Remove generic from MockBlob * update tests * fix lint * fix lint * feat: add fuzzing (Sovereign-Labs#651) * macro docs improvements * wip * fuzz experiments * macro errors * wip * add fuzz makefile & docs * add generative fuzz for account module implementation This commit introduces a generative model for the accounts module implementation that will generate valid messages to update the account address. It also fixes a bug where a prefix with an unaligned vector could be created by declaring an API module, combining its prefixes, and generating a vec would result in potentially unaligned vectors. * fix statemap arbitrary generation * fix lint nits * rollback aligned vec assertion for tests * fix native requirement for arbitrary implementation * fix arbitrary workset to use genesis * fix merge generated errors * remove cargo.lock from fuzz directory --------- Co-authored-by: Filippo Costa <filippo@sovlabs.io> * Fix CI job cancellation (Sovereign-Labs#751) * Split `Storage::validate_and_commit` into two separate methods `Storage::calculate_root_hash...` and `Storage::commit` (Sovereign-Labs#752) * Extend storage interface * fix * add calculate_state_root_and_node_batch * Add comment * code review feedback * Add StateUpdate to Storage * Fix `expose_rpc` macro with associated types (Sovereign-Labs#733) * Start adding test * Add simple test for expose_rpc * Generic test passes without expose_rpc * It still passes. * Just adding some notes * Add test boilerplate * [no ci]: Update tests * Broken, but progress * [no ci] It passes! * And add failing test! * Adding module for debugging macro things * It compiles and runs! * Adding generic! * Add phantom module to satisfy compiler * Fixing phantom * WIP * It compiles without expose_rpc * We don't need phantom module * Update things * It works with renaming! * Linter is happy * tests are passing * Add failing test * Clean ups * Add link to bug * Update message * Allow modules to burn coins (Sovereign-Labs#756) * Move generic from method to trait, so it will be easier to use it with DA spec (Sovereign-Labs#759) * Add Bitcoin DA Adapter link to README (Sovereign-Labs#758) * docs: add Bitcoin DA link to README * docs: add "open-source" to BitcoinDA link Co-authored-by: Cem Özer <cemozer2018@u.northwestern.edu> --------- Co-authored-by: Cem Özer <cemozer2018@u.northwestern.edu> * Add RPC for `chain-state` module (Sovereign-Labs#760) * Add RPC endpoint for chain state module, so it can be plugged into runtime * Move tests to integration tests * Fix native feature gating * Fixed check features * Specify version of `jmt` which contains fix (Sovereign-Labs#762) * Specify version of `jmt` which contains fix * Fix jsonrpsee new method name * Bump prover's cargo lock * Remove separate "serde" feature (Sovereign-Labs#761) * Remove separate "serde" feature As it is used only inside native feature and not separately * Fix native test for sov-attester-incentives * Bump dalek-ed25519 to 2.0.0 (Sovereign-Labs#667) * Bump dalek-ed25519 to 2.0.0 * Fix serde serialization * Fixing lint and comments * Adding key converters and helpers * Remove temporary HexKey * Update key files structure * Fixing test! * Addressing nits * Fix `expose_rpc` macro to handle all cases of generics from Runtime (Sovereign-Labs#764) * Start working on it * Use different approach with phantom data, but... Lifetime strikes back so far * Start cleaning up and adding tests * Adding more tests and cleaning up * Adding some tests instead of removed ones * Fix lint error * Actually fix lint * EVM: Allow DA blobs with multiple transactions. (Sovereign-Labs#767) * ETH batch builder * EVM: allow building blocks with multiple transactions * undo changes in full-node/sov-sequencer/src/utils.rs * Add comments in tests * fix lint * fix cargo hack * Update to HexPrivateAndAddress * Add doc generation to the `genesis` macro. (Sovereign-Labs#772) * Add doc generation to genesis macro * make fields public * fix lint * Add a test case to `demo-simple-stf` (Sovereign-Labs#774) * add test case to demo-simple-stf * renaming * Add docs to dispatch call macro (Sovereign-Labs#775) * Plug in `sov-chain-state` module (Sovereign-Labs#776) * Introduce Da generic in demo-stf * Move sov-cli to demo-rollup * Clean up sov-cli usage * Refactor Generics to use Specs (Sovereign-Labs#780) * s/DA/Da/g * Progress * Progressing * Continue grouping generics * Adjust BlobSelector * Update module-system/module-implementations/sov-attester-incentives/src/call.rs * fix(examples): rebase * fix(avail): tx commitment * feat(demo-rollup): new_rollup_with_avail_da * fix(demo-prover-avail): rebase fixes * fix(demo-prover-avail): cleanup and import changes * fix(demo-prover-avail): fixed clap versioning issue * fix(avail-adapter): blake hasher target * feat(avail-adapter): send_transaction --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Filippo Costa <filippo@sovlabs.io> Co-authored-by: theochap <80177219+theochap@users.noreply.github.com> Co-authored-by: Preston Evans <preston.b.evans@gmail.com> Co-authored-by: Nikolai Golub <nikolai@sovlabs.io> Co-authored-by: Blazej Kolad <blazejkolad@gmail.com> Co-authored-by: Filippo Neysofu Costa <filippo@sovlabs.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dubbelosix <rohan@sovlabs.io> Co-authored-by: dubbelosix <dub@006.com> Co-authored-by: Andreas Tzionis <Andy0n7@gmail.com> Co-authored-by: omahs <73983677+omahs@users.noreply.github.com> Co-authored-by: Filippo Neysofu Costa <filippo@neysofu.me> Co-authored-by: Cem Özer <cem@sovlabs.io> Co-authored-by: Preston Evans <32944016+preston-evans98@users.noreply.github.com> Co-authored-by: Esad Yusuf Atik <esadyusufatik@gmail.com> Co-authored-by: orkunkilic <orkunmahirkilic@gmail.com> Co-authored-by: Victor Lopes <victor@codx.io> Co-authored-by: Cem Özer <cemozer2018@u.northwestern.edu>
…ec (#718) * Use Hash to serialize keys * Better naming conventions for Storage/Cachekey * Fix docs * Fix merge issues Signed-off-by: Filippo Costa <filippo@sovlabs.io> --------- Signed-off-by: Filippo Costa <filippo@sovlabs.io>
Description
This PR supersedes #689 and #644. This is the third iteration of the design:
Borrow
targets as keys as long as they serialize with Borsh. This, as noted, can cause different key types to serialize differently. feat: updateStateMap
to take borrowee of keys #644StateKeyEncodePreservingBorrow
target types as keys. This was a step in the right direction and maintained the invariants that we're interested in, but it's too easily prone to misuse by SDK users which may inadvertently produce subtle bugs if they're not too careful. Encoding-preservingStateMap
borrowee keys #689StateKeyCodec
,StateCodec
, andStateKeyEncodePreservingBorrow
traits, and useHash
to serialize all keys.Borrow
targets are always supposed toHash
the same way, and this invariant is relied upon byHashMap
of all types so it tends to be respected by all 3rd-party crates. It seems safer thanStateKeyEncodePreservingBorrow
.I also made minor changes to
StorageKey
andCacheKey
to allow use as reference, just like #644.Linked Issues
Related to #689 and #644.
Testing
I'm relying on the current existing tests as no new interfaces were added, only modified.
Docs
I modified the relevant docs for traits and
StateMap
.