Skip to content

Commit 1811b59

Browse files
theochapcemozerr
authored andcommitted
IBC chain state request: adding the code commitment and the genesis da height to the chain state module. (#490)
* Updating the chain state module with the code commitment and the initial da height * Changelog * Adding a getter for the genesis_da_height * Removing fuzz * Removing fuzz changes * Fixing proof generation * Adding aggregated_circuit_code_commitment * Updating code commitment names to respect inner/outer conventions * Changelog * Merging with nighly * Fixing celestia demo * Fixing bench
1 parent 888dfdf commit 1811b59

File tree

47 files changed

+285
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+285
-83
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- #490 Adds a `inner_code_commitment`, an `outer_code_commitment` and a `initial_da_height` field to the `ChainState` module. These fields should be initialized at genesis. Added getters for `genesis_da_height`, `outer_code_commitment` and `inner_code_commitment` in the `ChainState` module. Adapted the `demo-rollup` json configurations to use these fields. Added a new configuration folder for the stf tests that rely on `MockCodeCommitment` which have a different format from the `risc0` code commitments (32 bytes instead of 8). Modified the `AttesterIncentives` module to use the `inner_code_commitment` field from the `ChainState` module instead of the `commitment_to_allowed_challenger_method` field. Modified the `ProverIncentives` module to use the `outer_code_commitment` field from the `ChainState` module instead of the `commitment_of_allowed_verifier_method` field.
2+
13
- #487 Introduces the `AuthenticatedTransactionData` structure. This is the transaction data that passed the authentication phase. And updates `Accounts::CallMessage` format. This is a breaking change for consumers of the SDK only if they send messages directly to the Accounts module.
24

35
- #484 Adds a new `CodeCommitment` trait and applies it to the associated type of the ZKVM. The

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/demo-rollup/benches/node/rollup_coarse_measure.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,12 @@ async fn main() -> Result<(), anyhow::Error> {
125125
>::new();
126126

127127
let demo_genesis_config = {
128-
let integration_test_conf_dir: &Path = "../test-data/genesis/integration-tests".as_ref();
129-
let rt_params = create_genesis_config::<TestSpec, _>(&GenesisPaths::from_dir(
130-
integration_test_conf_dir,
131-
))
132-
.unwrap();
128+
let stf_tests_conf_dir: &Path = "../test-data/genesis/stf-tests".as_ref();
129+
let rt_params =
130+
create_genesis_config::<TestSpec, _>(&GenesisPaths::from_dir(stf_tests_conf_dir))
131+
.unwrap();
133132

134-
let chain_state =
135-
read_json_file(integration_test_conf_dir.join("chain_state.json")).unwrap();
133+
let chain_state = read_json_file(stf_tests_conf_dir.join("chain_state.json")).unwrap();
136134
let kernel_params = BasicKernelGenesisConfig { chain_state };
137135
GenesisParams {
138136
runtime: rt_params,

examples/demo-rollup/stf/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub(crate) fn create_storage_manager_for_tests(
3333

3434
pub(crate) fn create_genesis_config_for_tests<Da: DaSpec>(
3535
) -> GenesisParams<GenesisConfig<S, Da>, BasicKernelGenesisConfig<S, Da>> {
36-
let integ_test_conf_dir: &Path = "../../test-data/genesis/integration-tests".as_ref();
36+
let integ_test_conf_dir: &Path = "../../test-data/genesis/stf-tests".as_ref();
3737
let rt_params =
3838
create_genesis_config::<S, Da>(&GenesisPaths::from_dir(integ_test_conf_dir)).unwrap();
3939

examples/demo-rollup/tests/prover/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type DefaultSpec = sov_modules_api::default_spec::DefaultSpec<
2929

3030
mod datagen;
3131

32-
const DEFAULT_GENESIS_CONFIG_DIR: &str = "../test-data/genesis/benchmark";
32+
const DEFAULT_GENESIS_CONFIG_DIR: &str = "../test-data/genesis/integration-tests";
3333

3434
type TestSTF<'a> = StfBlueprint<
3535
DefaultSpec,

examples/test-data/genesis/benchmark/chain_state.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@
33
"secs": 0,
44
"nanos": 0
55
},
6-
"initial_base_fee_per_gas": [0, 0]
6+
"initial_base_fee_per_gas": [0, 0],
7+
"inner_code_commitment": [
8+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9+
0, 0, 0, 0, 0, 0, 0
10+
],
11+
"outer_code_commitment": [
12+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13+
0, 0, 0, 0, 0, 0, 0
14+
],
15+
"genesis_da_height": 0
716
}

examples/test-data/genesis/benchmark/prover_incentives.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"proving_penalty": 10,
33
"minimum_bond": 10,
4-
"commitment_of_allowed_verifier_method": [
5-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6-
0, 0, 0, 0, 0, 0, 0
7-
],
84
"initial_provers": [
95
["sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94", 10]
106
]

examples/test-data/genesis/demo/celestia/chain_state.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
"secs": 0,
44
"nanos": 0
55
},
6-
"initial_base_fee_per_gas": [0, 0]
6+
"initial_base_fee_per_gas": [0, 0],
7+
"inner_code_commitment": [0, 0, 0, 0, 0, 0, 0, 0],
8+
"outer_code_commitment": [
9+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
10+
0, 0, 0, 0, 0, 0, 0
11+
],
12+
"genesis_da_height": 3
713
}

examples/test-data/genesis/demo/celestia/prover_incentives.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"proving_penalty": 10,
33
"minimum_bond": 10,
4-
"commitment_of_allowed_verifier_method": [
5-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6-
0, 0, 0, 0, 0, 0, 0
7-
],
84
"initial_provers": [
95
["sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94", 10]
106
]

examples/test-data/genesis/demo/mock/chain_state.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
"secs": 0,
44
"nanos": 0
55
},
6-
"initial_base_fee_per_gas": [0, 0]
6+
"initial_base_fee_per_gas": [0, 0],
7+
"inner_code_commitment": [0, 0, 0, 0, 0, 0, 0, 0],
8+
"outer_code_commitment": [
9+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
10+
0, 0, 0, 0, 0, 0, 0
11+
],
12+
"genesis_da_height": 0
713
}

0 commit comments

Comments
 (0)