From af3fd83856969365f57426ce757b1f25a33a5f1d Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Mon, 5 Feb 2024 11:19:34 +0100 Subject: [PATCH 01/43] getDriftedPosition fix; test added --- geth-utils/gethutil/mpt/witness/branch.go | 34 ++++++----- .../gen_witness_from_local_blockchain_test.go | 56 +++++++++++++++++++ 2 files changed, 76 insertions(+), 14 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 9cbe21ea5d..082d56f8e9 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -154,21 +154,27 @@ func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []b func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { var nibbles []byte if leafKeyRow[0] != 248 { - keyLen := int(leafKeyRow[1] - 128) - if (leafKeyRow[2] != 32) && (leafKeyRow[2] != 0) { // second term is for extension node - if leafKeyRow[2] < 32 { // extension node - nibbles = append(nibbles, leafKeyRow[2]-16) - } else { // leaf - nibbles = append(nibbles, leafKeyRow[2]-48) + var keyLen int + if leafKeyRow[1] > 128 { + keyLen = int(leafKeyRow[1] - 128) + if (leafKeyRow[2] != 32) && (leafKeyRow[2] != 0) { // second term is for extension node + if leafKeyRow[2] < 32 { // extension node + nibbles = append(nibbles, leafKeyRow[2]-16) + } else { // leaf + nibbles = append(nibbles, leafKeyRow[2]-48) + } } - } - for i := 0; i < keyLen-1; i++ { // -1 because the first byte doesn't have any nibbles - b := leafKeyRow[3+i] - n1 := b / 16 - n2 := b - n1*16 - nibbles = append(nibbles, n1) - nibbles = append(nibbles, n2) - } + for i := 0; i < keyLen-1; i++ { // -1 because the first byte doesn't have any nibbles + b := leafKeyRow[3+i] + n1 := b / 16 + n2 := b - n1*16 + nibbles = append(nibbles, n1) + nibbles = append(nibbles, n2) + } + } else { + keyLen = 1 + nibbles = append(nibbles, leafKeyRow[1]-16) + } } else { keyLen := int(leafKeyRow[2] - 128) if (leafKeyRow[3] != 32) && (leafKeyRow[3] != 0) { // second term is for extension node diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go index 8471fb6353..9ac7cf939a 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go @@ -922,3 +922,59 @@ func TestExtNodeDeletedExtShortIsBranchFirstLevel(t *testing.T) { ExtNodeDeleted(key1, key2, key3, "ExtNodeDeletedExtShortIsBranchFirstLevel") } + +func TestExtensionIntoBranch(t *testing.T) { + SkipIfNoGeth(t) + oracle.NodeUrl = oracle.LocalUrl + + blockNum := 0 + blockNumberParent := big.NewInt(int64(blockNum)) + blockHeaderParent := oracle.PrefetchBlock(blockNumberParent, true, nil) + database := state.NewDatabase(blockHeaderParent) + statedb, _ := state.New(blockHeaderParent.Root, database, nil) + addr := common.HexToAddress("0x50efbf12580138bc623c95757286df4e24eb81c9") + + statedb.DisableLoadingRemoteAccounts() + + statedb.CreateAccount(addr) + + oracle.PreventHashingInSecureTrie = true // to store the unchanged key + + val0 := common.BigToHash(big.NewInt(int64(1))) + key0 := common.HexToHash("0x1200000000000000000000000000000000000000000000000000000000000000") + statedb.SetState(addr, key0, val0) + + key00 := common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000") + statedb.SetState(addr, key00, val0) + // After insertion of key0 and key00, we have a branch B with two leaves - at position 1 and 0. + + key1 := common.HexToHash("0x1234561000000000000000000000000000000000000000000000000000000000") + + // make the value long to have a hashed branch + v1 := common.FromHex("0xbbefaa12580138bc263c95757826df4e24eb81c9aaaaaaaaaaaaaaaaaaaaaaaa") + val1 := common.BytesToHash(v1) + statedb.SetState(addr, key1, val1) + // After insertion of key1, we have a branch B with a leaf at position 0 + // and an extension node E1 at position 1 (with one nibble: 2) + // The underlying branch B1 of E1 has two leaves - at position 0 and 3. + + key2 := common.HexToHash("0x1434563000000000000000000000000000000000000000000000000000000000") + // After inserting key2, we have a branch B with two nodes - a leaf at position 0 and branch B1 + // at position 1. At position 1 we have a branch B2 at position 2 (used to be E1's nibble) + // and a leaf at position 4 (newly added leaf). + // Branch B2 has two leaves - at position 0 and 3. + + v1 = common.FromHex("0xbb") + val := common.BytesToHash(v1) + trieMod := TrieModification{ + Type: StorageChanged, + Key: key2, + Value: val, + Address: addr, + } + trieModifications := []TrieModification{trieMod} + + prepareWitness("ExtensionIntoBranch", trieModifications, statedb) + + oracle.PreventHashingInSecureTrie = false +} From dd04ccc077f9d41ca91f886288371137cf0255fd Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Tue, 6 Feb 2024 11:04:51 +0100 Subject: [PATCH 02/43] Fix in equipLeafWithModExtensionNode; go fmt --- geth-utils/gethutil/mpt/witness/branch.go | 2 +- .../gen_witness_from_local_blockchain_test.go | 2 +- .../mpt/witness/modified_extension_node.go | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 082d56f8e9..dec0854efa 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -174,7 +174,7 @@ func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { } else { keyLen = 1 nibbles = append(nibbles, leafKeyRow[1]-16) - } + } } else { keyLen := int(leafKeyRow[2] - 128) if (leafKeyRow[3] != 32) && (leafKeyRow[3] != 0) { // second term is for extension node diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go index 9ac7cf939a..96dd49fee3 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go @@ -933,7 +933,7 @@ func TestExtensionIntoBranch(t *testing.T) { database := state.NewDatabase(blockHeaderParent) statedb, _ := state.New(blockHeaderParent.Root, database, nil) addr := common.HexToAddress("0x50efbf12580138bc623c95757286df4e24eb81c9") - + statedb.DisableLoadingRemoteAccounts() statedb.CreateAccount(addr) diff --git a/geth-utils/gethutil/mpt/witness/modified_extension_node.go b/geth-utils/gethutil/mpt/witness/modified_extension_node.go index 2e9eb331e1..de28a4bcc2 100644 --- a/geth-utils/gethutil/mpt/witness/modified_extension_node.go +++ b/geth-utils/gethutil/mpt/witness/modified_extension_node.go @@ -51,17 +51,6 @@ func equipLeafWithModExtensionNode(statedb *state.StateDB, leafNode Node, addr c longExtNodeKey[j] = longNibbles[j-byte(keyIndex)] } - k := trie.HexToKeybytes(longExtNodeKey) - ky := common.BytesToHash(k) - var proof [][]byte - var err error - if isAccountProof { - proof, _, _, _, _, err = statedb.GetProof(addr) - } else { - proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) - } - check(err) - // There is no short extension node when `len(longNibbles) - numberOfNibbles = 1`, in this case there // is simply a branch instead. shortExtNodeIsBranch := len(longNibbles)-numberOfNibbles == 1 @@ -71,6 +60,17 @@ func equipLeafWithModExtensionNode(statedb *state.StateDB, leafNode Node, addr c var extValuesC [][]byte if !shortExtNodeIsBranch { + k := trie.HexToKeybytes(longExtNodeKey) + ky := common.BytesToHash(k) + var proof [][]byte + var err error + if isAccountProof { + proof, _, _, _, _, err = statedb.GetProof(addr) + } else { + proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) + } + check(err) + if len2 > len1 { isItBranch := isBranch(proof[len(proof)-1]) From 39a8743317df28b7ce9819f54aea15bed906e8cb Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Fri, 9 Feb 2024 09:21:18 +0100 Subject: [PATCH 03/43] reapplying changes from PR #1724 --- bin/mpt-test/src/circuit/witness.rs | 74 +++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index 99b1514091..527811ddd5 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -215,11 +215,51 @@ impl Witness { storage_keys: Vec::new(), }); } - } + } let mut initial_values = Vec::new(); let mut changed_values = Vec::new(); + // Put the read proofs first: + if include_initial_values { + for entry in access_list.clone().0 { + let AccessListItem { + address, + storage_keys, + } = entry; + + let old = provider + .get_proof( + address, + storage_keys.clone(), + Some(BlockId::Number(BlockNumber::Number(block_no - 1))), + ) + .await?; + + // Skip if the account doesn't exist in the old block. + if old.balance.is_zero() && old.code_hash.is_zero() + && old.nonce.is_zero() && old.storage_hash.is_zero() + { + continue; + } + + initial_values.push(TrieModification::balance(address, old.balance)); + initial_values.push(TrieModification::nonce(address, old.nonce)); + initial_values.push(TrieModification::codehash(address, old.code_hash)); + + for key in storage_keys.iter() { + let old = old.storage_proof.iter().find(|p| p.key == *key).unwrap(); + if old.value == U256::zero() { + initial_values.push(TrieModification::storage_does_not_exist( + address, *key, old.value, + )); + } else { + initial_values.push(TrieModification::storage(address, *key, old.value)); + } + } + } + } + for entry in access_list.0 { let AccessListItem { address, @@ -252,23 +292,6 @@ impl Witness { continue; } - if include_initial_values { - initial_values.push(TrieModification::balance(address, old.balance)); - initial_values.push(TrieModification::nonce(address, old.nonce)); - initial_values.push(TrieModification::codehash(address, old.code_hash)); - - for key in storage_keys.iter() { - let old = old.storage_proof.iter().find(|p| p.key == *key).unwrap(); - if old.value == U256::zero() { - initial_values.push(TrieModification::storage_does_not_exist( - address, *key, old.value, - )); - } else { - initial_values.push(TrieModification::storage(address, *key, old.value)); - } - } - } - // check for this address changes if old.nonce != new.nonce { changed_values.push(TrieModification::nonce(address, new.nonce)); @@ -276,8 +299,8 @@ impl Witness { if old.balance != new.balance { changed_values.push(TrieModification::balance(address, new.balance)); } - if old.code_hash != new.code_hash - // && new.code_hash != *DEFAULT_CODE_HASH + + if old.code_hash != new.code_hash && new.code_hash != *DEFAULT_CODE_HASH { changed_values.push(TrieModification::codehash(address, new.code_hash)); } @@ -285,6 +308,17 @@ impl Witness { for key in storage_keys { let new = new.storage_proof.iter().find(|p| p.key == key).unwrap(); changed_values.push(TrieModification::storage(address, key, new.value)); + + /* + let old = old.storage_proof.iter().find(|p| p.key == key).unwrap(); + if old.value == U256::zero() && new.value == U256::zero() { + changed_values.push(TrieModification::storage_does_not_exist( + address, key, old.value, + )); + } else { + changed_values.push(TrieModification::storage(address, key, new.value)); + } + */ } } From 45582d1d879ae1dfe4c6c5878d5998f82ebeac8b Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Wed, 14 Feb 2024 09:54:36 +0100 Subject: [PATCH 04/43] Changes in witness.rs --- bin/mpt-test/src/circuit/witness.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index 527811ddd5..2c907c8f6a 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -307,23 +307,25 @@ impl Witness { for key in storage_keys { let new = new.storage_proof.iter().find(|p| p.key == key).unwrap(); - changed_values.push(TrieModification::storage(address, key, new.value)); - - /* let old = old.storage_proof.iter().find(|p| p.key == key).unwrap(); - if old.value == U256::zero() && new.value == U256::zero() { - changed_values.push(TrieModification::storage_does_not_exist( - address, key, old.value, - )); - } else { + if !(old.value == U256::zero() && new.value == U256::zero()) { changed_values.push(TrieModification::storage(address, key, new.value)); } - */ } } - let mut trie_modifications = initial_values; - trie_modifications.append(&mut changed_values); + println!("initial_values.len(): {}", initial_values.len()); + println!("changed_values.len(): {}", changed_values.len()); + + for c in changed_values.iter() { + println!("{:?}", c); + println!(""); + } + + // let mut trie_modifications = initial_values; + // trie_modifications.append(&mut changed_values); + + let trie_modifications = changed_values; Ok(Transforms { block_no, From 78899ef8a965f4cc6ed41c594599cfbee0c545a4 Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Thu, 15 Feb 2024 10:35:52 +0100 Subject: [PATCH 05/43] Only storage keys which change --- bin/mpt-test/src/circuit/witness.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index 2c907c8f6a..e8284df34a 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -7,6 +7,8 @@ use std::{ time::Duration, }; +use ethers::core::utils; + use eth_types::{Field, ToScalar}; use ethers::{ @@ -317,15 +319,8 @@ impl Witness { println!("initial_values.len(): {}", initial_values.len()); println!("changed_values.len(): {}", changed_values.len()); - for c in changed_values.iter() { - println!("{:?}", c); - println!(""); - } - - // let mut trie_modifications = initial_values; - // trie_modifications.append(&mut changed_values); - - let trie_modifications = changed_values; + let mut trie_modifications = initial_values; + trie_modifications.append(&mut changed_values); Ok(Transforms { block_no, From 77b2a737c4d110c4a7a2e7a8f990e0326efef816 Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Thu, 15 Feb 2024 12:47:24 +0100 Subject: [PATCH 06/43] params increased --- bin/mpt-test/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/mpt-test/src/main.rs b/bin/mpt-test/src/main.rs index ccd4dd6187..32ba057311 100644 --- a/bin/mpt-test/src/main.rs +++ b/bin/mpt-test/src/main.rs @@ -16,19 +16,20 @@ async fn mock_prove(block_no: u64, access_list: &str) -> Result<()> { let access_list: AccessList = serde_json::from_str(access_list)?; let proof_count = 2 * access_list.0.len() * 3 - + access_list + + 2 * access_list .0 .iter() .map(|k| k.storage_keys.len()) .sum::(); - let max_nodes = 40000; + let max_nodes = 1000000; + let degree = 20; let witness = Witness::::build(provider_url, U64::from(block_no), Some(access_list), true) .await? .unwrap(); - let circuit = StateUpdateCircuit::new(witness, 16, max_nodes, proof_count + 10)?; + let circuit = StateUpdateCircuit::new(witness, degree, max_nodes, proof_count + 10)?; circuit.assert_satisfied(); Ok(()) } From 4414c85fd78f8e7642e7db38694fda5e6799d2f6 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 21 Feb 2024 11:56:07 +0100 Subject: [PATCH 07/43] Wrong extension node test; adapting witness generator for wrong extension node --- bin/mpt-test/README.md | 6 +- ...gen_witness_from_infura_blockchain_test.go | 45 +++++++++++++++ .../gethutil/mpt/witness/prepare_witness.go | 57 ++++++++++++++++--- 3 files changed, 100 insertions(+), 8 deletions(-) diff --git a/bin/mpt-test/README.md b/bin/mpt-test/README.md index 53e28a214a..5997b66f2a 100644 --- a/bin/mpt-test/README.md +++ b/bin/mpt-test/README.md @@ -4,6 +4,11 @@ This tool aims to verify mainnet blocks for the MPT circuit. ## Running tests +Set the environment variable `WEB3_PROVIDER_URL` to a mainnet JSON-RPC provider, for example: +``` +export WEB3_PROVIDER_URL=https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 +``` + Just run `./test_mainnet_blocks.sh` NOTE: this run the tests with keccak testing disabled, because it takes SO MUCH to test with keccaks enables. If you want to run them with keccak, just run `cargo run --release --no-default-features`. @@ -13,7 +18,6 @@ NOTE: this run the tests with keccak testing disabled, because it takes SO MUCH In order to add more blocks to prove you have to: - Add new entry in the `access-lists` folder -- Set the environment variable `WEB3_SERVICE_PROVIDER` to a mainnet JSON-RPC provider - Run the tests again - You will have to upload the cache file again (web3_rpc_cache.bin) and update the `test_mainnet_blocks.sh` file diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 90c89d324e..132b818c11 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2334,3 +2334,48 @@ func TestStorageDoesNotExistOnlySProof(t *testing.T) { prepareWitness("StorageDoesNotExistOnlySProof", trieModifications, statedb) } + +func TestWrongExtensionNode(t *testing.T) { + blockNum := 0 + blockNumberParent := big.NewInt(int64(blockNum)) + blockHeaderParent := oracle.PrefetchBlock(blockNumberParent, true, nil) + database := state.NewDatabase(blockHeaderParent) + statedb, _ := state.New(blockHeaderParent.Root, database, nil) + addr := common.HexToAddress("0x40efbf12580138bc623c95757286df4e24eb81c9") + + statedb.DisableLoadingRemoteAccounts() + + statedb.CreateAccount(addr) + + oracle.PreventHashingInSecureTrie = true // to store the unchanged key + + key1 := common.HexToHash("0x1230000000000000000000000000000000000000000000000000000000000000") + key2 := common.HexToHash("0x1231000000000000000000000000000000000000000000000000000000000000") + + val1 := common.HexToHash("0xCE9F6C9634165F91E22E58B90E3EDE393D959E47") + val2 := common.HexToHash("0xEC9F6C9634165F91E22E58B90E3EDE393D959E47") + + statedb.SetState(addr, key1, val1) + statedb.SetState(addr, key2, val2) + + statedb.IntermediateRoot(false) + + // Returns extension node and branch + // key3 := common.HexToHash("0x1238000000000000000000000000000000000000000000000000000000000000") + + // Returns extension node + key3 := common.HexToHash("0x1200000000000000000000000000000000000000000000000000000000000000") + + val := common.BigToHash(big.NewInt(int64(17))) + trieMod := TrieModification{ + Type: StorageDoesNotExist, + Key: key3, + Value: val, + Address: addr, + } + trieModifications := []TrieModification{trieMod} + + prepareWitness("WrongExtensionNode", trieModifications, statedb) + + oracle.PreventHashingInSecureTrie = false +} diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 2149bb8c27..9335136485 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -263,6 +263,22 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st // Needs to be after `specialTest == 1` preparation: nodes = append(nodes, GetStartNode(proofType, sRoot, cRoot, specialTest)) + /* + if tMod.Type == StorageDoesNotExist { + fmt.Println("==================="); + fmt.Println(addr); + fmt.Println(tMod.Key); + fmt.Println(""); + + for i := 0; i < len(storageProof); i++ { + fmt.Println(storageProof[i]) + fmt.Println("") + } + fmt.Println("========"); + fmt.Println(""); + } + */ + // In convertProofToWitness, we can't use account address in its original form (non-hashed), because // of the "special" test for which we manually manipulate the "hashed" address and we don't have a preimage. // TODO: addr is used for calling GetProof for modified extension node only, might be done in a different way @@ -476,17 +492,44 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] node := prepareLeafAndPlaceholderNode(addr, addrh, proof1, proof2, storage_key, key, isAccountProof, false, false) nodes = append(nodes, node) } - } else if (len1 == 0 && len2 == 0) || isBranch(proof2[len(proof2)-1]) { + } else { // Account proof has drifted leaf as the last row, storage proof has non-existing-storage row // as the last row. // When non existing proof and only the branches are returned, we add a placeholder leaf. // This is to enable the lookup (in account leaf row), most constraints are disabled for these rows. - if isAccountProof { - node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) - nodes = append(nodes, node) - } else { - node := prepareStorageLeafPlaceholderNode(storage_key, key, keyIndex) - nodes = append(nodes, node) + + isLastBranch := isBranch(proof2[len(proof2)-1]) + + if (len1 == 0 && len2 == 0) || isLastBranch { + // We need to add a placeholder leaf + if isAccountProof { + node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) + nodes = append(nodes, node) + } else { + node := prepareStorageLeafPlaceholderNode(storage_key, key, keyIndex) + nodes = append(nodes, node) + } + } else if len(extNibblesC) > len(proof2)-1 { + isLastExtNode := len(extNibblesC[len(proof2)-1]) != 0 + if isLastExtNode { + // We need to add a placeholder branch and a placeholder leaf. + // We are in a non-existing-proof and an extension node is the last element of getProof. + // However, this extension node has not been added to the nodes yet (it's always added + // together with a branch). + // It's non-existing-proof and we have a "wrong" extension node, that means we have + // to obtain the underlying branch to be able to finally add (besides this branch) + // the placeholder leaf. So we need to query getProof again with one of the leaves that is + // actually in this extension node. + // TODO: + if isAccountProof { + node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) + nodes = append(nodes, node) + } else { + node := prepareStorageLeafPlaceholderNode(storage_key, key, keyIndex) + + nodes = append(nodes, node) + } + } } } From bd82e59599bafd76d031dc3f1867bce50177ae12 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Thu, 22 Feb 2024 11:51:58 +0100 Subject: [PATCH 08/43] Preparing witness for wrong extension node --- geth-utils/gethutil/mpt/witness/branch.go | 12 ++++-- .../gethutil/mpt/witness/prepare_witness.go | 37 ++++++++++++++++++- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index dec0854efa..eb59b86fe8 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -149,9 +149,8 @@ func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []b return node } -// getDriftedPosition returns the position in branch to which the leaf drifted because another -// leaf has been added to the same slot. This information is stored into a branch init row. -func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { +// getNibbles returns the nibbles of the leaf or extension node. +func getNibbles(leafKeyRow []byte) []byte { var nibbles []byte if leafKeyRow[0] != 248 { var keyLen int @@ -193,6 +192,13 @@ func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { } } + return nibbles +} + +// getDriftedPosition returns the position in branch to which the leaf drifted because another +// leaf has been added to the same slot. This information is stored into a branch init row. +func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { + nibbles := getNibbles(leafKeyRow) return nibbles[numberOfNibbles] } diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 9335136485..c5c4705f06 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -520,13 +520,46 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // to obtain the underlying branch to be able to finally add (besides this branch) // the placeholder leaf. So we need to query getProof again with one of the leaves that is // actually in this extension node. - // TODO: if isAccountProof { + // TODO node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) nodes = append(nodes, node) } else { - node := prepareStorageLeafPlaceholderNode(storage_key, key, keyIndex) + nibbles := getNibbles(proof2[len(proof2)-1]) + newKey := make([]byte, len(key)) + copy(newKey, key) + + for i := 0; i < len(nibbles); i++ { + n := nibbles[i] + if key[i] != n { + newKey[i] = n + } + } + + // The last nibble should be the one that gets one of the leaves + // in the branch (not nil): + var proof [][]byte + var err error + for i := 0; i < 16; i++ { + newKey[keyIndex] = byte(i) + k := trie.HexToKeybytes(newKey) + ky := common.BytesToHash(k) + proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) + check(err) + if !isBranch(proof[len(proof)-1]) { + break + } + } + + branchRlp := proof[len(proof)-2] // the last element has to be a leaf + isExtension := true + + extNode := proof2[len(proof2)-1] + bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, + key[keyIndex], key[keyIndex], false, false, isExtension) + nodes = append(nodes, bNode) + node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], nil, storage_key, key, nonExistingStorageProof, false, false, false, false) nodes = append(nodes, node) } } From a90ae32b5a82ef4bc7894557cfbc5553dd45b4e5 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 27 Feb 2024 12:27:56 +0100 Subject: [PATCH 09/43] Construct placeholder leaf for wrong extension node case --- .../gethutil/mpt/witness/prepare_witness.go | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index c5c4705f06..0fb173d0e7 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -554,12 +554,42 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] branchRlp := proof[len(proof)-2] // the last element has to be a leaf isExtension := true - extNode := proof2[len(proof2)-1] + extNode := proof2[len(proof2)-1] // Let's name it E1 bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, key[keyIndex], key[keyIndex], false, false, isExtension) nodes = append(nodes, bNode) - node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + /* + Let's say we have an extension node E1 at the following path [3, 5, 8]. + Let's say E1 has nibbles [1, 2, 3]. Let's say we want to prove there does not exist + a leaf at [3, 5, 8, 1, 2] (because there is E1 there). + + We need to construct a leaf L1 that will have the key equal to the queried key. + This means the nibbles are the same as in the path to E1 (without extension nibbles). + + In the circuit, the leaf L1 will have the same key as the queried key once + the KeyData will be queried with offset 1 (to get the accumulated key RLC up until E1). + The nibbles stored in L1 will be added to the RLC and compared with the queried + key (has to be the same). + */ + + l := keyIndex - len(nibbles) + path := make([]byte, l) // Up to the E1 nibbles (without them) + copy(path, key[:l]) + // The remaining `key` nibbles are to be stored in the constructed leaf. + + compact := trie.HexToCompact(key[l:]) + // Add RLP: + compactLen := byte(len(compact)) + rlp2 := 128 + compactLen + rlp1 := 192 + compactLen + 1 + // Constructed leaf L1: + constructedLeaf := append([]byte{rlp1, rlp2}, compact...) + + // Add dummy value: + constructedLeaf = append(constructedLeaf, 1) + + node := prepareStorageLeafNode(proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) nodes = append(nodes, node) } } From ca7e2d56574d437a4e7f26e9490daf3134a2f3cb Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 28 Feb 2024 13:06:07 +0100 Subject: [PATCH 10/43] is_extension added to ParentData (for wrong extension data handling); constructedLeaf in witness generator used now only for wrong row --- geth-utils/gethutil/mpt/state/statedb.go | 2 +- geth-utils/gethutil/mpt/trie/proof.go | 10 ---------- geth-utils/gethutil/mpt/witness/leaf.go | 13 +++++++++---- .../gethutil/mpt/witness/prepare_witness.go | 6 +++--- .../src/mpt_circuit/account_leaf.rs | 3 +++ .../src/mpt_circuit/extension_branch.rs | 8 ++++++-- zkevm-circuits/src/mpt_circuit/helpers.rs | 19 +++++++++++++++---- zkevm-circuits/src/mpt_circuit/start.rs | 2 ++ .../src/mpt_circuit/storage_leaf.rs | 3 +++ 9 files changed, 42 insertions(+), 24 deletions(-) diff --git a/geth-utils/gethutil/mpt/state/statedb.go b/geth-utils/gethutil/mpt/state/statedb.go index 616f629b6d..56b076c17a 100644 --- a/geth-utils/gethutil/mpt/state/statedb.go +++ b/geth-utils/gethutil/mpt/state/statedb.go @@ -457,7 +457,7 @@ func (s *StateDB) SetStateObjectIfExists(addr common.Address) { } /* - When an account that does not exist is tried to be fetched by PrefetchAccount and when the some other account + When an account that does not exist is being fetched by PrefetchAccount and when some other account exist at the overlapping address (the beginning of it), this (wrong) account is obtained by PrefetchAccount and needs to be ignored. */ diff --git a/geth-utils/gethutil/mpt/trie/proof.go b/geth-utils/gethutil/mpt/trie/proof.go index 23b624686b..2603265071 100644 --- a/geth-utils/gethutil/mpt/trie/proof.go +++ b/geth-utils/gethutil/mpt/trie/proof.go @@ -102,7 +102,6 @@ func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.KeyValueWriter) ( fromLevel-- continue } - // var hn Node // We need nibbles in witness for extension keys. // copy n.Key before it gets changed in ProofHash @@ -115,20 +114,11 @@ func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.KeyValueWriter) ( } } - // n, hn = hasher.ProofHash(n) n, _ = hasher.ProofHash(n) - // if hash, ok := hn.(HashNode); ok || i == 0 { // If the node's database encoding is a hash (or is the // root node), it becomes a proof element. enc, _ := rlp.EncodeToBytes(n) - /* - if !ok { - hash = hasher.HashData(enc) - } - */ - // proofDb.Put(hash, enc) proofDb.Put([]byte{1, 1, 1}, enc) - // } } isNeighbourNodeHashed := false diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index 308490d6c6..12f78416eb 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -341,7 +341,7 @@ func prepareLeafAndPlaceholderNode(addr common.Address, addrh []byte, proof1, pr isSPlaceholder = true } - return prepareStorageLeafNode(leaf, leaf, nil, storage_key, key, false, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension) + return prepareStorageLeafNode(leaf, leaf, nil, nil, storage_key, key, false, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension) } } @@ -416,7 +416,7 @@ func prepareStorageLeafPlaceholderNode(storage_key common.Hash, key []byte, keyI keyLen := getLeafKeyLen(keyIndex) leaf[0] = 192 + 1 + byte(keyLen) + 1 - return prepareStorageLeafNode(leaf, leaf, nil, storage_key, key, false, true, true, false, false) + return prepareStorageLeafNode(leaf, leaf, nil, nil, storage_key, key, false, true, true, false, false) } func prepareStorageLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte, []byte, []byte, []byte) { @@ -502,7 +502,7 @@ func prepareStorageLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte return key, value, keyRlp, valueRlp } -func prepareStorageLeafNode(leafS, leafC, neighbourNode []byte, storage_key common.Hash, key []byte, nonExistingStorageProof, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension bool) Node { +func prepareStorageLeafNode(leafS, leafC, constructedLeaf, neighbourNode []byte, storage_key common.Hash, key []byte, nonExistingStorageProof, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension bool) Node { var rows [][]byte keyS, valueS, listRlpBytes1, valueRlpBytes1 := prepareStorageLeafInfo(leafS, false, isSPlaceholder) @@ -533,7 +533,11 @@ func prepareStorageLeafNode(leafS, leafC, neighbourNode []byte, storage_key comm var nonExistingStorageRow []byte var wrongRlpBytes []byte if nonExistingStorageProof { - wrongRlpBytes, nonExistingStorageRow = prepareNonExistingStorageRow(leafC, key) + if constructedLeaf != nil { + wrongRlpBytes, nonExistingStorageRow = prepareNonExistingStorageRow(constructedLeaf, key) + } else { + wrongRlpBytes, nonExistingStorageRow = prepareNonExistingStorageRow(leafC, key) + } } else { nonExistingStorageRow = prepareEmptyNonExistingStorageRow() } @@ -555,6 +559,7 @@ func prepareStorageLeafNode(leafS, leafC, neighbourNode []byte, storage_key comm ValueRlpBytes: valueRlpBytes, IsModExtension: [2]bool{isSModExtension, isCModExtension}, } + keccakData := [][]byte{leafS, leafC, storage_key.Bytes()} if neighbourNode != nil { keccakData = append(keccakData, neighbourNode) diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 0fb173d0e7..87a636e037 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -412,7 +412,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] if isAccountProof { node = prepareAccountLeafNode(addr, addrh, proof1[l-1], proof2[l-1], nil, key, false, false, false) } else { - node = prepareStorageLeafNode(proof1[l-1], proof2[l-1], nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + node = prepareStorageLeafNode(proof1[l-1], proof2[l-1], nil, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) } nodes = append(nodes, node) @@ -466,7 +466,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } else { // Add storage leaf after branch placeholder if !isModifiedExtNode { - leafNode = prepareStorageLeafNode(proof1[len1-1], proof2[len2-1], neighbourNode, storage_key, key, nonExistingStorageProof, false, false, false, false) + leafNode = prepareStorageLeafNode(proof1[len1-1], proof2[len2-1], nil, neighbourNode, storage_key, key, nonExistingStorageProof, false, false, false, false) } else { isSModExtension := false isCModExtension := false @@ -589,7 +589,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // Add dummy value: constructedLeaf = append(constructedLeaf, 1) - node := prepareStorageLeafNode(proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) nodes = append(nodes, node) } } diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 35d27bc4c6..36fc0bb4e0 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -335,6 +335,7 @@ impl AccountLeafConfig { 0.expr(), true.expr(), false.expr(), + false.expr(), storage_items[is_s.idx()].word(), ); } @@ -372,6 +373,7 @@ impl AccountLeafConfig { &key_rlc[true.idx()], &wrong_bytes, config.is_placeholder_leaf[true.idx()].expr(), + config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), &cb.key_r.expr(), ); @@ -641,6 +643,7 @@ impl AccountLeafConfig { 0.scalar(), true, false, + false, storage_items[is_s.idx()].word(), )?; } diff --git a/zkevm-circuits/src/mpt_circuit/extension_branch.rs b/zkevm-circuits/src/mpt_circuit/extension_branch.rs index 920136e550..59d53ce4e3 100644 --- a/zkevm-circuits/src/mpt_circuit/extension_branch.rs +++ b/zkevm-circuits/src/mpt_circuit/extension_branch.rs @@ -158,6 +158,7 @@ impl ExtensionBranchConfig { branch.mod_rlc[is_s.idx()].expr(), false.expr(), false.expr(), + config.is_extension.expr(), WordLoHi::zero(), ); } elsex { @@ -184,6 +185,7 @@ impl ExtensionBranchConfig { config.parent_data[is_s.idx()].rlc.expr(), config.parent_data[is_s.idx()].is_root.expr(), true.expr(), + config.is_extension.expr(), branch.mod_word[is_s.idx()].clone(), ); }} @@ -205,8 +207,8 @@ impl ExtensionBranchConfig { ) -> Result<(), Error> { let extension_branch = &node.extension_branch.clone().unwrap(); - self.is_extension - .assign(region, offset, extension_branch.is_extension.scalar())?; + let is_extension = extension_branch.is_extension.scalar(); + self.is_extension.assign(region, offset, is_extension)?; let key_data = self.key_data @@ -291,6 +293,7 @@ impl ExtensionBranchConfig { mod_node_hash_rlc[is_s.idx()], false, false, + is_extension == 1.into(), WordLoHi::zero(), )?; } else { @@ -313,6 +316,7 @@ impl ExtensionBranchConfig { parent_data[is_s.idx()].rlc, parent_data[is_s.idx()].is_root, true, + is_extension == 1.into(), mod_node_hash_word[is_s.idx()], )?; } diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 2504f30a6d..87c376a95c 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -558,6 +558,7 @@ pub(crate) struct ParentData { pub(crate) rlc: Cell, pub(crate) is_root: Cell, pub(crate) is_placeholder: Cell, + pub(crate) is_extension: Cell, pub(crate) drifted_parent_hash: WordLoHiCell, } @@ -567,6 +568,7 @@ pub(crate) struct ParentDataWitness { pub(crate) rlc: F, pub(crate) is_root: bool, pub(crate) is_placeholder: bool, + pub(crate) is_extension: bool, pub(crate) drifted_parent_hash: WordLoHi, } @@ -581,6 +583,7 @@ impl ParentData { rlc: cb.query_cell_with_type(MptCellType::StoragePhase2), is_root: cb.query_cell(), is_placeholder: cb.query_cell(), + is_extension: cb.query_cell(), drifted_parent_hash: cb.query_word_unchecked(), }; circuit!([meta, cb.base], { @@ -593,6 +596,7 @@ impl ParentData { parent_data.rlc.expr(), parent_data.is_root.expr(), parent_data.is_placeholder.expr(), + parent_data.is_extension.expr(), parent_data.drifted_parent_hash.lo().expr(), parent_data.drifted_parent_hash.hi().expr(), ], @@ -608,6 +612,7 @@ impl ParentData { rlc: Expression, is_root: Expression, is_placeholder: Expression, + is_extension: Expression, drifted_parent_hash: WordLoHi>, ) { memory.store( @@ -618,6 +623,7 @@ impl ParentData { rlc, is_root, is_placeholder, + is_extension, drifted_parent_hash.lo(), drifted_parent_hash.hi(), ], @@ -633,6 +639,7 @@ impl ParentData { rlc: F, force_hashed: bool, is_placeholder: bool, + is_extension: bool, drifted_parent_hash: WordLoHi, ) -> Result<(), Error> { memory.witness_store( @@ -643,6 +650,7 @@ impl ParentData { rlc, force_hashed.scalar(), is_placeholder.scalar(), + is_extension.scalar(), drifted_parent_hash.lo(), drifted_parent_hash.hi(), ], @@ -664,19 +672,21 @@ impl ParentData { self.rlc.assign(region, offset, values[2])?; self.is_root.assign(region, offset, values[3])?; self.is_placeholder.assign(region, offset, values[4])?; + self.is_extension.assign(region, offset, values[5])?; self.drifted_parent_hash .lo() - .assign(region, offset, values[5])?; + .assign(region, offset, values[6])?; self.drifted_parent_hash .hi() - .assign(region, offset, values[6])?; + .assign(region, offset, values[7])?; Ok(ParentDataWitness { hash: WordLoHi::new([values[0], values[1]]), rlc: values[2], is_root: values[3] == 1.scalar(), is_placeholder: values[4] == 1.scalar(), - drifted_parent_hash: WordLoHi::new([values[5], values[6]]), + is_extension: values[5] == 1.scalar(), + drifted_parent_hash: WordLoHi::new([values[6], values[7]]), }) } } @@ -1220,13 +1230,14 @@ impl WrongGadget { key_rlc: &Expression, expected_item: &RLPItemView, is_placeholder: Expression, + is_parent_extension: Expression, key_data: KeyData, r: &Expression, ) -> Self { let mut config = WrongGadget::default(); circuit!([meta, cb.base], { // Get the previous key data - ifx! {(is_non_existing, not!(is_placeholder)) => { + ifx! {and::expr(&[is_non_existing, not!(is_placeholder), not!(is_parent_extension)]) => { // Calculate the key config.wrong_rlp_key = ListKeyGadget::construct(cb, expected_item); let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( diff --git a/zkevm-circuits/src/mpt_circuit/start.rs b/zkevm-circuits/src/mpt_circuit/start.rs index 0e1fce33b6..3e332a158d 100644 --- a/zkevm-circuits/src/mpt_circuit/start.rs +++ b/zkevm-circuits/src/mpt_circuit/start.rs @@ -67,6 +67,7 @@ impl StartConfig { 0.expr(), true.expr(), false.expr(), + false.expr(), root[is_s.idx()].clone(), ); KeyData::store_defaults(cb, &mut ctx.memory[key_memory(is_s)]); @@ -121,6 +122,7 @@ impl StartConfig { 0.scalar(), true, false, + false, root[is_s.idx()], )?; KeyData::witness_store( diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 5fb89eaffd..8fdb9d01d5 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -250,6 +250,7 @@ impl StorageLeafConfig { 0.expr(), true.expr(), false.expr(), + false.expr(), WordLoHi::zero(), ); } @@ -291,6 +292,7 @@ impl StorageLeafConfig { &key_rlc[true.idx()], &expected_item, config.is_placeholder_leaf[true.idx()].expr(), + config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), &cb.key_r.expr(), ); @@ -517,6 +519,7 @@ impl StorageLeafConfig { F::ZERO, true, false, + false, WordLoHi::::new([F::ZERO, F::ZERO]), )?; From f70caceb1876112f4b5ed8321f9dc628dc7014ee Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 6 Mar 2024 10:29:56 +0100 Subject: [PATCH 11/43] WrongGadget supports wrong extension nodes now --- ...gen_witness_from_infura_blockchain_test.go | 3 - .../gethutil/mpt/witness/prepare_witness.go | 46 +- zkevm-circuits/src/mpt_circuit.rs | 3 +- .../src/mpt_circuit/account_leaf.rs | 16 +- zkevm-circuits/src/mpt_circuit/helpers.rs | 87 ++-- .../src/mpt_circuit/storage_leaf.rs | 16 +- .../mpt_circuit/tests/WrongExtensionNode.json | 413 ++++++++++++++++++ 7 files changed, 530 insertions(+), 54 deletions(-) create mode 100644 zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 132b818c11..24b90893fb 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2360,9 +2360,6 @@ func TestWrongExtensionNode(t *testing.T) { statedb.IntermediateRoot(false) - // Returns extension node and branch - // key3 := common.HexToHash("0x1238000000000000000000000000000000000000000000000000000000000000") - // Returns extension node key3 := common.HexToHash("0x1200000000000000000000000000000000000000000000000000000000000000") diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 87a636e037..f3751f1fb4 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -525,10 +525,28 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) nodes = append(nodes, node) } else { + /* + Let's say we have an extension node E1 at the following path [3, 5, 8]. + Let's say E1 has nibbles [1, 2, 3]. Let's say we want to prove there does not exist + a leaf at [3, 5, 8, 1, 2, 4] (because there is overlapping path with E1). + + We need to construct a leaf L1 that will have the key equal to the queried key. + This means the nibbles are the same as in the path to E1 (without extension nibbles). + + In the circuit, the leaf L1 will have the same key as the queried key once + the KeyData will be queried with offset 1 (to get the accumulated key RLC up until E1). + The nibbles stored in L1 will be added to the RLC and compared with the queried + key (has to be the same). + */ nibbles := getNibbles(proof2[len(proof2)-1]) newKey := make([]byte, len(key)) copy(newKey, key) + /* + Following the above example, the queried key `key` is [3, 5, 8, 1, 2, 4]. + The path to E1 and its nibbles is [3, 5, 8, 1, 2, 3]. + We construct the key `newKey` to get the underlying branch of E1. + */ for i := 0; i < len(nibbles); i++ { n := nibbles[i] if key[i] != n { @@ -536,8 +554,10 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } } - // The last nibble should be the one that gets one of the leaves - // in the branch (not nil): + /* + The last nibble should be the one that gets one of the leaves in the branch (not nil) - + to get the leaf in branch as well. + */ var proof [][]byte var err error for i := 0; i < 16; i++ { @@ -559,24 +579,12 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] key[keyIndex], key[keyIndex], false, false, isExtension) nodes = append(nodes, bNode) - /* - Let's say we have an extension node E1 at the following path [3, 5, 8]. - Let's say E1 has nibbles [1, 2, 3]. Let's say we want to prove there does not exist - a leaf at [3, 5, 8, 1, 2] (because there is E1 there). - - We need to construct a leaf L1 that will have the key equal to the queried key. - This means the nibbles are the same as in the path to E1 (without extension nibbles). - - In the circuit, the leaf L1 will have the same key as the queried key once - the KeyData will be queried with offset 1 (to get the accumulated key RLC up until E1). - The nibbles stored in L1 will be added to the RLC and compared with the queried - key (has to be the same). - */ - + // Let's construct the leaf L1 that will have the correct key (the queried one) l := keyIndex - len(nibbles) - path := make([]byte, l) // Up to the E1 nibbles (without them) + // path will have nibbles up to the E1 nibbles (but without them) - in our example [3 5 8] + path := make([]byte, l) copy(path, key[:l]) - // The remaining `key` nibbles are to be stored in the constructed leaf. + // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] compact := trie.HexToCompact(key[l:]) // Add RLP: @@ -587,7 +595,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] constructedLeaf := append([]byte{rlp1, rlp2}, compact...) // Add dummy value: - constructedLeaf = append(constructedLeaf, 1) + constructedLeaf = append(constructedLeaf, 0) node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) nodes = append(nodes, node) diff --git a/zkevm-circuits/src/mpt_circuit.rs b/zkevm-circuits/src/mpt_circuit.rs index 8f4dfbbc9f..73586f5ede 100644 --- a/zkevm-circuits/src/mpt_circuit.rs +++ b/zkevm-circuits/src/mpt_circuit.rs @@ -253,7 +253,7 @@ impl MPTConfig { let mut state_cm = CellManager::new(50, 0); state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase1, 0, false, 20); - state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase2, 1, false, 6); + state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase2, 1, false, 7); state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase3, 2, false, 5); state_cm.add_columns(meta, &mut cb.base, lu(MptTableType::Byte), 0, false, 4); state_cm.add_columns(meta, &mut cb.base, lu(MptTableType::Fixed), 2, false, 3); @@ -771,6 +771,7 @@ mod tests { #[test] fn test_mpt() { let path = "src/mpt_circuit/tests"; + let files = fs::read_dir(path).unwrap(); files .filter_map(Result::ok) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 36fc0bb4e0..65c6d413d7 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -38,6 +38,7 @@ use crate::{ pub(crate) struct AccountLeafConfig { main_data: MainData, key_data: [KeyData; 2], + key_data_prev: KeyData, parent_data: [ParentData; 2], rlp_key: [ListKeyGadget; 2], value_rlp_bytes: [[Cell; 2]; 2], @@ -164,6 +165,8 @@ impl AccountLeafConfig { // Constraint 4: parent_data[1] = ParentData::load(cb, &mut ctx.memory[parent_memory(false)], 0.expr()); + config.key_data_prev = KeyData::load(cb, &mut ctx.memory[key_memory(false)], 1.expr()); + let key_data = &mut config.key_data; // Constraint 5: key_data[0] = KeyData::load(cb, &mut ctx.memory[key_memory(true)], 0.expr()); @@ -364,7 +367,7 @@ impl AccountLeafConfig { &cb.key_r.expr(), ); - // Wrong leaf handling + // Wrong leaf / extension node handling config.wrong = WrongGadget::construct( cb, key_item.hash_rlc(), @@ -375,6 +378,7 @@ impl AccountLeafConfig { config.is_placeholder_leaf[true.idx()].expr(), config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), + config.key_data_prev.clone(), &cb.key_r.expr(), ); @@ -695,7 +699,13 @@ impl AccountLeafConfig { region.key_r, )?; - // Wrong leaf handling + // Wrong leaf / extension node handling + let key_data_prev = self.key_data_prev.witness_load( + region, + offset, + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; self.wrong.assign( region, offset, @@ -704,7 +714,9 @@ impl AccountLeafConfig { &account.wrong_rlp_bytes, &expected_item, true, + parent_data[1].is_extension, key_data[true.idx()].clone(), + key_data_prev, region.key_r, )?; diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 87c376a95c..ce186b98ca 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1232,33 +1232,54 @@ impl WrongGadget { is_placeholder: Expression, is_parent_extension: Expression, key_data: KeyData, + key_data_prev: KeyData, r: &Expression, ) -> Self { let mut config = WrongGadget::default(); circuit!([meta, cb.base], { // Get the previous key data - ifx! {and::expr(&[is_non_existing, not!(is_placeholder), not!(is_parent_extension)]) => { - // Calculate the key + ifx! {and::expr(&[is_non_existing, not!(is_placeholder)]) => { config.wrong_rlp_key = ListKeyGadget::construct(cb, expected_item); - let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( - cb, - config.wrong_rlp_key.key_value.clone(), - key_data.mult.expr(), - key_data.is_odd.expr(), - r, - ); - // Check that it's the key as expected - require!(key_rlc_wrong => expected_key); - - // Now make sure this address is different than the one of the leaf - config.is_key_equal = IsEqualGadget::construct( - &mut cb.base, - key_rlc.expr(), - expected_key, - ); - require!(config.is_key_equal.expr() => false); - // Make sure the lengths of the keys are the same - require!(config.wrong_rlp_key.key_value.len() => key_value.len()); + + ifx! {not!(is_parent_extension) => { + let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( + cb, + config.wrong_rlp_key.key_value.clone(), + key_data.mult.expr(), + key_data.is_odd.expr(), + r, + ); + // Check that it's the key as expected + require!(key_rlc_wrong => expected_key.clone()); + + // Now make sure this address is different than the one of the leaf + config.is_key_equal = IsEqualGadget::construct( + &mut cb.base, + key_rlc.expr(), + expected_key.clone(), + ); + require!(config.is_key_equal.expr() => false); + // Make sure the lengths of the keys are the same + require!(config.wrong_rlp_key.key_value.len() => key_value.len()); + } elsex { + let key_rlc_wrong = key_data_prev.rlc.expr() + config.wrong_rlp_key.key.expr( + cb, + config.wrong_rlp_key.key_value.clone(), + key_data_prev.mult.expr(), + key_data_prev.is_odd.expr(), + r, + ); + // Check that it's the key as expected + require!(key_rlc_wrong => expected_key.clone()); + + // We don't need to check `is_key_equal = false` because we have the extension node + // above, not the leaf - the two nodes are different without checking the key. + + // We don't need to check that the lengths of the keys are the same because + // they are actually different in this case - one leaf is in the extension node's + // branch (and its path is longer due to extension nibbles), one ("wrong", but with + // the correct address/key) is not in the extension node's branch. + }} }} config }) @@ -1274,19 +1295,31 @@ impl WrongGadget { list_bytes: &[u8], expected_item: &RLPItemWitness, for_placeholder_s: bool, + is_parent_extension: bool, key_data: KeyDataWitness, + key_data_prev: KeyDataWitness, r: F, ) -> Result<(F, F), Error> { if is_non_existing { let wrong_witness = self.wrong_rlp_key .assign(region, offset, list_bytes, expected_item)?; - let (key_rlc_wrong, _) = wrong_witness.key.key( - wrong_witness.key_item.clone(), - key_data.rlc, - key_data.mult, - r, - ); + let key_rlc_wrong: F; + if !is_parent_extension { + (key_rlc_wrong, _) = wrong_witness.key.key( + wrong_witness.key_item.clone(), + key_data.rlc, + key_data.mult, + r, + ); + } else { + (key_rlc_wrong, _) = wrong_witness.key.key( + wrong_witness.key_item.clone(), + key_data_prev.rlc, + key_data_prev.mult, + r, + ); + } let is_key_equal_witness = self.is_key_equal.assign( region, diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 8fdb9d01d5..f7656588f5 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -39,6 +39,7 @@ use super::{ pub(crate) struct StorageLeafConfig { main_data: MainData, key_data: [KeyData; 2], + key_data_prev: KeyData, parent_data: [ParentData; 2], rlp_key: [ListKeyGadget; 2], value_rlp_bytes: [[Cell; 1]; 2], @@ -112,6 +113,8 @@ impl StorageLeafConfig { parent_data[0] = ParentData::load(cb, &mut ctx.memory[parent_memory(true)], 0.expr()); parent_data[1] = ParentData::load(cb, &mut ctx.memory[parent_memory(false)], 0.expr()); + config.key_data_prev = KeyData::load(cb, &mut ctx.memory[key_memory(false)], 1.expr()); + let key_data = &mut config.key_data; key_data[0] = KeyData::load(cb, &mut ctx.memory[key_memory(true)], 0.expr()); key_data[1] = KeyData::load(cb, &mut ctx.memory[key_memory(false)], 0.expr()); @@ -283,7 +286,7 @@ impl StorageLeafConfig { &cb.key_r.expr(), ); - // Wrong leaf handling + // Wrong leaf / extension node handling config.wrong = WrongGadget::construct( cb, key_item.hash_rlc(), @@ -294,6 +297,7 @@ impl StorageLeafConfig { config.is_placeholder_leaf[true.idx()].expr(), config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), + config.key_data_prev.clone(), &cb.key_r.expr(), ); @@ -553,7 +557,13 @@ impl StorageLeafConfig { region.key_r, )?; - // Wrong leaf handling + // Wrong leaf / extension node handling + let key_data_prev = self.key_data_prev.witness_load( + region, + offset, + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; let (_key_rlc, _) = self.wrong.assign( region, offset, @@ -562,7 +572,9 @@ impl StorageLeafConfig { &storage.wrong_rlp_bytes, &expected_item, false, + parent_data[1].is_extension, key_data[true.idx()].clone(), + key_data_prev, region.key_r, )?; diff --git a/zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json new file mode 100644 index 0000000000..58c6c32bae --- /dev/null +++ b/zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json @@ -0,0 +1,413 @@ +[ + { + "start": { + "disable_preimage_check": true, + "proof_type": "StorageDoesNotExist" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200", + "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200" + ], + "keccak_data": [] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", + "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", + "a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bd00", + "a0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf002100", + "a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e000", + "a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d84464800", + "a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e700", + "a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92d00", + "a0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb72100", + "a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd7168100", + "a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec8447200", + "a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8e00", + "a09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc220800", + "a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94ec00", + "a07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df47500", + "a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a000", + "a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb00", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80", + "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 15, + "drifted_index": 15, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", + "a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063e00", + "a033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b900", + "a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f91400", + "a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c900", + "a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6b00", + "a08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef700", + "a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb76600", + "a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e100", + "a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef5681115500", + "a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f200", + "a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a38360000", + "a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b1700", + "a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abace00", + "a00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f500", + "a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d400", + "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580", + "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 2, + "drifted_index": 2, + "list_rlp_bytes": [ + "f901b1", + "f901b1" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", + "a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218a00", + "a019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e800", + "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a11000", + "a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa61500", + "a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96400", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecc00", + "a0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d42468289295100", + "a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d5100", + "a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0be00", + "a080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd1165500", + "a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153400", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480", + "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 6, + "drifted_index": 6, + "list_rlp_bytes": [ + "f891", + "f891" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b16300", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080", + "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080" + ] + }, + { + "start": null, + "extension_branch": null, + "account": { + "address": "40efbf12580138bc623c95757286df4e24eb81c9", + "key": "0f266f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e", + "list_rlp_bytes": [ + "f868", + "f868" + ], + "value_rlp_bytes": [ + "b846", + "b846" + ], + "value_list_rlp_bytes": [ + "f844", + "f844" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "f868", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "storage": null, + "mod_extension": null, + "values": [ + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "40efbf12580138bc623c95757286df4e24eb81c9" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": true, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "e4" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f851", + "f851" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", + "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", + "a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "82112300000000000000000000000000000000000000000000000000000000000000", + "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900", + "00000300000000000000000000000000000000000000000000000000000000000000", + "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900" + ], + "keccak_data": [ + "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", + "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", + "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39", + "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39" + ] + }, + { + "start": null, + "extension_branch": null, + "account": null, + "storage": { + "address": "1200000000000000000000000000000000000000000000000000000000000000", + "key": "1200000000000000000000000000000000000000000000000000000000000000", + "list_rlp_bytes": [ + "f6", + "f6" + ], + "value_rlp_bytes": [ + "95", + "95" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "e2", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "mod_extension": null, + "values": [ + "9f200000000000000000000000000000000000000000000000000000000000000000", + "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", + "9f200000000000000000000000000000000000000000000000000000000000000000", + "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a1201200000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", + "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", + "1200000000000000000000000000000000000000000000000000000000000000" + ] + }, + { + "start": { + "disable_preimage_check": false, + "proof_type": "Disabled" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0000000000000000000000000000000000000000000000000000000000000000000", + "a0000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [] + } +] \ No newline at end of file From 12d6b1d5bda4c6b1a3a081d3feeeadc18218afc3 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 6 Mar 2024 11:10:28 +0100 Subject: [PATCH 12/43] Fix in account_leaf key data witness load --- zkevm-circuits/src/mpt_circuit/account_leaf.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 65c6d413d7..a6184d2021 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -700,12 +700,15 @@ impl AccountLeafConfig { )?; // Wrong leaf / extension node handling - let key_data_prev = self.key_data_prev.witness_load( - region, - offset, - &mut memory[key_memory(false)], - 2, // 2 instead of 1 because default values have already been stored above - )?; + let mut key_data_prev = KeyDataWitness::default(); + if offset > 2 { + key_data_prev = self.key_data_prev.witness_load( + region, + offset, + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; + } self.wrong.assign( region, offset, @@ -716,7 +719,7 @@ impl AccountLeafConfig { true, parent_data[1].is_extension, key_data[true.idx()].clone(), - key_data_prev, + key_data_prev, region.key_r, )?; From ae39a6ac11a6a9987cfde8b3773c9f24c2e10d4b Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 6 Mar 2024 12:01:20 +0100 Subject: [PATCH 13/43] Test for account wrong extension node; statedb: prevent address hashing --- geth-utils/gethutil/mpt/state/statedb.go | 11 ++++-- ...gen_witness_from_infura_blockchain_test.go | 4 +-- .../gen_witness_from_local_blockchain_test.go | 35 +++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/geth-utils/gethutil/mpt/state/statedb.go b/geth-utils/gethutil/mpt/state/statedb.go index 56b076c17a..8210f2e267 100644 --- a/geth-utils/gethutil/mpt/state/statedb.go +++ b/geth-utils/gethutil/mpt/state/statedb.go @@ -533,8 +533,15 @@ func (s *StateDB) updateStateObject(obj *stateObject) { if err != nil { panic(fmt.Errorf("can't encode object at %x: %v", addr[:], err)) } - if err = s.trie.TryUpdateAlwaysHash(addr[:], data); err != nil { - s.setError(fmt.Errorf("updateStateObject (%x) error: %v", addr[:], err)) + + if !oracle.PreventHashingInSecureTrie { + if err = s.trie.TryUpdateAlwaysHash(addr[:], data); err != nil { + s.setError(fmt.Errorf("updateStateObject (%x) error: %v", addr[:], err)) + } + } else { + if err = s.trie.TryUpdate(addr[:], data); err != nil { + s.setError(fmt.Errorf("updateStateObject (%x) error: %v", addr[:], err)) + } } // If state snapshotting is active, cache the data til commit. Note, this diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 24b90893fb..f66d628ee8 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2335,7 +2335,7 @@ func TestStorageDoesNotExistOnlySProof(t *testing.T) { prepareWitness("StorageDoesNotExistOnlySProof", trieModifications, statedb) } -func TestWrongExtensionNode(t *testing.T) { +func TestStorageWrongExtensionNode(t *testing.T) { blockNum := 0 blockNumberParent := big.NewInt(int64(blockNum)) blockHeaderParent := oracle.PrefetchBlock(blockNumberParent, true, nil) @@ -2372,7 +2372,7 @@ func TestWrongExtensionNode(t *testing.T) { } trieModifications := []TrieModification{trieMod} - prepareWitness("WrongExtensionNode", trieModifications, statedb) + prepareWitness("StorageWrongExtensionNode", trieModifications, statedb) oracle.PreventHashingInSecureTrie = false } diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go index 96dd49fee3..d4c0021666 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go @@ -978,3 +978,38 @@ func TestExtensionIntoBranch(t *testing.T) { oracle.PreventHashingInSecureTrie = false } + +func TestAccountWrongExtensionNode(t *testing.T) { + SkipIfNoGeth(t) + oracle.NodeUrl = oracle.LocalUrl + + blockNum := 0 + blockNumberParent := big.NewInt(int64(blockNum)) + blockHeaderParent := oracle.PrefetchBlock(blockNumberParent, true, nil) + database := state.NewDatabase(blockHeaderParent) + statedb, _ := state.New(blockHeaderParent.Root, database, nil) + + statedb.DisableLoadingRemoteAccounts() + + oracle.PreventHashingInSecureTrie = true // to store the unchanged key + + addr1 := common.HexToAddress("0x0023000000000000000000000000000000000000") + addr2 := common.HexToAddress("0x0023100000000000000000000000000000000000") + + statedb.CreateAccount(addr1) + statedb.CreateAccount(addr2) + statedb.IntermediateRoot(false) + + // Returns extension node + addr3 := common.HexToAddress("0x0021000000000000000000000000000000000000") + + trieMod := TrieModification{ + Type: AccountDoesNotExist, + Address: addr3, + } + trieModifications := []TrieModification{trieMod} + + prepareWitness("AccountWrongExtensionNode", trieModifications, statedb) + + oracle.PreventHashingInSecureTrie = false +} From 13a77590829cb567c0cff9565b326cb848382c0c Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 8 Mar 2024 12:26:11 +0100 Subject: [PATCH 14/43] Account wrong extension node test --- .../gen_witness_from_local_blockchain_test.go | 4 +- .../gethutil/mpt/witness/prepare_witness.go | 151 +++++++++--------- 2 files changed, 78 insertions(+), 77 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go index d4c0021666..47443929e9 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go @@ -995,13 +995,15 @@ func TestAccountWrongExtensionNode(t *testing.T) { addr1 := common.HexToAddress("0x0023000000000000000000000000000000000000") addr2 := common.HexToAddress("0x0023100000000000000000000000000000000000") + addr4 := common.HexToAddress("0x0023200000000000000000000000000000000000") statedb.CreateAccount(addr1) statedb.CreateAccount(addr2) + statedb.CreateAccount(addr4) statedb.IntermediateRoot(false) // Returns extension node - addr3 := common.HexToAddress("0x0021000000000000000000000000000000000000") + addr3 := common.HexToAddress("0x0018100000000000000000000000000000000000") trieMod := TrieModification{ Type: AccountDoesNotExist, diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index f3751f1fb4..6719dbc001 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -70,6 +70,10 @@ func obtainAccountProofAndConvertToWitness(i int, tMod TrieModification, tModsLe addr := tMod.Address addrh := crypto.Keccak256(addr.Bytes()) + if oracle.PreventHashingInSecureTrie { + addrh = addr.Bytes() + addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + } accountAddr := trie.KeybytesToHex(addrh) // This needs to be called before oracle.PrefetchAccount, otherwise oracle.PrefetchAccount @@ -520,86 +524,81 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // to obtain the underlying branch to be able to finally add (besides this branch) // the placeholder leaf. So we need to query getProof again with one of the leaves that is // actually in this extension node. - if isAccountProof { - // TODO - node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) - nodes = append(nodes, node) - } else { - /* - Let's say we have an extension node E1 at the following path [3, 5, 8]. - Let's say E1 has nibbles [1, 2, 3]. Let's say we want to prove there does not exist - a leaf at [3, 5, 8, 1, 2, 4] (because there is overlapping path with E1). - - We need to construct a leaf L1 that will have the key equal to the queried key. - This means the nibbles are the same as in the path to E1 (without extension nibbles). - - In the circuit, the leaf L1 will have the same key as the queried key once - the KeyData will be queried with offset 1 (to get the accumulated key RLC up until E1). - The nibbles stored in L1 will be added to the RLC and compared with the queried - key (has to be the same). - */ - nibbles := getNibbles(proof2[len(proof2)-1]) - newKey := make([]byte, len(key)) - copy(newKey, key) - - /* - Following the above example, the queried key `key` is [3, 5, 8, 1, 2, 4]. - The path to E1 and its nibbles is [3, 5, 8, 1, 2, 3]. - We construct the key `newKey` to get the underlying branch of E1. - */ - for i := 0; i < len(nibbles); i++ { - n := nibbles[i] - if key[i] != n { - newKey[i] = n - } - } - /* - The last nibble should be the one that gets one of the leaves in the branch (not nil) - - to get the leaf in branch as well. - */ - var proof [][]byte - var err error - for i := 0; i < 16; i++ { - newKey[keyIndex] = byte(i) - k := trie.HexToKeybytes(newKey) - ky := common.BytesToHash(k) - proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) - check(err) - if !isBranch(proof[len(proof)-1]) { - break - } + /* + Let's say we have an extension node E1 at the following path [3, 5, 8]. + Let's say E1 has nibbles [1, 2, 3]. Let's say we want to prove there does not exist + a leaf at [3, 5, 8, 1, 2, 4] (because there is overlapping path with E1). + + We need to construct a leaf L1 that will have the key equal to the queried key. + This means the nibbles are the same as in the path to E1 (without extension nibbles). + + In the circuit, the leaf L1 will have the same key as the queried key once + the KeyData will be queried with offset 1 (to get the accumulated key RLC up until E1). + The nibbles stored in L1 will be added to the RLC and compared with the queried + key (has to be the same). + */ + nibbles := getNibbles(proof2[len(proof2)-1]) + newKey := make([]byte, len(key)) + copy(newKey, key) + + /* + Following the above example, the queried key `key` is [3, 5, 8, 1, 2, 4]. + The path to E1 and its nibbles is [3, 5, 8, 1, 2, 3]. + We construct the key `newKey` to get the underlying branch of E1. + */ + for i := 0; i < len(nibbles); i++ { + n := nibbles[i] + if key[i] != n { + newKey[i] = n } + } - branchRlp := proof[len(proof)-2] // the last element has to be a leaf - isExtension := true - - extNode := proof2[len(proof2)-1] // Let's name it E1 - bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, - key[keyIndex], key[keyIndex], false, false, isExtension) - nodes = append(nodes, bNode) - - // Let's construct the leaf L1 that will have the correct key (the queried one) - l := keyIndex - len(nibbles) - // path will have nibbles up to the E1 nibbles (but without them) - in our example [3 5 8] - path := make([]byte, l) - copy(path, key[:l]) - // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] - - compact := trie.HexToCompact(key[l:]) - // Add RLP: - compactLen := byte(len(compact)) - rlp2 := 128 + compactLen - rlp1 := 192 + compactLen + 1 - // Constructed leaf L1: - constructedLeaf := append([]byte{rlp1, rlp2}, compact...) - - // Add dummy value: - constructedLeaf = append(constructedLeaf, 0) - - node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) - nodes = append(nodes, node) + /* + The last nibble should be the one that gets one of the leaves in the branch (not nil) - + to get the leaf in branch as well. + */ + var proof [][]byte + var err error + for i := 0; i < 16; i++ { + newKey[keyIndex] = byte(i) + k := trie.HexToKeybytes(newKey) + ky := common.BytesToHash(k) + proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) + check(err) + if !isBranch(proof[len(proof)-1]) { + break + } } + + branchRlp := proof[len(proof)-2] // the last element has to be a leaf + isExtension := true + + extNode := proof2[len(proof2)-1] // Let's name it E1 + bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, + key[keyIndex], key[keyIndex], false, false, isExtension) + nodes = append(nodes, bNode) + + // Let's construct the leaf L1 that will have the correct key (the queried one) + l := keyIndex - len(nibbles) + // path will have nibbles up to the E1 nibbles (but without them) - in our example [3 5 8] + path := make([]byte, l) + copy(path, key[:l]) + // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] + + compact := trie.HexToCompact(key[l:]) + // Add RLP: + compactLen := byte(len(compact)) + rlp2 := 128 + compactLen + rlp1 := 192 + compactLen + 1 + // Constructed leaf L1: + constructedLeaf := append([]byte{rlp1, rlp2}, compact...) + + // Add dummy value: + constructedLeaf = append(constructedLeaf, 0) + + node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + nodes = append(nodes, node) } } } From edb7a566b266e61482a38a86272c28af0efdc8ef Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Mon, 11 Mar 2024 12:37:59 +0100 Subject: [PATCH 15/43] extNibbles returned by getProof has the same number as the proof now --- geth-utils/gethutil/mpt/README.md | 33 +++++++++++++++ geth-utils/gethutil/mpt/trie/proof.go | 6 ++- geth-utils/gethutil/mpt/witness/branch.go | 10 ++--- .../gethutil/mpt/witness/extension_node.go | 6 +-- .../mpt/witness/modified_extension_node.go | 6 +-- .../gethutil/mpt/witness/prepare_witness.go | 40 +++++++------------ 6 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 geth-utils/gethutil/mpt/README.md diff --git a/geth-utils/gethutil/mpt/README.md b/geth-utils/gethutil/mpt/README.md new file mode 100644 index 0000000000..c6c5b237d4 --- /dev/null +++ b/geth-utils/gethutil/mpt/README.md @@ -0,0 +1,33 @@ +# MPT witness generator + +## Generate witnesses + +To generate witnesses for the MPT circuit, execute + +``` +go test -v ./... +``` + +To generate the tests that use a local blockchain you need a local `geth`. You would +need to run something like: +``` +geth --dev --http --ipcpath ~/Library/Ethereum/geth.ipc + +``` +The local `geth` is used to generate some tests that have a small number of accounts so that +these accounts appear in the first or second level of the trie. You might need to remove the +database if you already have some accounts: + +``` +geth removedb +``` + +The witness files will appear in generated_witnesses folder. + +## Format the code + +To format the code use: + +``` +gofmt -w ./* +``` \ No newline at end of file diff --git a/geth-utils/gethutil/mpt/trie/proof.go b/geth-utils/gethutil/mpt/trie/proof.go index 2603265071..adaf20245a 100644 --- a/geth-utils/gethutil/mpt/trie/proof.go +++ b/geth-utils/gethutil/mpt/trie/proof.go @@ -107,11 +107,15 @@ func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.KeyValueWriter) ( // copy n.Key before it gets changed in ProofHash var nCopy []byte if short, ok := n.(*ShortNode); ok { - if !hasTerm(short.Key) { // only for extension keys + if !hasTerm(short.Key) { // extension keys nCopy = make([]byte, len(short.Key)) copy(nCopy, short.Key) extNibbles = append(extNibbles, nCopy) + } else { + extNibbles = append(extNibbles, []byte{}) } + } else { + extNibbles = append(extNibbles, []byte{}) } n, _ = hasher.ProofHash(n) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index eb59b86fe8..4a539d4d78 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -204,10 +204,10 @@ func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { // addBranchAndPlaceholder adds to the rows a branch and its placeholder counterpart // (used when one of the proofs have one branch more than the other). -func addBranchAndPlaceholder(proof1, proof2, - extNibblesS, extNibblesC [][]byte, +func addBranchAndPlaceholder(proof1, proof2 [][]byte, + extNibblesS, extNibblesC []byte, leafRow0, key, neighbourNode []byte, - keyIndex, extensionNodeInd int, + keyIndex int, additionalBranch, isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf bool, toBeHashed *[][]byte) (bool, bool, int, Node) { len1 := len(proof1) @@ -226,9 +226,9 @@ func addBranchAndPlaceholder(proof1, proof2, if isExtension { var numNibbles byte if len1 > len2 { - numNibbles, extListRlpBytes, extValues = prepareExtensions(extNibblesS, extensionNodeInd, proof1[len1-3], proof1[len1-3]) + numNibbles, extListRlpBytes, extValues = prepareExtensions(extNibblesS, proof1[len1-3], proof1[len1-3]) } else { - numNibbles, extListRlpBytes, extValues = prepareExtensions(extNibblesC, extensionNodeInd, proof2[len2-3], proof2[len2-3]) + numNibbles, extListRlpBytes, extValues = prepareExtensions(extNibblesC, proof2[len2-3], proof2[len2-3]) } numberOfNibbles = int(numNibbles) } diff --git a/geth-utils/gethutil/mpt/witness/extension_node.go b/geth-utils/gethutil/mpt/witness/extension_node.go index e52a06f1e6..e61c01f4f6 100644 --- a/geth-utils/gethutil/mpt/witness/extension_node.go +++ b/geth-utils/gethutil/mpt/witness/extension_node.go @@ -1,6 +1,6 @@ package witness -func prepareExtensions(extNibbles [][]byte, extensionNodeInd int, proofEl1, proofEl2 []byte) (byte, []byte, [][]byte) { +func prepareExtensions(extNibbles []byte, proofEl1, proofEl2 []byte) (byte, []byte, [][]byte) { var values [][]byte v1 := make([]byte, valueLen) v2 := make([]byte, valueLen) @@ -30,9 +30,9 @@ func prepareExtensions(extNibbles [][]byte, extensionNodeInd int, proofEl1, proo } } ind := 0 - for j := startNibblePos; j < len(extNibbles[extensionNodeInd]); j += 2 { + for j := startNibblePos; j < len(extNibbles); j += 2 { v3[2+ind] = // TODO: check 2 + ind - extNibbles[extensionNodeInd][j] + extNibbles[j] ind++ } values = append(values, v1) diff --git a/geth-utils/gethutil/mpt/witness/modified_extension_node.go b/geth-utils/gethutil/mpt/witness/modified_extension_node.go index de28a4bcc2..ab17775426 100644 --- a/geth-utils/gethutil/mpt/witness/modified_extension_node.go +++ b/geth-utils/gethutil/mpt/witness/modified_extension_node.go @@ -14,7 +14,7 @@ import ( func equipLeafWithModExtensionNode(statedb *state.StateDB, leafNode Node, addr common.Address, proof1, proof2, extNibblesS, extNibblesC [][]byte, key, neighbourNode []byte, - keyIndex, extensionNodeInd, numberOfNibbles int, + keyIndex, numberOfNibbles int, additionalBranch, isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf bool, toBeHashed *[][]byte) Node { len1 := len(proof1) @@ -34,7 +34,7 @@ func equipLeafWithModExtensionNode(statedb *state.StateDB, leafNode Node, addr c extNibbles = extNibblesS } - _, extListRlpBytesS, extValuesS := prepareExtensions(extNibbles, extensionNodeInd, longExtNode, longExtNode) + _, extListRlpBytesS, extValuesS := prepareExtensions(extNibbles[len(extNibbles)-1], longExtNode, longExtNode) // Get nibbles of the extension node that gets shortened because of the newly insertd // extension node: @@ -107,7 +107,7 @@ func equipLeafWithModExtensionNode(statedb *state.StateDB, leafNode Node, addr c // Enable `prepareExtensionRows` call: extNibbles = append(extNibbles, nibbles) - _, extListRlpBytesC, extValuesC = prepareExtensions(extNibbles, extensionNodeInd+1, shortExtNode, shortExtNode) + _, extListRlpBytesC, extValuesC = prepareExtensions(extNibbles[len(extNibbles)-1], shortExtNode, shortExtNode) } else { // When the short node is a branch (and not an extension node), we have nothing to be put in // the C extension node witness (as a short node). We copy the long node (S extension node) to let diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 6719dbc001..82ae75c217 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -267,22 +267,6 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st // Needs to be after `specialTest == 1` preparation: nodes = append(nodes, GetStartNode(proofType, sRoot, cRoot, specialTest)) - /* - if tMod.Type == StorageDoesNotExist { - fmt.Println("==================="); - fmt.Println(addr); - fmt.Println(tMod.Key); - fmt.Println(""); - - for i := 0; i < len(storageProof); i++ { - fmt.Println(storageProof[i]) - fmt.Println("") - } - fmt.Println("========"); - fmt.Println(""); - } - */ - // In convertProofToWitness, we can't use account address in its original form (non-hashed), because // of the "special" test for which we manually manipulate the "hashed" address and we don't have a preimage. // TODO: addr is used for calling GetProof for modified extension node only, might be done in a different way @@ -380,8 +364,6 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } var isExtension bool - extensionNodeInd := 0 - var extListRlpBytes []byte var extValues [][]byte for i := 0; i < 4; i++ { @@ -393,7 +375,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] for i := 0; i < upTo; i++ { if !isBranch(proof1[i]) { isNonExistingProof := (isAccountProof && nonExistingAccountProof) || (!isAccountProof && nonExistingStorageProof) - areThereNibbles := len(extNibblesS) != 0 || len(extNibblesC) != 0 + areThereNibbles := len(extNibblesS[i]) != 0 || len(extNibblesC[i]) != 0 // If i < upTo-1, it means it's not a leaf, so it's an extension node. // There is no any special relation between isNonExistingProof and isExtension, // except that in the non-existing proof the extension node can appear in `i == upTo-1`. @@ -404,10 +386,9 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] if (i != upTo-1) || (areThereNibbles && isNonExistingProof) { // extension node var numberOfNibbles byte isExtension = true - numberOfNibbles, extListRlpBytes, extValues = prepareExtensions(extNibblesS, extensionNodeInd, proof1[i], proof2[i]) + numberOfNibbles, extListRlpBytes, extValues = prepareExtensions(extNibblesS[i], proof1[i], proof2[i]) keyIndex += int(numberOfNibbles) - extensionNodeInd++ continue } @@ -445,9 +426,10 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] leafRow0 = proof2[len2-1] } - isModifiedExtNode, _, numberOfNibbles, bNode := addBranchAndPlaceholder(proof1, proof2, extNibblesS, extNibblesC, + isModifiedExtNode, _, numberOfNibbles, bNode := addBranchAndPlaceholder(proof1, proof2, + extNibblesS[len1-1], extNibblesC[len2-1], leafRow0, key, neighbourNode, - keyIndex, extensionNodeInd, additionalBranch, + keyIndex, additionalBranch, isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf, &toBeHashed) nodes = append(nodes, bNode) @@ -488,7 +470,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // modification). if isModifiedExtNode { leafNode = equipLeafWithModExtensionNode(statedb, leafNode, addr, proof1, proof2, extNibblesS, extNibblesC, key, neighbourNode, - keyIndex, extensionNodeInd, numberOfNibbles, additionalBranch, + keyIndex, numberOfNibbles, additionalBranch, isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf, &toBeHashed) } nodes = append(nodes, leafNode) @@ -513,7 +495,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] node := prepareStorageLeafPlaceholderNode(storage_key, key, keyIndex) nodes = append(nodes, node) } - } else if len(extNibblesC) > len(proof2)-1 { + } else { isLastExtNode := len(extNibblesC[len(proof2)-1]) != 0 if isLastExtNode { // We need to add a placeholder branch and a placeholder leaf. @@ -564,7 +546,11 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] newKey[keyIndex] = byte(i) k := trie.HexToKeybytes(newKey) ky := common.BytesToHash(k) - proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) + if isAccountProof { + proof, _, _, _, _, err = statedb.GetProof(addr) + } else { + proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) + } check(err) if !isBranch(proof[len(proof)-1]) { break @@ -586,6 +572,8 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] copy(path, key[:l]) // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] + // TODO: construct for account proof + compact := trie.HexToCompact(key[l:]) // Add RLP: compactLen := byte(len(compact)) From 87724d38fd8fc427e69cf3bb3c61cbac6fd7c1fc Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 12 Mar 2024 11:07:30 +0100 Subject: [PATCH 16/43] Fixing handling the accounts without hashing in the trie --- geth-utils/gethutil/mpt/state/statedb.go | 15 +++++++++++++-- geth-utils/gethutil/mpt/trie/secure_trie.go | 3 +++ .../gen_witness_from_infura_blockchain_test.go | 3 +-- .../gethutil/mpt/witness/prepare_witness.go | 4 ++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/geth-utils/gethutil/mpt/state/statedb.go b/geth-utils/gethutil/mpt/state/statedb.go index 8210f2e267..07ad5311ec 100644 --- a/geth-utils/gethutil/mpt/state/statedb.go +++ b/geth-utils/gethutil/mpt/state/statedb.go @@ -298,7 +298,12 @@ func (s *StateDB) GetState(addr common.Address, hash common.Hash) common.Hash { // GetProof returns the Merkle proof for a given account. func (s *StateDB) GetProof(addr common.Address) ([][]byte, []byte, [][]byte, bool, bool, error) { - return s.GetProofByHash(crypto.Keccak256Hash(addr.Bytes())) + var newAddr common.Hash + if oracle.PreventHashingInSecureTrie { + bytes := append(addr.Bytes(), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + newAddr = common.BytesToHash(bytes) + } + return s.GetProofByHash(newAddr) } // GetProofByHash returns the Merkle proof for a given account. @@ -311,7 +316,13 @@ func (s *StateDB) GetProofByHash(addrHash common.Hash) ([][]byte, []byte, [][]by // GetStorageProof returns the Merkle proof for given storage slot. func (s *StateDB) GetStorageProof(a common.Address, key common.Hash) ([][]byte, []byte, [][]byte, bool, bool, error) { var proof proofList - trie := s.StorageTrie(a) + newAddr := a + if oracle.PreventHashingInSecureTrie { + bytes := append(a.Bytes(), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + newAddr = common.BytesToAddress(bytes) + } + + trie := s.StorageTrie(newAddr) if trie == nil { return proof, nil, nil, false, false, errors.New("storage trie for requested address does not exist") } diff --git a/geth-utils/gethutil/mpt/trie/secure_trie.go b/geth-utils/gethutil/mpt/trie/secure_trie.go index 7ed19a2b54..217fb4c34e 100644 --- a/geth-utils/gethutil/mpt/trie/secure_trie.go +++ b/geth-utils/gethutil/mpt/trie/secure_trie.go @@ -109,6 +109,9 @@ func (t *SecureTrie) Update(key, value []byte) { // If a node was not found in the database, a MissingNodeError is returned. func (t *SecureTrie) TryUpdate(key, value []byte) error { hk := t.hashKey(key) + if oracle.PreventHashingInSecureTrie { + hk = append(hk, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + } err := t.trie.TryUpdate(hk, value) if err != nil { return err diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index f66d628ee8..c21f105e75 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2344,11 +2344,10 @@ func TestStorageWrongExtensionNode(t *testing.T) { addr := common.HexToAddress("0x40efbf12580138bc623c95757286df4e24eb81c9") statedb.DisableLoadingRemoteAccounts() + oracle.PreventHashingInSecureTrie = true // to store the unchanged key statedb.CreateAccount(addr) - oracle.PreventHashingInSecureTrie = true // to store the unchanged key - key1 := common.HexToHash("0x1230000000000000000000000000000000000000000000000000000000000000") key2 := common.HexToHash("0x1231000000000000000000000000000000000000000000000000000000000000") diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 82ae75c217..e07c8c252d 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -179,6 +179,10 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st addr := tMod.Address addrh := crypto.Keccak256(addr.Bytes()) + if oracle.PreventHashingInSecureTrie { + addrh = addr.Bytes() + addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + } accountAddr := trie.KeybytesToHex(addrh) oracle.PrefetchAccount(statedb.Db.BlockNumber, tMod.Address, nil) From 06fb0cac09ab219054bfd6a9d8667626a16d53e7 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 13 Mar 2024 10:05:05 +0100 Subject: [PATCH 17/43] Fix in account address hashing prevention --- geth-utils/gethutil/mpt/trie/secure_trie.go | 6 +++--- .../gen_witness_from_infura_blockchain_test.go | 1 + geth-utils/gethutil/mpt/witness/prepare_witness.go | 12 +++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/geth-utils/gethutil/mpt/trie/secure_trie.go b/geth-utils/gethutil/mpt/trie/secure_trie.go index 217fb4c34e..2831de5bd5 100644 --- a/geth-utils/gethutil/mpt/trie/secure_trie.go +++ b/geth-utils/gethutil/mpt/trie/secure_trie.go @@ -109,9 +109,6 @@ func (t *SecureTrie) Update(key, value []byte) { // If a node was not found in the database, a MissingNodeError is returned. func (t *SecureTrie) TryUpdate(key, value []byte) error { hk := t.hashKey(key) - if oracle.PreventHashingInSecureTrie { - hk = append(hk, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) - } err := t.trie.TryUpdate(hk, value) if err != nil { return err @@ -214,6 +211,9 @@ func (t *SecureTrie) hashKey(key []byte) []byte { return t.hashKeyBuf[:] } else { // For generating special tests for MPT circuit. + if len(key) < 32 { // accounts + key = append(key, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + } return key } } diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index c21f105e75..7ab979038a 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2347,6 +2347,7 @@ func TestStorageWrongExtensionNode(t *testing.T) { oracle.PreventHashingInSecureTrie = true // to store the unchanged key statedb.CreateAccount(addr) + statedb.IntermediateRoot(false) key1 := common.HexToHash("0x1230000000000000000000000000000000000000000000000000000000000000") key2 := common.HexToHash("0x1231000000000000000000000000000000000000000000000000000000000000") diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index e07c8c252d..b36cada0da 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -65,14 +65,15 @@ func GetWitness(nodeUrl string, blockNum int, trieModifications []TrieModificati return obtainTwoProofsAndConvertToWitness(trieModifications, statedb, 0) } -func obtainAccountProofAndConvertToWitness(i int, tMod TrieModification, tModsLen int, statedb *state.StateDB, specialTest byte) []Node { +func obtainAccountProofAndConvertToWitness(tMod TrieModification, statedb *state.StateDB, specialTest byte) []Node { statedb.IntermediateRoot(false) addr := tMod.Address addrh := crypto.Keccak256(addr.Bytes()) if oracle.PreventHashingInSecureTrie { addrh = addr.Bytes() - addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + addr = common.BytesToAddress(addrh) } accountAddr := trie.KeybytesToHex(addrh) @@ -82,7 +83,7 @@ func obtainAccountProofAndConvertToWitness(i int, tMod TrieModification, tModsLe // for cases when statedb.loadRemoteAccountsIntoStateObjects = false. statedb.SetStateObjectIfExists(tMod.Address) - oracle.PrefetchAccount(statedb.Db.BlockNumber, tMod.Address, nil) + oracle.PrefetchAccount(statedb.Db.BlockNumber, addr, nil) accountProof, aNeighbourNode1, aExtNibbles1, isLastLeaf1, aIsNeighbourNodeHashed1, err := statedb.GetProof(addr) check(err) @@ -182,10 +183,11 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st if oracle.PreventHashingInSecureTrie { addrh = addr.Bytes() addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) + addr = common.BytesToAddress(addrh) } accountAddr := trie.KeybytesToHex(addrh) - oracle.PrefetchAccount(statedb.Db.BlockNumber, tMod.Address, nil) + oracle.PrefetchAccount(statedb.Db.BlockNumber, addr, nil) oracle.PrefetchStorage(statedb.Db.BlockNumber, addr, tMod.Key, nil) if specialTest == 1 { @@ -282,7 +284,7 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st nodes = append(nodes, nodesStorage...) nodes = append(nodes, GetEndNode()) } else { - accountNodes := obtainAccountProofAndConvertToWitness(i, tMod, len(trieModifications), statedb, specialTest) + accountNodes := obtainAccountProofAndConvertToWitness(tMod, statedb, specialTest) nodes = append(nodes, accountNodes...) } } From 319533897150dc8213fdedce88823de3317ff3de Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 13 Mar 2024 11:10:47 +0100 Subject: [PATCH 18/43] PreventHashing split into storage/account PreventHashing --- geth-utils/gethutil/mpt/oracle/prefetch.go | 3 ++- geth-utils/gethutil/mpt/state/database.go | 4 ++-- geth-utils/gethutil/mpt/state/statedb.go | 8 ++++---- geth-utils/gethutil/mpt/trie/secure_trie.go | 8 +++++--- geth-utils/gethutil/mpt/witness/nodes.go | 2 +- geth-utils/gethutil/mpt/witness/prepare_witness.go | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/geth-utils/gethutil/mpt/oracle/prefetch.go b/geth-utils/gethutil/mpt/oracle/prefetch.go index 34907912b1..4b5a6d1d99 100644 --- a/geth-utils/gethutil/mpt/oracle/prefetch.go +++ b/geth-utils/gethutil/mpt/oracle/prefetch.go @@ -81,7 +81,8 @@ var RemoteUrl = "https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" var LocalUrl = "http://localhost:8545" // For generating special tests for MPT circuit: -var PreventHashingInSecureTrie = false +var PreventHashingInSecureTrie = false // storage +var AccountPreventHashingInSecureTrie = false func toFilename(key string) string { return fmt.Sprintf("/tmp/eth/json_%s", key) diff --git a/geth-utils/gethutil/mpt/state/database.go b/geth-utils/gethutil/mpt/state/database.go index 52cdf1b596..37acd97c7b 100644 --- a/geth-utils/gethutil/mpt/state/database.go +++ b/geth-utils/gethutil/mpt/state/database.go @@ -52,7 +52,7 @@ func (db *Database) CopyTrie(t Trie) Trie { // OpenTrie opens the main account trie at a specific root hash. func (db *Database) OpenTrie(root common.Hash) (Trie, error) { - tr, err := trie.NewSecure(root, db.db) + tr, err := trie.NewSecure(root, db.db, false) if err != nil { return nil, err } @@ -62,7 +62,7 @@ func (db *Database) OpenTrie(root common.Hash) (Trie, error) { // OpenStorageTrie opens the storage trie of an account. func (db *Database) OpenStorageTrie(addrHash, root common.Hash) (Trie, error) { //return SimpleTrie{db.BlockNumber, root, true, addrHash}, nil - tr, err := trie.NewSecure(root, db.db) + tr, err := trie.NewSecure(root, db.db, true) if err != nil { return nil, err } diff --git a/geth-utils/gethutil/mpt/state/statedb.go b/geth-utils/gethutil/mpt/state/statedb.go index 07ad5311ec..12414c504d 100644 --- a/geth-utils/gethutil/mpt/state/statedb.go +++ b/geth-utils/gethutil/mpt/state/statedb.go @@ -298,8 +298,8 @@ func (s *StateDB) GetState(addr common.Address, hash common.Hash) common.Hash { // GetProof returns the Merkle proof for a given account. func (s *StateDB) GetProof(addr common.Address) ([][]byte, []byte, [][]byte, bool, bool, error) { - var newAddr common.Hash - if oracle.PreventHashingInSecureTrie { + newAddr := crypto.Keccak256Hash(addr.Bytes()) + if oracle.AccountPreventHashingInSecureTrie { bytes := append(addr.Bytes(), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) newAddr = common.BytesToHash(bytes) } @@ -317,7 +317,7 @@ func (s *StateDB) GetProofByHash(addrHash common.Hash) ([][]byte, []byte, [][]by func (s *StateDB) GetStorageProof(a common.Address, key common.Hash) ([][]byte, []byte, [][]byte, bool, bool, error) { var proof proofList newAddr := a - if oracle.PreventHashingInSecureTrie { + if oracle.AccountPreventHashingInSecureTrie { bytes := append(a.Bytes(), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) newAddr = common.BytesToAddress(bytes) } @@ -545,7 +545,7 @@ func (s *StateDB) updateStateObject(obj *stateObject) { panic(fmt.Errorf("can't encode object at %x: %v", addr[:], err)) } - if !oracle.PreventHashingInSecureTrie { + if !oracle.AccountPreventHashingInSecureTrie { if err = s.trie.TryUpdateAlwaysHash(addr[:], data); err != nil { s.setError(fmt.Errorf("updateStateObject (%x) error: %v", addr[:], err)) } diff --git a/geth-utils/gethutil/mpt/trie/secure_trie.go b/geth-utils/gethutil/mpt/trie/secure_trie.go index 2831de5bd5..ae34f1a8db 100644 --- a/geth-utils/gethutil/mpt/trie/secure_trie.go +++ b/geth-utils/gethutil/mpt/trie/secure_trie.go @@ -40,6 +40,7 @@ type SecureTrie struct { hashKeyBuf [common.HashLength]byte secKeyCache map[string][]byte secKeyCacheOwner *SecureTrie // Pointer to self, replace the key cache on mismatch + isStorageTrie bool } // NewSecure creates a trie with an existing root node from a backing database @@ -53,7 +54,7 @@ type SecureTrie struct { // Loaded nodes are kept around until their 'cache generation' expires. // A new cache generation is created by each call to Commit. // cachelimit sets the number of past cache generations to keep. -func NewSecure(root common.Hash, db *Database) (*SecureTrie, error) { +func NewSecure(root common.Hash, db *Database, isStorageTrie bool) (*SecureTrie, error) { if db == nil { panic("trie.NewSecure called without a database") } @@ -61,7 +62,7 @@ func NewSecure(root common.Hash, db *Database) (*SecureTrie, error) { if err != nil { return nil, err } - return &SecureTrie{trie: *trie}, nil + return &SecureTrie{trie: *trie, isStorageTrie: isStorageTrie}, nil } // Get returns the value for key stored in the trie. @@ -202,7 +203,8 @@ func (t *SecureTrie) NodeIterator(start []byte) NodeIterator { // The caller must not hold onto the return value because it will become // invalid on the next call to hashKey or secKey. func (t *SecureTrie) hashKey(key []byte) []byte { - if !oracle.PreventHashingInSecureTrie { + preventHashing := (oracle.PreventHashingInSecureTrie && t.isStorageTrie) || (oracle.AccountPreventHashingInSecureTrie && !t.isStorageTrie) + if !preventHashing { h := NewHasher(false) h.sha.Reset() h.sha.Write(key) diff --git a/geth-utils/gethutil/mpt/witness/nodes.go b/geth-utils/gethutil/mpt/witness/nodes.go index d1d40ee83b..74a0f9d395 100644 --- a/geth-utils/gethutil/mpt/witness/nodes.go +++ b/geth-utils/gethutil/mpt/witness/nodes.go @@ -180,7 +180,7 @@ type Node struct { func GetStartNode(proofType string, sRoot, cRoot common.Hash, specialTest byte) Node { s := StartNode{ - DisablePreimageCheck: oracle.PreventHashingInSecureTrie || specialTest == 5, + DisablePreimageCheck: oracle.PreventHashingInSecureTrie || oracle.AccountPreventHashingInSecureTrie || specialTest == 5, ProofType: proofType, } var values [][]byte diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index b36cada0da..bda8d2e2bf 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -70,7 +70,7 @@ func obtainAccountProofAndConvertToWitness(tMod TrieModification, statedb *state addr := tMod.Address addrh := crypto.Keccak256(addr.Bytes()) - if oracle.PreventHashingInSecureTrie { + if oracle.AccountPreventHashingInSecureTrie { addrh = addr.Bytes() addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) addr = common.BytesToAddress(addrh) @@ -180,7 +180,7 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st addr := tMod.Address addrh := crypto.Keccak256(addr.Bytes()) - if oracle.PreventHashingInSecureTrie { + if oracle.AccountPreventHashingInSecureTrie { addrh = addr.Bytes() addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) addr = common.BytesToAddress(addrh) From acb8b2304a5281d03c9d228617e3011794d7350e Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 15 Mar 2024 11:13:07 +0100 Subject: [PATCH 19/43] Implementing accout wrong extension node witness --- .../gen_witness_from_local_blockchain_test.go | 2 +- .../gethutil/mpt/witness/prepare_witness.go | 85 +++++++++++++------ 2 files changed, 60 insertions(+), 27 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go index 47443929e9..b98ea2c651 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go @@ -991,7 +991,7 @@ func TestAccountWrongExtensionNode(t *testing.T) { statedb.DisableLoadingRemoteAccounts() - oracle.PreventHashingInSecureTrie = true // to store the unchanged key + oracle.AccountPreventHashingInSecureTrie = true // to store the unchanged address addr1 := common.HexToAddress("0x0023000000000000000000000000000000000000") addr2 := common.HexToAddress("0x0023100000000000000000000000000000000000") diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index bda8d2e2bf..3fd0ac7f22 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -73,7 +73,6 @@ func obtainAccountProofAndConvertToWitness(tMod TrieModification, statedb *state if oracle.AccountPreventHashingInSecureTrie { addrh = addr.Bytes() addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) - addr = common.BytesToAddress(addrh) } accountAddr := trie.KeybytesToHex(addrh) @@ -183,7 +182,6 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st if oracle.AccountPreventHashingInSecureTrie { addrh = addr.Bytes() addrh = append(addrh, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}...) - addr = common.BytesToAddress(addrh) } accountAddr := trie.KeybytesToHex(addrh) @@ -530,6 +528,12 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] newKey := make([]byte, len(key)) copy(newKey, key) + addr_nibbles := trie.KeybytesToHex(addrh) + if isAccountProof { + newKey = make([]byte, len(addr_nibbles)) + copy(newKey, addr_nibbles) + } + /* Following the above example, the queried key `key` is [3, 5, 8, 1, 2, 4]. The path to E1 and its nibbles is [3, 5, 8, 1, 2, 3]. @@ -550,17 +554,33 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] var err error for i := 0; i < 16; i++ { newKey[keyIndex] = byte(i) - k := trie.HexToKeybytes(newKey) - ky := common.BytesToHash(k) if isAccountProof { - proof, _, _, _, _, err = statedb.GetProof(addr) + var newAddrBytes []byte; + // TODO + for j := 0; j < 40; j = j + 2{ + newAddrBytes = append(newAddrBytes, newKey[j] * 16 + newKey[j+1]) + } + + newAddr := common.BytesToAddress(newAddrBytes) + + // newAddr = common.HexToAddress("0x0023200000000000000000000000000000000000") + + var extNibbles [][]byte; + proof, _, extNibbles, _, _, err = statedb.GetProof(newAddr) + check(err) + if len(extNibbles[len(extNibbles)-1]) == 0 && !isBranch(proof[len(proof)-1]) { + break + } } else { + k := trie.HexToKeybytes(newKey) + ky := common.BytesToHash(k) proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) - } - check(err) - if !isBranch(proof[len(proof)-1]) { - break - } + // TODO: extNibbles check + check(err) + if !isBranch(proof[len(proof)-1]) { + break + } + } } branchRlp := proof[len(proof)-2] // the last element has to be a leaf @@ -572,27 +592,40 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] nodes = append(nodes, bNode) // Let's construct the leaf L1 that will have the correct key (the queried one) + + // TODO: compute l properly - where the obtained and required key/address started to diff l := keyIndex - len(nibbles) - // path will have nibbles up to the E1 nibbles (but without them) - in our example [3 5 8] - path := make([]byte, l) - copy(path, key[:l]) - // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] + if isAccountProof { + compact := trie.HexToCompact(addr_nibbles[l:]) - // TODO: construct for account proof + compactLen := byte(len(compact)) - compact := trie.HexToCompact(key[l:]) - // Add RLP: - compactLen := byte(len(compact)) - rlp2 := 128 + compactLen - rlp1 := 192 + compactLen + 1 - // Constructed leaf L1: - constructedLeaf := append([]byte{rlp1, rlp2}, compact...) + constructedLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} + constructedLeaf[2] = 128 + compactLen + for i := 0; i < len(compact); i++ { + constructedLeaf[3 + i] = compact[i]; + } + constructedLeaf[1] = byte(len(constructedLeaf)) - 2 - // Add dummy value: - constructedLeaf = append(constructedLeaf, 0) + node := prepareAccountLeafNode(addr, addrh, proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, addr_nibbles, false, false, false) + nodes = append(nodes, node) + } else { - node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) - nodes = append(nodes, node) + // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] + compact := trie.HexToCompact(key[l:]) + // Add RLP: + compactLen := byte(len(compact)) + rlp2 := 128 + compactLen + rlp1 := 192 + compactLen + 1 + // Constructed leaf L1: + constructedLeaf := append([]byte{rlp1, rlp2}, compact...) + + // Add dummy value: + constructedLeaf = append(constructedLeaf, 0) + + node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + nodes = append(nodes, node) + } } } } From 87f469ef62e96c0b047fe47ec521100dc742fb63 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Mon, 18 Mar 2024 10:51:44 +0100 Subject: [PATCH 20/43] Non existing account: wrong extension node fix --- geth-utils/gethutil/mpt/witness/leaf.go | 23 +- .../gethutil/mpt/witness/prepare_witness.go | 29 +- .../tests/AccountWrongExtensionNode.json | 201 +++++++++ .../tests/StorageWrongExtensionNode.json | 413 ++++++++++++++++++ 4 files changed, 641 insertions(+), 25 deletions(-) create mode 100644 zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json create mode 100644 zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index 12f78416eb..f9139fd234 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -122,7 +122,7 @@ func getStorageRootCodeHashValue(leaf []byte, storageStart int) ([]byte, []byte) return storageRootValue, codeHashValue } -func prepareAccountLeafNode(addr common.Address, addrh []byte, leafS, leafC, neighbourNode, addressNibbles []byte, isPlaceholder, isSModExtension, isCModExtension bool) Node { +func prepareAccountLeafNode(addr common.Address, addrh []byte, leafS, leafC, constructedLeaf, neighbourNode, addressNibbles []byte, isPlaceholder, isSModExtension, isCModExtension bool) Node { // For non existing account proof there are two cases: // 1. A leaf is returned that is not at the required address (wrong leaf). // 2. A branch is returned as the last element of getProof and @@ -174,12 +174,19 @@ func prepareAccountLeafNode(addr common.Address, addrh []byte, leafS, leafC, nei // wrongValue is used only for proof that account doesn't exist + wrongLeaf := leafC + wrongLen := keyLenC + if constructedLeaf != nil { + wrongLeaf = constructedLeaf + wrongLen = int(constructedLeaf[2]) - 128 + } + offset := 0 - nibblesNum := (keyLenC - 1) * 2 - wrongRlpBytes[0] = leafC[0] - wrongRlpBytes[1] = leafC[1] - wrongValue[0] = leafC[2] // length - if leafC[3] != 32 { // odd number of nibbles + nibblesNum := (wrongLen - 1) * 2 + wrongRlpBytes[0] = wrongLeaf[0] + wrongRlpBytes[1] = wrongLeaf[1] + wrongValue[0] = wrongLeaf[2] // length + if wrongLeaf[3] != 32 { // odd number of nibbles nibblesNum = nibblesNum + 1 wrongValue[1] = addressNibbles[64-nibblesNum] + 48 offset = 1 @@ -327,7 +334,7 @@ func prepareLeafAndPlaceholderNode(addr common.Address, addrh []byte, proof1, pr // When generating a proof that account doesn't exist, the length of both proofs is the same (doesn't reach // this code). - return prepareAccountLeafNode(addr, addrh, leafS, leafC, nil, key, false, isSModExtension, isCModExtension) + return prepareAccountLeafNode(addr, addrh, leafS, leafC, nil, nil, key, false, isSModExtension, isCModExtension) } else { var leaf []byte isSPlaceholder := false @@ -387,7 +394,7 @@ func prepareAccountLeafPlaceholderNode(addr common.Address, addrh, key []byte, k leaf[4+i] = remainingNibbles[2*i+offset]*16 + remainingNibbles[2*i+1+offset] } - node := prepareAccountLeafNode(addr, addrh, leaf, leaf, nil, key, true, false, false) + node := prepareAccountLeafNode(addr, addrh, leaf, leaf, nil, nil, key, true, false, false) node.Account.ValueRlpBytes[0][0] = 184 node.Account.ValueRlpBytes[0][1] = 70 diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 3fd0ac7f22..3ffa0f8b82 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -399,7 +399,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] l := len(proof1) var node Node if isAccountProof { - node = prepareAccountLeafNode(addr, addrh, proof1[l-1], proof2[l-1], nil, key, false, false, false) + node = prepareAccountLeafNode(addr, addrh, proof1[l-1], proof2[l-1], nil, nil, key, false, false, false) } else { node = prepareStorageLeafNode(proof1[l-1], proof2[l-1], nil, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) } @@ -442,7 +442,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] if isAccountProof { // Add account leaf after branch placeholder: if !isModifiedExtNode { - leafNode = prepareAccountLeafNode(addr, addrh, proof1[len1-1], proof2[len2-1], neighbourNode, key, false, false, false) + leafNode = prepareAccountLeafNode(addr, addrh, proof1[len1-1], proof2[len2-1], nil, neighbourNode, key, false, false, false) } else { isSModExtension := false isCModExtension := false @@ -533,6 +533,8 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] newKey = make([]byte, len(addr_nibbles)) copy(newKey, addr_nibbles) } + + start := keyIndex - len(nibbles) /* Following the above example, the queried key `key` is [3, 5, 8, 1, 2, 4]. @@ -541,8 +543,8 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] */ for i := 0; i < len(nibbles); i++ { n := nibbles[i] - if key[i] != n { - newKey[i] = n + if key[start + i] != n { + newKey[start + i] = n } } @@ -556,15 +558,10 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] newKey[keyIndex] = byte(i) if isAccountProof { var newAddrBytes []byte; - // TODO for j := 0; j < 40; j = j + 2{ newAddrBytes = append(newAddrBytes, newKey[j] * 16 + newKey[j+1]) } - newAddr := common.BytesToAddress(newAddrBytes) - - // newAddr = common.HexToAddress("0x0023200000000000000000000000000000000000") - var extNibbles [][]byte; proof, _, extNibbles, _, _, err = statedb.GetProof(newAddr) check(err) @@ -574,10 +571,10 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } else { k := trie.HexToKeybytes(newKey) ky := common.BytesToHash(k) - proof, _, _, _, _, err = statedb.GetStorageProof(addr, ky) - // TODO: extNibbles check + var extNibbles [][]byte; + proof, _, extNibbles, _, _, err = statedb.GetStorageProof(addr, ky) check(err) - if !isBranch(proof[len(proof)-1]) { + if len(extNibbles[len(extNibbles)-1]) == 0 && !isBranch(proof[len(proof)-1]) { break } } @@ -593,10 +590,8 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // Let's construct the leaf L1 that will have the correct key (the queried one) - // TODO: compute l properly - where the obtained and required key/address started to diff - l := keyIndex - len(nibbles) if isAccountProof { - compact := trie.HexToCompact(addr_nibbles[l:]) + compact := trie.HexToCompact(addr_nibbles[start:]) compactLen := byte(len(compact)) @@ -607,12 +602,12 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } constructedLeaf[1] = byte(len(constructedLeaf)) - 2 - node := prepareAccountLeafNode(addr, addrh, proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, addr_nibbles, false, false, false) + node := prepareAccountLeafNode(addr, addrh, proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, addr_nibbles, false, false, false) nodes = append(nodes, node) } else { // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] - compact := trie.HexToCompact(key[l:]) + compact := trie.HexToCompact(key[start:]) // Add RLP: compactLen := byte(len(compact)) rlp2 := 128 + compactLen diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json new file mode 100644 index 0000000000..64879f7d4f --- /dev/null +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json @@ -0,0 +1,201 @@ +[ + { + "start": { + "disable_preimage_check": true, + "proof_type": "AccountDoesNotExist" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a02d76cb756b3842bc3b6ae4244c91a3cb937be8986a52335b85597a97d3cb528f00", + "a02d76cb756b3842bc3b6ae4244c91a3cb937be8986a52335b85597a97d3cb528f00" + ], + "keccak_data": [] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f90131", + "f90131" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b09700", + "a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b09700", + "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", + "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", + "a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0967be23021569a88609525fa4c9ac65e0faf0a70eb9d3e2c1177d42a57ab0f9500", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a0967be23021569a88609525fa4c9ac65e0faf0a70eb9d3e2c1177d42a57ab0f9580a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a0967be23021569a88609525fa4c9ac65e0faf0a70eb9d3e2c1177d42a57ab0f9580a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": true, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "e4" + }, + "branch": { + "modified_index": 1, + "drifted_index": 1, + "list_rlp_bytes": [ + "f871", + "f871" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", + "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", + "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", + "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "82102300000000000000000000000000000000000000000000000000000000000000", + "a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe3800", + "00000300000000000000000000000000000000000000000000000000000000000000", + "a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe3800" + ], + "keccak_data": [ + "f871a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c569588080808080808080808080808080", + "f871a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c569588080808080808080808080808080", + "e4821023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38", + "e4821023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38" + ] + }, + { + "start": null, + "extension_branch": null, + "account": { + "address": "0018100000000000000000000000000000000000", + "key": "0018100000000000000000000000000000000000000000000000000000000000", + "list_rlp_bytes": [ + "f867", + "f867" + ], + "value_rlp_bytes": [ + "b846", + "b846" + ], + "value_list_rlp_bytes": [ + "f844", + "f844" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "f86c", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "storage": null, + "mod_extension": null, + "values": [ + "9e300000000000000000000000000000000000000000000000000000000000000000", + "9e300000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42100", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42100", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a0301810000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8679e300000000000000000000000000000000000000000000000000000000000b846f8448080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f8679e300000000000000000000000000000000000000000000000000000000000b846f8448080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "0018100000000000000000000000000000000000" + ] + }, + { + "start": { + "disable_preimage_check": false, + "proof_type": "Disabled" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0000000000000000000000000000000000000000000000000000000000000000000", + "a0000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [] + } +] \ No newline at end of file diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json new file mode 100644 index 0000000000..58c6c32bae --- /dev/null +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json @@ -0,0 +1,413 @@ +[ + { + "start": { + "disable_preimage_check": true, + "proof_type": "StorageDoesNotExist" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200", + "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200" + ], + "keccak_data": [] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", + "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", + "a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bd00", + "a0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf002100", + "a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e000", + "a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d84464800", + "a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e700", + "a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92d00", + "a0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb72100", + "a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd7168100", + "a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec8447200", + "a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8e00", + "a09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc220800", + "a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94ec00", + "a07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df47500", + "a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a000", + "a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb00", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80", + "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 15, + "drifted_index": 15, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", + "a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063e00", + "a033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b900", + "a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f91400", + "a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c900", + "a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6b00", + "a08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef700", + "a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb76600", + "a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e100", + "a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef5681115500", + "a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f200", + "a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a38360000", + "a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b1700", + "a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abace00", + "a00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f500", + "a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d400", + "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580", + "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 2, + "drifted_index": 2, + "list_rlp_bytes": [ + "f901b1", + "f901b1" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", + "a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218a00", + "a019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e800", + "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a11000", + "a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa61500", + "a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96400", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecc00", + "a0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d42468289295100", + "a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d5100", + "a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0be00", + "a080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd1165500", + "a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153400", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480", + "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 6, + "drifted_index": 6, + "list_rlp_bytes": [ + "f891", + "f891" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b16300", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080", + "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080" + ] + }, + { + "start": null, + "extension_branch": null, + "account": { + "address": "40efbf12580138bc623c95757286df4e24eb81c9", + "key": "0f266f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e", + "list_rlp_bytes": [ + "f868", + "f868" + ], + "value_rlp_bytes": [ + "b846", + "b846" + ], + "value_list_rlp_bytes": [ + "f844", + "f844" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "f868", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "storage": null, + "mod_extension": null, + "values": [ + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "40efbf12580138bc623c95757286df4e24eb81c9" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": true, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "extension": { + "list_rlp_bytes": "e4" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f851", + "f851" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", + "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", + "a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "82112300000000000000000000000000000000000000000000000000000000000000", + "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900", + "00000300000000000000000000000000000000000000000000000000000000000000", + "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900" + ], + "keccak_data": [ + "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", + "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", + "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39", + "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39" + ] + }, + { + "start": null, + "extension_branch": null, + "account": null, + "storage": { + "address": "1200000000000000000000000000000000000000000000000000000000000000", + "key": "1200000000000000000000000000000000000000000000000000000000000000", + "list_rlp_bytes": [ + "f6", + "f6" + ], + "value_rlp_bytes": [ + "95", + "95" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "e2", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "mod_extension": null, + "values": [ + "9f200000000000000000000000000000000000000000000000000000000000000000", + "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", + "9f200000000000000000000000000000000000000000000000000000000000000000", + "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a1201200000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", + "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", + "1200000000000000000000000000000000000000000000000000000000000000" + ] + }, + { + "start": { + "disable_preimage_check": false, + "proof_type": "Disabled" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0000000000000000000000000000000000000000000000000000000000000000000", + "a0000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [] + } +] \ No newline at end of file From 138552768a2039c0c9895ce357d12321a4e1a924 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Mon, 25 Mar 2024 09:41:40 +0100 Subject: [PATCH 21/43] removing remnants --- geth-utils/gethutil/mpt/witness/branch.go | 2 +- .../mpt/witness/modified_extension_node.go | 5 +---- .../gethutil/mpt/witness/prepare_witness.go | 21 ++++++++++--------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 4a539d4d78..52e4bbd8e4 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -209,7 +209,7 @@ func addBranchAndPlaceholder(proof1, proof2 [][]byte, leafRow0, key, neighbourNode []byte, keyIndex int, additionalBranch, isAccountProof, nonExistingAccountProof, - isShorterProofLastLeaf bool, toBeHashed *[][]byte) (bool, bool, int, Node) { + isShorterProofLastLeaf bool) (bool, bool, int, Node) { len1 := len(proof1) len2 := len(proof2) diff --git a/geth-utils/gethutil/mpt/witness/modified_extension_node.go b/geth-utils/gethutil/mpt/witness/modified_extension_node.go index ab17775426..a6c80c4a64 100644 --- a/geth-utils/gethutil/mpt/witness/modified_extension_node.go +++ b/geth-utils/gethutil/mpt/witness/modified_extension_node.go @@ -13,10 +13,7 @@ import ( // The rows added are somewhat exceptional as otherwise they do not appear. func equipLeafWithModExtensionNode(statedb *state.StateDB, leafNode Node, addr common.Address, proof1, proof2, extNibblesS, extNibblesC [][]byte, - key, neighbourNode []byte, - keyIndex, numberOfNibbles int, - additionalBranch, isAccountProof, nonExistingAccountProof, - isShorterProofLastLeaf bool, toBeHashed *[][]byte) Node { + key []byte, keyIndex, numberOfNibbles int, isAccountProof bool) Node { len1 := len(proof1) len2 := len(proof2) diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 3ffa0f8b82..f19541bbc6 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -176,7 +176,6 @@ func obtainTwoProofsAndConvertToWitness(trieModifications []TrieModification, st kh = tMod.Key.Bytes() } keyHashed := trie.KeybytesToHex(kh) - addr := tMod.Address addrh := crypto.Keccak256(addr.Bytes()) if oracle.AccountPreventHashingInSecureTrie { @@ -335,7 +334,6 @@ func updateStateAndPrepareWitness(testName string, keys, values []common.Hash, a // and inserted into the Keccak lookup table. func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh []byte, proof1, proof2, extNibblesS, extNibblesC [][]byte, storage_key common.Hash, key []byte, neighbourNode []byte, isAccountProof, nonExistingAccountProof, nonExistingStorageProof, isShorterProofLastLeaf bool) []Node { - toBeHashed := make([][]byte, 0) minLen := len(proof1) if len(proof2) < minLen { @@ -434,7 +432,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] extNibblesS[len1-1], extNibblesC[len2-1], leafRow0, key, neighbourNode, keyIndex, additionalBranch, - isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf, &toBeHashed) + isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf) nodes = append(nodes, bNode) @@ -473,9 +471,8 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // of the existing extension node), additional rows are added (extension node before and after // modification). if isModifiedExtNode { - leafNode = equipLeafWithModExtensionNode(statedb, leafNode, addr, proof1, proof2, extNibblesS, extNibblesC, key, neighbourNode, - keyIndex, numberOfNibbles, additionalBranch, - isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf, &toBeHashed) + leafNode = equipLeafWithModExtensionNode(statedb, leafNode, addr, proof1, proof2, extNibblesS, extNibblesC, key, + keyIndex, numberOfNibbles, isAccountProof) } nodes = append(nodes, leafNode) } else { @@ -564,7 +561,10 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] newAddr := common.BytesToAddress(newAddrBytes) var extNibbles [][]byte; proof, _, extNibbles, _, _, err = statedb.GetProof(newAddr) - check(err) + // We just continue if there is an error + if err != nil { + continue + } if len(extNibbles[len(extNibbles)-1]) == 0 && !isBranch(proof[len(proof)-1]) { break } @@ -573,7 +573,10 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] ky := common.BytesToHash(k) var extNibbles [][]byte; proof, _, extNibbles, _, _, err = statedb.GetStorageProof(addr, ky) - check(err) + // We just continue if there is an error + if err != nil { + continue + } if len(extNibbles[len(extNibbles)-1]) == 0 && !isBranch(proof[len(proof)-1]) { break } @@ -582,14 +585,12 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] branchRlp := proof[len(proof)-2] // the last element has to be a leaf isExtension := true - extNode := proof2[len(proof2)-1] // Let's name it E1 bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, key[keyIndex], key[keyIndex], false, false, isExtension) nodes = append(nodes, bNode) // Let's construct the leaf L1 that will have the correct key (the queried one) - if isAccountProof { compact := trie.HexToCompact(addr_nibbles[start:]) From d6c896a6030701d706c29f913608918ba7968034 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 26 Mar 2024 12:01:41 +0100 Subject: [PATCH 22/43] Working on wrong extension node --- geth-utils/gethutil/mpt/witness/leaf.go | 11 ++ .../gethutil/mpt/witness/prepare_witness.go | 105 +++++------------- .../src/mpt_circuit/account_leaf.rs | 26 +++++ zkevm-circuits/src/mpt_circuit/extension.rs | 3 +- 4 files changed, 64 insertions(+), 81 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index f9139fd234..bed72053e3 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -579,3 +579,14 @@ func prepareStorageLeafNode(leafS, leafC, constructedLeaf, neighbourNode []byte, return node } + +func equipLeafWithWrongExtension(leafNode Node, keyBefore, keyMiddle, keyAfter []byte) Node { + l := len(leafNode.Values) + // The rows which are used for nibbles (it means there are checks for values being < 16) + // in the modified extension node cases are omitted. + leafNode.Values[l-modifiedExtensionNodeRowLen - 1] = keyBefore + leafNode.Values[l-modifiedExtensionNodeRowLen] = keyMiddle + leafNode.Values[l-modifiedExtensionNodeRowLen + 3] = keyAfter + + return leafNode +} \ No newline at end of file diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index f19541bbc6..70b2e4342d 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -1,6 +1,7 @@ package witness import ( + "fmt" "math/big" "main/gethutil/mpt/oracle" @@ -503,24 +504,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // We are in a non-existing-proof and an extension node is the last element of getProof. // However, this extension node has not been added to the nodes yet (it's always added // together with a branch). - // It's non-existing-proof and we have a "wrong" extension node, that means we have - // to obtain the underlying branch to be able to finally add (besides this branch) - // the placeholder leaf. So we need to query getProof again with one of the leaves that is - // actually in this extension node. - - /* - Let's say we have an extension node E1 at the following path [3, 5, 8]. - Let's say E1 has nibbles [1, 2, 3]. Let's say we want to prove there does not exist - a leaf at [3, 5, 8, 1, 2, 4] (because there is overlapping path with E1). - - We need to construct a leaf L1 that will have the key equal to the queried key. - This means the nibbles are the same as in the path to E1 (without extension nibbles). - - In the circuit, the leaf L1 will have the same key as the queried key once - the KeyData will be queried with offset 1 (to get the accumulated key RLC up until E1). - The nibbles stored in L1 will be added to the RLC and compared with the queried - key (has to be the same). - */ + nibbles := getNibbles(proof2[len(proof2)-1]) newKey := make([]byte, len(key)) copy(newKey, key) @@ -533,58 +517,28 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] start := keyIndex - len(nibbles) - /* - Following the above example, the queried key `key` is [3, 5, 8, 1, 2, 4]. - The path to E1 and its nibbles is [3, 5, 8, 1, 2, 3]. - We construct the key `newKey` to get the underlying branch of E1. - */ - for i := 0; i < len(nibbles); i++ { - n := nibbles[i] - if key[start + i] != n { - newKey[start + i] = n - } + before := newKey[0:start] + if len(before) % 2 == 1 { + before = append(before, 0) } + keyBefore := trie.HexToKeybytes(before) + fmt.Println(keyBefore) - /* - The last nibble should be the one that gets one of the leaves in the branch (not nil) - - to get the leaf in branch as well. - */ - var proof [][]byte - var err error - for i := 0; i < 16; i++ { - newKey[keyIndex] = byte(i) - if isAccountProof { - var newAddrBytes []byte; - for j := 0; j < 40; j = j + 2{ - newAddrBytes = append(newAddrBytes, newKey[j] * 16 + newKey[j+1]) - } - newAddr := common.BytesToAddress(newAddrBytes) - var extNibbles [][]byte; - proof, _, extNibbles, _, _, err = statedb.GetProof(newAddr) - // We just continue if there is an error - if err != nil { - continue - } - if len(extNibbles[len(extNibbles)-1]) == 0 && !isBranch(proof[len(proof)-1]) { - break - } - } else { - k := trie.HexToKeybytes(newKey) - ky := common.BytesToHash(k) - var extNibbles [][]byte; - proof, _, extNibbles, _, _, err = statedb.GetStorageProof(addr, ky) - // We just continue if there is an error - if err != nil { - continue - } - if len(extNibbles[len(extNibbles)-1]) == 0 && !isBranch(proof[len(proof)-1]) { - break - } - } - } + middle := newKey[start:keyIndex] + keyMiddle := []byte{160} + keyMiddle = append(keyMiddle, trie.HexToCompact(middle)...) + fmt.Println(keyMiddle) + + after := newKey[keyIndex:] + keyAfter := []byte{160} + keyAfter = append(keyAfter, trie.HexToCompact(after)...) + fmt.Println(keyAfter) - branchRlp := proof[len(proof)-2] // the last element has to be a leaf isExtension := true + // Dummy branch. The constraint of the branch being in the extension node and the constraint of the + // leaf being in the branch need to be disabled for this case. + branchRlp := []byte{248, 81, 160, 244, 245, 0, 27, 233, 28, 128, 158, 163, 228, 185, 193, 250, 228, 226, 205, 233, 119, 98, 15, 183, 171, 187, 182, 172, 113, 115, 190, 167, 217, 33, 211, 160, 72, 229, 31, 123, 46, 26, 63, 24, 242, 142, 183, 252, 47, 111, 99, 255, 0, 118, 149, 196, 125, 165, 118, 4, 189, 149, 202, 221, 129, 141, 240, 209, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}; + extNode := proof2[len(proof2)-1] // Let's name it E1 bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, key[keyIndex], key[keyIndex], false, false, isExtension) @@ -592,18 +546,11 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // Let's construct the leaf L1 that will have the correct key (the queried one) if isAccountProof { - compact := trie.HexToCompact(addr_nibbles[start:]) - - compactLen := byte(len(compact)) + dummyLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} + node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) - constructedLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} - constructedLeaf[2] = 128 + compactLen - for i := 0; i < len(compact); i++ { - constructedLeaf[3 + i] = compact[i]; - } - constructedLeaf[1] = byte(len(constructedLeaf)) - 2 + node = equipLeafWithWrongExtension(node, keyBefore, keyMiddle, keyAfter) - node := prepareAccountLeafNode(addr, addrh, proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, addr_nibbles, false, false, false) nodes = append(nodes, node) } else { @@ -614,12 +561,12 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] rlp2 := 128 + compactLen rlp1 := 192 + compactLen + 1 // Constructed leaf L1: - constructedLeaf := append([]byte{rlp1, rlp2}, compact...) + dummyLeaf := append([]byte{rlp1, rlp2}, compact...) // Add dummy value: - constructedLeaf = append(constructedLeaf, 0) + dummyLeaf = append(dummyLeaf, 0) - node := prepareStorageLeafNode(proof[len(proof)-1], proof[len(proof)-1], constructedLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + node := prepareStorageLeafNode(dummyLeaf, dummyLeaf, dummyLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) nodes = append(nodes, node) } } diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index a6184d2021..741867dd0a 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -270,6 +270,7 @@ impl AccountLeafConfig { key_data[is_s.idx()].is_odd.expr(), &cb.key_r.expr(), ); + // Total number of nibbles needs to be KEY_LEN_IN_NIBBLES. let num_nibbles = num_nibbles::expr(rlp_key.key_value.len(), key_data[is_s.idx()].is_odd.expr()); @@ -382,6 +383,31 @@ impl AccountLeafConfig { &cb.key_r.expr(), ); + // TODO: wrong extension node + /* + let wrong_bytes = + ctx.rlp_item(meta, cb, AccountRowType::Wrong as usize, RlpItemType::Key); + */ + let wrong_ext_middle = + ctx.rlp_item(meta, cb, AccountRowType::LongExtNodeKey as usize, RlpItemType::Key); + let wrong_ext_after = + ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeKey as usize, RlpItemType::Key); + + let (before, before_mult) = wrong_bytes.rlc_chain_data(); + require!(before => config.key_data_prev.rlc.expr()); + + /* + wrong_ext_before = key_data[is_s.idx()].rlc.expr() + + rlp_key.key.expr( + cb, + rlp_key.key_value.clone(), + key_data[is_s.idx()].mult.expr(), + key_data[is_s.idx()].is_odd.expr(), + &cb.key_r.expr(), + ); + */ + + // Anything following this node is below the account // TODO(Brecht): For non-existing accounts it should be impossible to prove // storage leaves unless it's also a non-existing proof? diff --git a/zkevm-circuits/src/mpt_circuit/extension.rs b/zkevm-circuits/src/mpt_circuit/extension.rs index 6552eeeb71..c4d22588be 100644 --- a/zkevm-circuits/src/mpt_circuit/extension.rs +++ b/zkevm-circuits/src/mpt_circuit/extension.rs @@ -155,8 +155,7 @@ impl ExtensionGadget { // Calculate the extension node key RLC when in an extension node // Currently, the extension node S and extension node C both have the same key // RLC - however, sometimes extension node can be replaced by a - // shorter extension node (in terms of nibbles), this is still to be - // implemented. + // shorter extension node (in terms of nibbles), this is handled by ModExtensionGadget. let key_rlc = key_data.rlc.expr() + ext_key_rlc_expr( cb, From 8fccf9cdeedf6dc5efa9a2b4b39b41437a212901 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Thu, 28 Mar 2024 10:56:57 +0100 Subject: [PATCH 23/43] Wrong extension node: three parts of the key adds up to key rlc --- .../gethutil/mpt/witness/extension_node.go | 9 +- geth-utils/gethutil/mpt/witness/leaf.go | 30 ++++++- .../gethutil/mpt/witness/prepare_witness.go | 22 ++--- .../src/mpt_circuit/account_leaf.rs | 82 ++++++++++++++----- 4 files changed, 103 insertions(+), 40 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/extension_node.go b/geth-utils/gethutil/mpt/witness/extension_node.go index e61c01f4f6..fee54ac26a 100644 --- a/geth-utils/gethutil/mpt/witness/extension_node.go +++ b/geth-utils/gethutil/mpt/witness/extension_node.go @@ -15,11 +15,11 @@ func prepareExtensions(extNibbles []byte, proofEl1, proofEl2 []byte) (byte, []by numberOfNibbles := getExtensionNumberOfNibbles(proofEl1) // We need nibbles as witness to compute key RLC, so we set them - // into extensionRowC s_advices (we can do this because both extension + // into extensionRowC (we can do this because both extension // nodes have the same key, so we can have this info only in one). // There can be more up to 64 nibbles, but there is only 32 bytes - // in extensionRowC s_advices. So we store every second nibble (having - // the whole byte and one nibble is enough to compute the other nibble). + // in extensionRowC. So we store every second nibble (having + // the byte and one nibble is enough to compute the other nibble). startNibblePos := 2 // we don't need any nibbles for case keyLen = 1 if keyLen > 1 { @@ -31,8 +31,7 @@ func prepareExtensions(extNibbles []byte, proofEl1, proofEl2 []byte) (byte, []by } ind := 0 for j := startNibblePos; j < len(extNibbles); j += 2 { - v3[2+ind] = // TODO: check 2 + ind - extNibbles[j] + v3[2+ind] = extNibbles[j] ind++ } values = append(values, v1) diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index bed72053e3..88cdb89980 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -580,13 +580,41 @@ func prepareStorageLeafNode(leafS, leafC, constructedLeaf, neighbourNode []byte, return node } -func equipLeafWithWrongExtension(leafNode Node, keyBefore, keyMiddle, keyAfter []byte) Node { +func equipLeafWithWrongExtension(leafNode Node, keyBefore, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter []byte) Node { l := len(leafNode.Values) // The rows which are used for nibbles (it means there are checks for values being < 16) // in the modified extension node cases are omitted. leafNode.Values[l-modifiedExtensionNodeRowLen - 1] = keyBefore + leafNode.Values[l-modifiedExtensionNodeRowLen] = keyMiddle + startNibblePos := 2 // we don't need any nibbles for case keyLen = 1 + if len(keyMiddle) > 1 { + if len(nibblesMiddle) % 2 == 0 { + startNibblePos = 1 + } else { + startNibblePos = 2 + } + } + ind := 0 + for j := startNibblePos; j < len(nibblesMiddle); j += 2 { + leafNode.Values[l-modifiedExtensionNodeRowLen + 1][2+ind] = nibblesMiddle[j] + ind++ + } + leafNode.Values[l-modifiedExtensionNodeRowLen + 3] = keyAfter + startNibblePos = 2 // we don't need any nibbles for case keyLen = 1 + if len(keyAfter) > 1 { + if len(nibblesAfter) % 2 == 0 { + startNibblePos = 1 + } else { + startNibblePos = 2 + } + } + ind = 0 + for j := startNibblePos; j < len(nibblesAfter); j += 2 { + leafNode.Values[l-modifiedExtensionNodeRowLen + 4][2+ind] = nibblesAfter[j] + ind++ + } return leafNode } \ No newline at end of file diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 70b2e4342d..f3db30a932 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -1,7 +1,6 @@ package witness import ( - "fmt" "math/big" "main/gethutil/mpt/oracle" @@ -517,22 +516,19 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] start := keyIndex - len(nibbles) - before := newKey[0:start] - if len(before) % 2 == 1 { - before = append(before, 0) + nibblesBefore := newKey[0:start] + if len(nibblesBefore) % 2 == 1 { + nibblesBefore = append(nibblesBefore, 0) } - keyBefore := trie.HexToKeybytes(before) - fmt.Println(keyBefore) + keyBefore := trie.HexToKeybytes(nibblesBefore) - middle := newKey[start:keyIndex] + nibblesMiddle := newKey[start:keyIndex] keyMiddle := []byte{160} - keyMiddle = append(keyMiddle, trie.HexToCompact(middle)...) - fmt.Println(keyMiddle) + keyMiddle = append(keyMiddle, trie.HexToCompact(nibblesMiddle)...) - after := newKey[keyIndex:] + nibblesAfter := newKey[keyIndex:len(newKey)-1] // Remove the last flag (16) keyAfter := []byte{160} - keyAfter = append(keyAfter, trie.HexToCompact(after)...) - fmt.Println(keyAfter) + keyAfter = append(keyAfter, trie.HexToCompact(nibblesAfter)...) isExtension := true // Dummy branch. The constraint of the branch being in the extension node and the constraint of the @@ -549,7 +545,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] dummyLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) - node = equipLeafWithWrongExtension(node, keyBefore, keyMiddle, keyAfter) + node = equipLeafWithWrongExtension(node, keyBefore, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) nodes = append(nodes, node) } else { diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 741867dd0a..ebac85bd67 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -1,5 +1,5 @@ use eth_types::{Field, OpsIdentity, U256}; -use gadgets::util::{pow, Scalar}; +use gadgets::util::{pow, xor, Scalar}; use halo2_proofs::{ circuit::Value, plonk::{Error, Expression, VirtualCells}, @@ -16,17 +16,15 @@ use crate::{ circuit_tools::{ cached_region::CachedRegion, cell_manager::Cell, - constraint_builder::{RLCChainableRev, RLCable}, + constraint_builder::{RLCChainable, RLCChainableRev, RLCable}, gadgets::IsEqualGadget, }, evm_circuit::util::from_bytes, mpt_circuit::{ helpers::{ - key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, - IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongGadget, - KECCAK, + ext_key_rlc_expr, key_memory, leaf_key_rlc, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongGadget, KECCAK }, - param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES, RLP_LIST_LONG, RLP_LONG}, + param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES, KEY_PREFIX_ODD, RLP_LIST_LONG, RLP_LONG}, MPTConfig, MPTContext, MptMemory, RlpItemType, }, table::MPTProofType, @@ -368,7 +366,7 @@ impl AccountLeafConfig { &cb.key_r.expr(), ); - // Wrong leaf / extension node handling + // Wrong leaf handling config.wrong = WrongGadget::construct( cb, key_item.hash_rlc(), @@ -383,30 +381,72 @@ impl AccountLeafConfig { &cb.key_r.expr(), ); - // TODO: wrong extension node - /* - let wrong_bytes = - ctx.rlp_item(meta, cb, AccountRowType::Wrong as usize, RlpItemType::Key); - */ + // TODO: wrong extension node gadget let wrong_ext_middle = ctx.rlp_item(meta, cb, AccountRowType::LongExtNodeKey as usize, RlpItemType::Key); + let wrong_ext_middle_nibbles = + ctx.rlp_item(meta, cb, AccountRowType::LongExtNodeNibbles as usize, RlpItemType::Nibbles); let wrong_ext_after = ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeKey as usize, RlpItemType::Key); + let wrong_ext_after_nibbles = + ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeNibbles as usize, RlpItemType::Nibbles); + + // In the wrong extension node, AccountRowType::Wrong stores the bytes of the key nibbles + // up until the extension node. + let (mut rlc, _) = wrong_bytes.rlc_chain_data(); + // The nibbles stored in the Wrong row (up until the extension node) + // need to be the same as the nibbles in the path. + require!(rlc => config.key_data_prev.rlc.expr()); + + // We have a key split into three parts in + // the wrong extension node case, meaning that there the first part parity doesn't + // tell us about the parity of the second part (depends on the third part as well). + + let data0 = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles.clone()]; + rlc = rlc + + ext_key_rlc_expr( + cb, + wrong_ext_middle, + config.key_data_prev.mult.expr(), + config.key_data[1].is_odd.expr(), + config.key_data_prev.is_odd.expr(), + data0 + .iter() + .map(|item| item.bytes_be()) + .collect::>() + .try_into() + .unwrap(), + &cb.key_r.expr(), + ); + + // odd odd -> even + // odd even -> odd + // even odd -> odd + // even even -> even + let after_two_parts_is_odd = + xor::expr(config.key_data_prev.is_odd.expr(), config.key_data[1].is_odd.expr()); - let (before, before_mult) = wrong_bytes.rlc_chain_data(); - require!(before => config.key_data_prev.rlc.expr()); + // The total number of nibbles is odd, thus: + let third_part_is_odd = after_two_parts_is_odd.clone(); - /* - wrong_ext_before = key_data[is_s.idx()].rlc.expr() - + rlp_key.key.expr( + let data1 = [wrong_ext_after.clone(), wrong_ext_after_nibbles.clone()]; + rlc = rlc + + ext_key_rlc_expr( cb, - rlp_key.key_value.clone(), - key_data[is_s.idx()].mult.expr(), - key_data[is_s.idx()].is_odd.expr(), + wrong_ext_after, + config.key_data[1].mult.expr(), + third_part_is_odd, + after_two_parts_is_odd, + data1 + .iter() + .map(|item| item.bytes_be()) + .collect::>() + .try_into() + .unwrap(), &cb.key_r.expr(), ); - */ + require!(key_item.hash_rlc() => rlc); // Anything following this node is below the account // TODO(Brecht): For non-existing accounts it should be impossible to prove From 46627ddb0f0df1dba6e7f2f8169238eaf5a59b52 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 29 Mar 2024 09:19:34 +0100 Subject: [PATCH 24/43] WrongExtNodeGadget introduced --- geth-utils/gethutil/mpt/witness/leaf.go | 6 +- .../gethutil/mpt/witness/prepare_witness.go | 8 +- .../src/mpt_circuit/account_leaf.rs | 87 ++------ zkevm-circuits/src/mpt_circuit/helpers.rs | 188 ++++++++++++++---- .../src/mpt_circuit/storage_leaf.rs | 7 +- 5 files changed, 176 insertions(+), 120 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index 88cdb89980..84772c8fc8 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -580,12 +580,8 @@ func prepareStorageLeafNode(leafS, leafC, constructedLeaf, neighbourNode []byte, return node } -func equipLeafWithWrongExtension(leafNode Node, keyBefore, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter []byte) Node { +func equipLeafWithWrongExtension(leafNode Node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter []byte) Node { l := len(leafNode.Values) - // The rows which are used for nibbles (it means there are checks for values being < 16) - // in the modified extension node cases are omitted. - leafNode.Values[l-modifiedExtensionNodeRowLen - 1] = keyBefore - leafNode.Values[l-modifiedExtensionNodeRowLen] = keyMiddle startNibblePos := 2 // we don't need any nibbles for case keyLen = 1 if len(keyMiddle) > 1 { diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index f3db30a932..0d7f9a7eb0 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -516,12 +516,6 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] start := keyIndex - len(nibbles) - nibblesBefore := newKey[0:start] - if len(nibblesBefore) % 2 == 1 { - nibblesBefore = append(nibblesBefore, 0) - } - keyBefore := trie.HexToKeybytes(nibblesBefore) - nibblesMiddle := newKey[start:keyIndex] keyMiddle := []byte{160} keyMiddle = append(keyMiddle, trie.HexToCompact(nibblesMiddle)...) @@ -545,7 +539,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] dummyLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) - node = equipLeafWithWrongExtension(node, keyBefore, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) + node = equipLeafWithWrongExtension(node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) nodes = append(nodes, node) } else { diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index ebac85bd67..5f95565614 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -16,15 +16,15 @@ use crate::{ circuit_tools::{ cached_region::CachedRegion, cell_manager::Cell, - constraint_builder::{RLCChainable, RLCChainableRev, RLCable}, + constraint_builder::{RLCChainableRev, RLCable}, gadgets::IsEqualGadget, }, evm_circuit::util::from_bytes, mpt_circuit::{ helpers::{ - ext_key_rlc_expr, key_memory, leaf_key_rlc, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongGadget, KECCAK + ext_key_rlc_expr, key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongExtNodeGadget, WrongLeafGadget, KECCAK }, - param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES, KEY_PREFIX_ODD, RLP_LIST_LONG, RLP_LONG}, + param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES, RLP_LIST_LONG, RLP_LONG}, MPTConfig, MPTContext, MptMemory, RlpItemType, }, table::MPTProofType, @@ -43,7 +43,8 @@ pub(crate) struct AccountLeafConfig { value_list_rlp_bytes: [[Cell; 2]; 2], is_placeholder_leaf: [IsPlaceholderLeafGadget; 2], drifted: DriftedGadget, - wrong: WrongGadget, + wrong_leaf: WrongLeafGadget, + wrong_ext_node: WrongExtNodeGadget, is_non_existing_account_proof: IsEqualGadget, is_account_delete_mod: IsEqualGadget, is_nonce_mod: IsEqualGadget, @@ -367,7 +368,7 @@ impl AccountLeafConfig { ); // Wrong leaf handling - config.wrong = WrongGadget::construct( + config.wrong_leaf = WrongLeafGadget::construct( cb, key_item.hash_rlc(), config.is_non_existing_account_proof.expr(), @@ -377,11 +378,10 @@ impl AccountLeafConfig { config.is_placeholder_leaf[true.idx()].expr(), config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), - config.key_data_prev.clone(), &cb.key_r.expr(), ); - // TODO: wrong extension node gadget + // Wrong extension node handling let wrong_ext_middle = ctx.rlp_item(meta, cb, AccountRowType::LongExtNodeKey as usize, RlpItemType::Key); let wrong_ext_middle_nibbles = @@ -391,63 +391,20 @@ impl AccountLeafConfig { let wrong_ext_after_nibbles = ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeNibbles as usize, RlpItemType::Nibbles); - // In the wrong extension node, AccountRowType::Wrong stores the bytes of the key nibbles - // up until the extension node. - let (mut rlc, _) = wrong_bytes.rlc_chain_data(); - // The nibbles stored in the Wrong row (up until the extension node) - // need to be the same as the nibbles in the path. - require!(rlc => config.key_data_prev.rlc.expr()); - - // We have a key split into three parts in - // the wrong extension node case, meaning that there the first part parity doesn't - // tell us about the parity of the second part (depends on the third part as well). - - let data0 = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles.clone()]; - rlc = rlc - + ext_key_rlc_expr( - cb, - wrong_ext_middle, - config.key_data_prev.mult.expr(), - config.key_data[1].is_odd.expr(), - config.key_data_prev.is_odd.expr(), - data0 - .iter() - .map(|item| item.bytes_be()) - .collect::>() - .try_into() - .unwrap(), - &cb.key_r.expr(), - ); - - // odd odd -> even - // odd even -> odd - // even odd -> odd - // even even -> even - let after_two_parts_is_odd = - xor::expr(config.key_data_prev.is_odd.expr(), config.key_data[1].is_odd.expr()); - - // The total number of nibbles is odd, thus: - let third_part_is_odd = after_two_parts_is_odd.clone(); - - let data1 = [wrong_ext_after.clone(), wrong_ext_after_nibbles.clone()]; - rlc = rlc - + ext_key_rlc_expr( - cb, - wrong_ext_after, - config.key_data[1].mult.expr(), - third_part_is_odd, - after_two_parts_is_odd, - data1 - .iter() - .map(|item| item.bytes_be()) - .collect::>() - .try_into() - .unwrap(), - &cb.key_r.expr(), - ); - - require!(key_item.hash_rlc() => rlc); - + config.wrong_ext_node = WrongExtNodeGadget::construct( + cb, + key_item.hash_rlc(), + config.is_non_existing_account_proof.expr(), + &wrong_ext_middle, + &wrong_ext_middle_nibbles, + &wrong_ext_after, + &wrong_ext_after_nibbles, + config.parent_data[true.idx()].is_extension.expr(), + config.key_data[true.idx()].clone(), + config.key_data_prev.clone(), + &cb.key_r.expr(), + ); + // Anything following this node is below the account // TODO(Brecht): For non-existing accounts it should be impossible to prove // storage leaves unless it's also a non-existing proof? @@ -775,7 +732,7 @@ impl AccountLeafConfig { 2, // 2 instead of 1 because default values have already been stored above )?; } - self.wrong.assign( + self.wrong_leaf.assign( region, offset, is_non_existing_proof, diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index ce186b98ca..3eaac4cecf 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1215,12 +1215,12 @@ impl DriftedGadget { /// Handles wrong leaves #[derive(Clone, Debug, Default)] -pub struct WrongGadget { +pub struct WrongLeafGadget { wrong_rlp_key: ListKeyGadget, is_key_equal: IsEqualGadget, } -impl WrongGadget { +impl WrongLeafGadget { #[allow(clippy::too_many_arguments)] pub(crate) fn construct( cb: &mut MPTConstraintBuilder, @@ -1232,54 +1232,164 @@ impl WrongGadget { is_placeholder: Expression, is_parent_extension: Expression, key_data: KeyData, - key_data_prev: KeyData, r: &Expression, ) -> Self { - let mut config = WrongGadget::default(); + let mut config = WrongLeafGadget::default(); circuit!([meta, cb.base], { - // Get the previous key data - ifx! {and::expr(&[is_non_existing, not!(is_placeholder)]) => { + ifx! {and::expr(&[is_non_existing, not!(is_placeholder), not!(is_parent_extension)]) => { config.wrong_rlp_key = ListKeyGadget::construct(cb, expected_item); - ifx! {not!(is_parent_extension) => { - let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( - cb, - config.wrong_rlp_key.key_value.clone(), - key_data.mult.expr(), - key_data.is_odd.expr(), - r, - ); - // Check that it's the key as expected - require!(key_rlc_wrong => expected_key.clone()); - - // Now make sure this address is different than the one of the leaf - config.is_key_equal = IsEqualGadget::construct( - &mut cb.base, - key_rlc.expr(), - expected_key.clone(), - ); - require!(config.is_key_equal.expr() => false); - // Make sure the lengths of the keys are the same - require!(config.wrong_rlp_key.key_value.len() => key_value.len()); - } elsex { - let key_rlc_wrong = key_data_prev.rlc.expr() + config.wrong_rlp_key.key.expr( + let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( + cb, + config.wrong_rlp_key.key_value.clone(), + key_data.mult.expr(), + key_data.is_odd.expr(), + r, + ); + // Check that it's the key as expected + require!(key_rlc_wrong => expected_key.clone()); + + // Now make sure this address is different than the one of the leaf + config.is_key_equal = IsEqualGadget::construct( + &mut cb.base, + key_rlc.expr(), + expected_key.clone(), + ); + require!(config.is_key_equal.expr() => false); + // Make sure the lengths of the keys are the same + require!(config.wrong_rlp_key.key_value.len() => key_value.len()); + }} + config + }) + } + + #[allow(clippy::too_many_arguments)] + pub(crate) fn assign( + &self, + region: &mut CachedRegion<'_, '_, F>, + offset: usize, + is_non_existing: bool, + key_rlc: &[F], + list_bytes: &[u8], + expected_item: &RLPItemWitness, + for_placeholder_s: bool, + is_parent_extension: bool, + key_data: KeyDataWitness, + key_data_prev: KeyDataWitness, + r: F, + ) -> Result<(F, F), Error> { + if is_non_existing { + let wrong_witness = + self.wrong_rlp_key + .assign(region, offset, list_bytes, expected_item)?; + let key_rlc_wrong: F; + if !is_parent_extension { + (key_rlc_wrong, _) = wrong_witness.key.key( + wrong_witness.key_item.clone(), + key_data.rlc, + key_data.mult, + r, + ); + } else { + (key_rlc_wrong, _) = wrong_witness.key.key( + wrong_witness.key_item.clone(), + key_data_prev.rlc, + key_data_prev.mult, + r, + ); + } + + let is_key_equal_witness = self.is_key_equal.assign( + region, + offset, + key_rlc[for_placeholder_s.idx()], + key_rlc_wrong, + )?; + + // When key is not equal, we have a non existing account + Ok((key_rlc_wrong, is_key_equal_witness.neg())) + } else { + // existing account + Ok((key_rlc[for_placeholder_s.idx()], false.scalar())) + } + } +} + +/// Handles wrong extension nodes +#[derive(Clone, Debug, Default)] +pub struct WrongExtNodeGadget { + wrong_rlp_key: ListKeyGadget, + is_key_equal: IsEqualGadget, +} + +impl WrongExtNodeGadget { + #[allow(clippy::too_many_arguments)] + pub(crate) fn construct( + cb: &mut MPTConstraintBuilder, + expected_key: Expression, + is_non_existing: Expression, + wrong_ext_middle: &RLPItemView, + wrong_ext_middle_nibbles: &RLPItemView, + wrong_ext_after: &RLPItemView, + wrong_ext_after_nibbles: &RLPItemView, + is_parent_extension: Expression, + key_data: KeyData, + key_data_prev: KeyData, + r: &Expression, + ) -> Self { + let mut config = WrongExtNodeGadget::default(); + circuit!([meta, cb.base], { + // TODO: distinguish between wrong extension node / wrong leaf / nil leaf + ifx! {and::expr(&[is_non_existing, is_parent_extension]) => { + // We have a key split into three parts, + // meaning that there the first part parity doesn't + // tell us about the parity of the second part (depends on the third part as well). + + let data0 = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles.clone()]; + let mut rlc = key_data_prev.rlc.expr() + + ext_key_rlc_expr( cb, - config.wrong_rlp_key.key_value.clone(), + wrong_ext_middle.clone(), key_data_prev.mult.expr(), + key_data.is_odd.expr(), key_data_prev.is_odd.expr(), - r, + data0 + .iter() + .map(|item| item.bytes_be()) + .collect::>() + .try_into() + .unwrap(), + &cb.key_r.expr(), ); - // Check that it's the key as expected - require!(key_rlc_wrong => expected_key.clone()); - // We don't need to check `is_key_equal = false` because we have the extension node - // above, not the leaf - the two nodes are different without checking the key. + // odd odd -> even + // odd even -> odd + // even odd -> odd + // even even -> even + let after_two_parts_is_odd = + xor::expr(key_data_prev.is_odd.expr(), key_data.is_odd.expr()); - // We don't need to check that the lengths of the keys are the same because - // they are actually different in this case - one leaf is in the extension node's - // branch (and its path is longer due to extension nibbles), one ("wrong", but with - // the correct address/key) is not in the extension node's branch. - }} + // The total number of nibbles is odd, thus: + let third_part_is_odd = after_two_parts_is_odd.clone(); + + let data1 = [wrong_ext_after.clone(), wrong_ext_after_nibbles.clone()]; + rlc = rlc + + ext_key_rlc_expr( + cb, + wrong_ext_after.clone(), + key_data.mult.expr(), + third_part_is_odd, + after_two_parts_is_odd, + data1 + .iter() + .map(|item| item.bytes_be()) + .collect::>() + .try_into() + .unwrap(), + &cb.key_r.expr(), + ); + + require!(rlc => expected_key); }} config }) diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index f7656588f5..c48c2192e3 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -29,7 +29,7 @@ use crate::{ }; use super::{ - helpers::{Indexable, KeyDataWitness, ListKeyGadget, WrongGadget}, + helpers::{Indexable, KeyDataWitness, ListKeyGadget, WrongLeafGadget}, mod_extension::ModExtensionGadget, rlp_gadgets::{RLPItemWitness, RLPValueGadget}, witness_row::{Node, StorageRowType}, @@ -48,7 +48,7 @@ pub(crate) struct StorageLeafConfig { is_not_hashed: [LtGadget; 2], is_placeholder_leaf: [IsPlaceholderLeafGadget; 2], drifted: DriftedGadget, - wrong: WrongGadget, + wrong: WrongLeafGadget, is_storage_mod_proof: IsEqualGadget, is_non_existing_storage_proof: IsEqualGadget, is_mod_extension: [Cell; 2], @@ -287,7 +287,7 @@ impl StorageLeafConfig { ); // Wrong leaf / extension node handling - config.wrong = WrongGadget::construct( + config.wrong = WrongLeafGadget::construct( cb, key_item.hash_rlc(), config.is_non_existing_storage_proof.expr(), @@ -297,7 +297,6 @@ impl StorageLeafConfig { config.is_placeholder_leaf[true.idx()].expr(), config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), - config.key_data_prev.clone(), &cb.key_r.expr(), ); From 8ef1481a1ac6d752e2bdc640b578f3298cb8bbde Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 29 Mar 2024 11:13:05 +0100 Subject: [PATCH 25/43] is_key_equal added to WrongExtNodeGadget --- .../src/mpt_circuit/account_leaf.rs | 16 ++- zkevm-circuits/src/mpt_circuit/helpers.rs | 103 +++++++----------- .../src/mpt_circuit/storage_leaf.rs | 7 +- 3 files changed, 56 insertions(+), 70 deletions(-) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 5f95565614..a50c3b5247 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -6,7 +6,7 @@ use halo2_proofs::{ }; use super::{ - helpers::{KeyDataWitness, ListKeyGadget, MainData, ParentDataWitness}, + helpers::{ext_key_rlc_calc_value, KeyDataWitness, ListKeyGadget, MainData, ParentDataWitness}, mod_extension::ModExtensionGadget, rlp_gadgets::RLPItemWitness, witness_row::{AccountRowType, Node}, @@ -742,9 +742,19 @@ impl AccountLeafConfig { true, parent_data[1].is_extension, key_data[true.idx()].clone(), - key_data_prev, region.key_r, - )?; + )?; + + let wrong_ext_middle = rlp_values[AccountRowType::LongExtNodeKey as usize].clone(); + let wrong_ext_middle_nibbles = rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); + self.wrong_ext_node.assign( + region, + offset, + wrong_ext_middle, + wrong_ext_middle_nibbles, + key_data[true.idx()].clone(), + key_data_prev.clone(), + ); // Anything following this node is below the account MainData::witness_store( diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 3eaac4cecf..41dd30fa39 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1275,30 +1275,18 @@ impl WrongLeafGadget { for_placeholder_s: bool, is_parent_extension: bool, key_data: KeyDataWitness, - key_data_prev: KeyDataWitness, r: F, ) -> Result<(F, F), Error> { if is_non_existing { let wrong_witness = self.wrong_rlp_key .assign(region, offset, list_bytes, expected_item)?; - let key_rlc_wrong: F; - if !is_parent_extension { - (key_rlc_wrong, _) = wrong_witness.key.key( - wrong_witness.key_item.clone(), - key_data.rlc, - key_data.mult, - r, - ); - } else { - (key_rlc_wrong, _) = wrong_witness.key.key( - wrong_witness.key_item.clone(), - key_data_prev.rlc, - key_data_prev.mult, - r, - ); - } - + let (key_rlc_wrong, _) = wrong_witness.key.key( + wrong_witness.key_item.clone(), + key_data.rlc, + key_data.mult, + r, + ); let is_key_equal_witness = self.is_key_equal.assign( region, offset, @@ -1318,7 +1306,6 @@ impl WrongLeafGadget { /// Handles wrong extension nodes #[derive(Clone, Debug, Default)] pub struct WrongExtNodeGadget { - wrong_rlp_key: ListKeyGadget, is_key_equal: IsEqualGadget, } @@ -1346,7 +1333,7 @@ impl WrongExtNodeGadget { // tell us about the parity of the second part (depends on the third part as well). let data0 = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles.clone()]; - let mut rlc = key_data_prev.rlc.expr() + let after_middle_rlc = key_data_prev.rlc.expr() + ext_key_rlc_expr( cb, wrong_ext_middle.clone(), @@ -1373,7 +1360,7 @@ impl WrongExtNodeGadget { let third_part_is_odd = after_two_parts_is_odd.clone(); let data1 = [wrong_ext_after.clone(), wrong_ext_after_nibbles.clone()]; - rlc = rlc + let rlc = after_middle_rlc.clone() + ext_key_rlc_expr( cb, wrong_ext_after.clone(), @@ -1390,60 +1377,50 @@ impl WrongExtNodeGadget { ); require!(rlc => expected_key); + + // Make sure the "after_middle" RLC of the wrong extension node and of + // the "after_middle" enquired key/address are different. + config.is_key_equal = IsEqualGadget::construct( + &mut cb.base, + key_data.rlc.expr(), + after_middle_rlc.expr(), + ); + require!(config.is_key_equal.expr() => false); }} config }) } - #[allow(clippy::too_many_arguments)] pub(crate) fn assign( &self, region: &mut CachedRegion<'_, '_, F>, offset: usize, - is_non_existing: bool, - key_rlc: &[F], - list_bytes: &[u8], - expected_item: &RLPItemWitness, - for_placeholder_s: bool, - is_parent_extension: bool, + wrong_ext_middle: RLPItemWitness, + wrong_ext_middle_nibbles: RLPItemWitness, key_data: KeyDataWitness, key_data_prev: KeyDataWitness, - r: F, - ) -> Result<(F, F), Error> { - if is_non_existing { - let wrong_witness = - self.wrong_rlp_key - .assign(region, offset, list_bytes, expected_item)?; - let key_rlc_wrong: F; - if !is_parent_extension { - (key_rlc_wrong, _) = wrong_witness.key.key( - wrong_witness.key_item.clone(), - key_data.rlc, - key_data.mult, - r, - ); - } else { - (key_rlc_wrong, _) = wrong_witness.key.key( - wrong_witness.key_item.clone(), - key_data_prev.rlc, - key_data_prev.mult, - r, - ); - } - - let is_key_equal_witness = self.is_key_equal.assign( - region, - offset, - key_rlc[for_placeholder_s.idx()], - key_rlc_wrong, - )?; + ) { + let items = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles]; + let (after_middle_rlc, _) = ext_key_rlc_calc_value( + wrong_ext_middle, + key_data_prev.mult, + key_data.is_odd, + key_data_prev.is_odd, + items + .iter() + .map(|item| item.bytes.clone()) + .collect::>() + .try_into() + .unwrap(), + region.key_r, + ); - // When key is not equal, we have a non existing account - Ok((key_rlc_wrong, is_key_equal_witness.neg())) - } else { - // existing account - Ok((key_rlc[for_placeholder_s.idx()], false.scalar())) - } + let _ = self.is_key_equal.assign( + region, + offset, + key_data.rlc, + after_middle_rlc, + ); } } diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index c48c2192e3..3d4eb3e771 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -48,7 +48,7 @@ pub(crate) struct StorageLeafConfig { is_not_hashed: [LtGadget; 2], is_placeholder_leaf: [IsPlaceholderLeafGadget; 2], drifted: DriftedGadget, - wrong: WrongLeafGadget, + wrong_leaf: WrongLeafGadget, is_storage_mod_proof: IsEqualGadget, is_non_existing_storage_proof: IsEqualGadget, is_mod_extension: [Cell; 2], @@ -287,7 +287,7 @@ impl StorageLeafConfig { ); // Wrong leaf / extension node handling - config.wrong = WrongLeafGadget::construct( + config.wrong_leaf = WrongLeafGadget::construct( cb, key_item.hash_rlc(), config.is_non_existing_storage_proof.expr(), @@ -563,7 +563,7 @@ impl StorageLeafConfig { &mut memory[key_memory(false)], 2, // 2 instead of 1 because default values have already been stored above )?; - let (_key_rlc, _) = self.wrong.assign( + let (_key_rlc, _) = self.wrong_leaf.assign( region, offset, is_non_existing_proof, @@ -573,7 +573,6 @@ impl StorageLeafConfig { false, parent_data[1].is_extension, key_data[true.idx()].clone(), - key_data_prev, region.key_r, )?; From 9817e1dcc3c0a6556931bd1527cfe56c3cf9ca2e Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Mon, 1 Apr 2024 12:39:53 +0200 Subject: [PATCH 26/43] Adding info whether ext. node is in the last level --- geth-utils/gethutil/mpt/witness/branch.go | 13 +++++------ geth-utils/gethutil/mpt/witness/nodes.go | 1 + .../gethutil/mpt/witness/prepare_witness.go | 9 ++++---- .../src/mpt_circuit/account_leaf.rs | 3 ++- .../src/mpt_circuit/extension_branch.rs | 9 ++++++++ zkevm-circuits/src/mpt_circuit/helpers.rs | 22 +++++++++++++++---- zkevm-circuits/src/mpt_circuit/start.rs | 2 ++ .../src/mpt_circuit/storage_leaf.rs | 3 ++- 8 files changed, 44 insertions(+), 18 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 52e4bbd8e4..5682dd957b 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -66,7 +66,7 @@ func prepareBranchWitness(rows [][]byte, branch []byte, branchStart int, branchR } func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []byte, extValues [][]byte, key, driftedInd byte, - isBranchSPlaceholder, isBranchCPlaceholder, isExtension bool) Node { + isBranchSPlaceholder, isBranchCPlaceholder, isExtension, isLastLevel bool) Node { extensionNode := ExtensionNode{ ListRlpBytes: extListRlpBytes, } @@ -115,6 +115,7 @@ func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []b extensionBranch := ExtensionBranchNode{ IsExtension: isExtension, IsPlaceholder: [2]bool{isBranchSPlaceholder, isBranchCPlaceholder}, + IsLastLevel: isLastLevel, Extension: extensionNode, Branch: branchNode, } @@ -206,10 +207,8 @@ func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { // (used when one of the proofs have one branch more than the other). func addBranchAndPlaceholder(proof1, proof2 [][]byte, extNibblesS, extNibblesC []byte, - leafRow0, key, neighbourNode []byte, - keyIndex int, - additionalBranch, isAccountProof, nonExistingAccountProof, - isShorterProofLastLeaf bool) (bool, bool, int, Node) { + leafRow0, key []byte, + keyIndex int, isShorterProofLastLeaf bool) (bool, bool, int, Node) { len1 := len(proof1) len2 := len(proof2) @@ -284,7 +283,7 @@ func addBranchAndPlaceholder(proof1, proof2 [][]byte, driftedInd := getDriftedPosition(leafRow0, numberOfNibbles) node = prepareBranchNode(proof1[len1-2], proof1[len1-2], extNode, extNode, extListRlpBytes, extValues, - key[keyIndex+numberOfNibbles], driftedInd, false, true, isExtension) + key[keyIndex+numberOfNibbles], driftedInd, false, true, isExtension, true) // We now get the first nibble of the leaf that was turned into branch. // This first nibble presents the position of the leaf once it moved @@ -296,7 +295,7 @@ func addBranchAndPlaceholder(proof1, proof2 [][]byte, driftedInd := getDriftedPosition(leafRow0, numberOfNibbles) node = prepareBranchNode(proof2[len2-2], proof2[len2-2], extNode, extNode, extListRlpBytes, extValues, - key[keyIndex+numberOfNibbles], driftedInd, true, false, isExtension) + key[keyIndex+numberOfNibbles], driftedInd, true, false, isExtension, true) } return isModifiedExtNode, isExtension, numberOfNibbles, node diff --git a/geth-utils/gethutil/mpt/witness/nodes.go b/geth-utils/gethutil/mpt/witness/nodes.go index 74a0f9d395..8f65b8b408 100644 --- a/geth-utils/gethutil/mpt/witness/nodes.go +++ b/geth-utils/gethutil/mpt/witness/nodes.go @@ -70,6 +70,7 @@ type ExtensionBranchNode struct { // nibbles of the original extension node). IsModExtension [2]bool `json:"is_mod_extension"` IsPlaceholder [2]bool `json:"is_placeholder"` + IsLastLevel bool `json:"is_last_level"` Extension ExtensionNode `json:"extension"` Branch BranchNode `json:"branch"` } diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 0d7f9a7eb0..4ddc43e756 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -412,7 +412,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } bNode := prepareBranchNode(proof1[i], proof2[i], extNode1, extNode2, extListRlpBytes, extValues, - key[keyIndex], key[keyIndex], false, false, isExtension) + key[keyIndex], key[keyIndex], false, false, isExtension, false) nodes = append(nodes, bNode) keyIndex += 1 @@ -430,9 +430,8 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] isModifiedExtNode, _, numberOfNibbles, bNode := addBranchAndPlaceholder(proof1, proof2, extNibblesS[len1-1], extNibblesC[len2-1], - leafRow0, key, neighbourNode, - keyIndex, additionalBranch, - isAccountProof, nonExistingAccountProof, isShorterProofLastLeaf) + leafRow0, key, + keyIndex, isShorterProofLastLeaf) nodes = append(nodes, bNode) @@ -531,7 +530,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] extNode := proof2[len(proof2)-1] // Let's name it E1 bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, - key[keyIndex], key[keyIndex], false, false, isExtension) + key[keyIndex], key[keyIndex], false, false, isExtension, true) nodes = append(nodes, bNode) // Let's construct the leaf L1 that will have the correct key (the queried one) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index a50c3b5247..3332831fde 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -339,6 +339,7 @@ impl AccountLeafConfig { true.expr(), false.expr(), false.expr(), + false.expr(), storage_items[is_s.idx()].word(), ); } @@ -671,6 +672,7 @@ impl AccountLeafConfig { true, false, false, + false, storage_items[is_s.idx()].word(), )?; } @@ -740,7 +742,6 @@ impl AccountLeafConfig { &account.wrong_rlp_bytes, &expected_item, true, - parent_data[1].is_extension, key_data[true.idx()].clone(), region.key_r, )?; diff --git a/zkevm-circuits/src/mpt_circuit/extension_branch.rs b/zkevm-circuits/src/mpt_circuit/extension_branch.rs index 59d53ce4e3..e3d162c99d 100644 --- a/zkevm-circuits/src/mpt_circuit/extension_branch.rs +++ b/zkevm-circuits/src/mpt_circuit/extension_branch.rs @@ -26,6 +26,7 @@ pub(crate) struct ExtensionBranchConfig { parent_data: [ParentData; 2], is_placeholder: [Cell; 2], is_extension: Cell, + is_last_level: Cell, extension: ExtensionGadget, branch: BranchGadget, } @@ -41,6 +42,7 @@ impl ExtensionBranchConfig { circuit!([meta, cb], { // General inputs config.is_extension = cb.query_bool(); + config.is_last_level = cb.query_bool(); // If we're in a placeholder, both the extension and the branch parts are // placeholders for is_s in [true, false] { @@ -159,6 +161,7 @@ impl ExtensionBranchConfig { false.expr(), false.expr(), config.is_extension.expr(), + config.is_last_level.expr(), WordLoHi::zero(), ); } elsex { @@ -186,6 +189,7 @@ impl ExtensionBranchConfig { config.parent_data[is_s.idx()].is_root.expr(), true.expr(), config.is_extension.expr(), + config.is_last_level.expr(), branch.mod_word[is_s.idx()].clone(), ); }} @@ -210,6 +214,9 @@ impl ExtensionBranchConfig { let is_extension = extension_branch.is_extension.scalar(); self.is_extension.assign(region, offset, is_extension)?; + let is_last_level = extension_branch.is_last_level.scalar(); + self.is_last_level.assign(region, offset, is_last_level)?; + let key_data = self.key_data .witness_load(region, offset, &mut memory[key_memory(true)], 0)?; @@ -294,6 +301,7 @@ impl ExtensionBranchConfig { false, false, is_extension == 1.into(), + is_last_level == 1.into(), WordLoHi::zero(), )?; } else { @@ -317,6 +325,7 @@ impl ExtensionBranchConfig { parent_data[is_s.idx()].is_root, true, is_extension == 1.into(), + is_last_level == 1.into(), mod_node_hash_word[is_s.idx()], )?; } diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 41dd30fa39..90f3ec85a0 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -558,7 +558,13 @@ pub(crate) struct ParentData { pub(crate) rlc: Cell, pub(crate) is_root: Cell, pub(crate) is_placeholder: Cell, + // is_extension is used only in a non-existing proof / wrong extension node case - + // in account/storage leaf to check whether the parent is an extension node pub(crate) is_extension: Cell, + // is_ext_last_level is used only in a non-existing proof - in wrong extension node case the branch + // is a placeholder and the check for a branch hash being in the parent extension node needs to be ignored, + // but it needs to be ignored only in the last branch (the branch above the leaf into which the lookup is made) + pub(crate) is_ext_last_level: Cell, pub(crate) drifted_parent_hash: WordLoHiCell, } @@ -569,6 +575,7 @@ pub(crate) struct ParentDataWitness { pub(crate) is_root: bool, pub(crate) is_placeholder: bool, pub(crate) is_extension: bool, + pub(crate) is_ext_last_level: bool, pub(crate) drifted_parent_hash: WordLoHi, } @@ -584,6 +591,7 @@ impl ParentData { is_root: cb.query_cell(), is_placeholder: cb.query_cell(), is_extension: cb.query_cell(), + is_ext_last_level: cb.query_cell(), drifted_parent_hash: cb.query_word_unchecked(), }; circuit!([meta, cb.base], { @@ -597,6 +605,7 @@ impl ParentData { parent_data.is_root.expr(), parent_data.is_placeholder.expr(), parent_data.is_extension.expr(), + parent_data.is_ext_last_level.expr(), parent_data.drifted_parent_hash.lo().expr(), parent_data.drifted_parent_hash.hi().expr(), ], @@ -613,6 +622,7 @@ impl ParentData { is_root: Expression, is_placeholder: Expression, is_extension: Expression, + is_ext_last_level: Expression, drifted_parent_hash: WordLoHi>, ) { memory.store( @@ -624,6 +634,7 @@ impl ParentData { is_root, is_placeholder, is_extension, + is_ext_last_level, drifted_parent_hash.lo(), drifted_parent_hash.hi(), ], @@ -640,6 +651,7 @@ impl ParentData { force_hashed: bool, is_placeholder: bool, is_extension: bool, + is_ext_last_level: bool, drifted_parent_hash: WordLoHi, ) -> Result<(), Error> { memory.witness_store( @@ -651,6 +663,7 @@ impl ParentData { force_hashed.scalar(), is_placeholder.scalar(), is_extension.scalar(), + is_ext_last_level.scalar(), drifted_parent_hash.lo(), drifted_parent_hash.hi(), ], @@ -673,12 +686,13 @@ impl ParentData { self.is_root.assign(region, offset, values[3])?; self.is_placeholder.assign(region, offset, values[4])?; self.is_extension.assign(region, offset, values[5])?; + self.is_ext_last_level.assign(region, offset, values[6])?; self.drifted_parent_hash .lo() - .assign(region, offset, values[6])?; + .assign(region, offset, values[7])?; self.drifted_parent_hash .hi() - .assign(region, offset, values[7])?; + .assign(region, offset, values[8])?; Ok(ParentDataWitness { hash: WordLoHi::new([values[0], values[1]]), @@ -686,7 +700,8 @@ impl ParentData { is_root: values[3] == 1.scalar(), is_placeholder: values[4] == 1.scalar(), is_extension: values[5] == 1.scalar(), - drifted_parent_hash: WordLoHi::new([values[6], values[7]]), + is_ext_last_level: values[6] == 1.scalar(), + drifted_parent_hash: WordLoHi::new([values[7], values[8]]), }) } } @@ -1273,7 +1288,6 @@ impl WrongLeafGadget { list_bytes: &[u8], expected_item: &RLPItemWitness, for_placeholder_s: bool, - is_parent_extension: bool, key_data: KeyDataWitness, r: F, ) -> Result<(F, F), Error> { diff --git a/zkevm-circuits/src/mpt_circuit/start.rs b/zkevm-circuits/src/mpt_circuit/start.rs index 3e332a158d..ef944b960c 100644 --- a/zkevm-circuits/src/mpt_circuit/start.rs +++ b/zkevm-circuits/src/mpt_circuit/start.rs @@ -68,6 +68,7 @@ impl StartConfig { true.expr(), false.expr(), false.expr(), + false.expr(), root[is_s.idx()].clone(), ); KeyData::store_defaults(cb, &mut ctx.memory[key_memory(is_s)]); @@ -123,6 +124,7 @@ impl StartConfig { true, false, false, + false, root[is_s.idx()], )?; KeyData::witness_store( diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 3d4eb3e771..852d962ef8 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -254,6 +254,7 @@ impl StorageLeafConfig { true.expr(), false.expr(), false.expr(), + false.expr(), WordLoHi::zero(), ); } @@ -523,6 +524,7 @@ impl StorageLeafConfig { true, false, false, + false, WordLoHi::::new([F::ZERO, F::ZERO]), )?; @@ -571,7 +573,6 @@ impl StorageLeafConfig { &storage.wrong_rlp_bytes, &expected_item, false, - parent_data[1].is_extension, key_data[true.idx()].clone(), region.key_r, )?; From 91325b9794905b703890c232f2d0b8cc380bd762 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 2 Apr 2024 12:24:03 +0200 Subject: [PATCH 27/43] branching for non-existing proof --- geth-utils/gethutil/mpt/witness/branch.go | 6 ++--- geth-utils/gethutil/mpt/witness/nodes.go | 2 +- .../src/mpt_circuit/account_leaf.rs | 19 +++++++++++++-- .../src/mpt_circuit/extension_branch.rs | 23 +++++++++++-------- zkevm-circuits/src/mpt_circuit/helpers.rs | 15 ++++++------ zkevm-circuits/src/mpt_circuit/witness_row.rs | 2 ++ 6 files changed, 45 insertions(+), 22 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 5682dd957b..2d3b93343d 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -115,7 +115,7 @@ func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []b extensionBranch := ExtensionBranchNode{ IsExtension: isExtension, IsPlaceholder: [2]bool{isBranchSPlaceholder, isBranchCPlaceholder}, - IsLastLevel: isLastLevel, + IsLastLevelAndWrongExtCase: isLastLevel, Extension: extensionNode, Branch: branchNode, } @@ -283,7 +283,7 @@ func addBranchAndPlaceholder(proof1, proof2 [][]byte, driftedInd := getDriftedPosition(leafRow0, numberOfNibbles) node = prepareBranchNode(proof1[len1-2], proof1[len1-2], extNode, extNode, extListRlpBytes, extValues, - key[keyIndex+numberOfNibbles], driftedInd, false, true, isExtension, true) + key[keyIndex+numberOfNibbles], driftedInd, false, true, isExtension, false) // We now get the first nibble of the leaf that was turned into branch. // This first nibble presents the position of the leaf once it moved @@ -295,7 +295,7 @@ func addBranchAndPlaceholder(proof1, proof2 [][]byte, driftedInd := getDriftedPosition(leafRow0, numberOfNibbles) node = prepareBranchNode(proof2[len2-2], proof2[len2-2], extNode, extNode, extListRlpBytes, extValues, - key[keyIndex+numberOfNibbles], driftedInd, true, false, isExtension, true) + key[keyIndex+numberOfNibbles], driftedInd, true, false, isExtension, false) } return isModifiedExtNode, isExtension, numberOfNibbles, node diff --git a/geth-utils/gethutil/mpt/witness/nodes.go b/geth-utils/gethutil/mpt/witness/nodes.go index 8f65b8b408..4896ba7d89 100644 --- a/geth-utils/gethutil/mpt/witness/nodes.go +++ b/geth-utils/gethutil/mpt/witness/nodes.go @@ -70,7 +70,7 @@ type ExtensionBranchNode struct { // nibbles of the original extension node). IsModExtension [2]bool `json:"is_mod_extension"` IsPlaceholder [2]bool `json:"is_placeholder"` - IsLastLevel bool `json:"is_last_level"` + IsLastLevelAndWrongExtCase bool `json:"is_last_level_and_wrong_ext_case"` Extension ExtensionNode `json:"extension"` Branch BranchNode `json:"branch"` } diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 3332831fde..95063dfeb2 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -6,7 +6,7 @@ use halo2_proofs::{ }; use super::{ - helpers::{ext_key_rlc_calc_value, KeyDataWitness, ListKeyGadget, MainData, ParentDataWitness}, + helpers::{KeyDataWitness, ListKeyGadget, MainData, ParentDataWitness}, mod_extension::ModExtensionGadget, rlp_gadgets::RLPItemWitness, witness_row::{AccountRowType, Node}, @@ -22,7 +22,7 @@ use crate::{ evm_circuit::util::from_bytes, mpt_circuit::{ helpers::{ - ext_key_rlc_expr, key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongExtNodeGadget, WrongLeafGadget, KECCAK + key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongExtNodeGadget, WrongLeafGadget, KECCAK }, param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES, RLP_LIST_LONG, RLP_LONG}, MPTConfig, MPTContext, MptMemory, RlpItemType, @@ -392,6 +392,21 @@ impl AccountLeafConfig { let wrong_ext_after_nibbles = ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeNibbles as usize, RlpItemType::Nibbles); + // The extension_branch in the last level needs has `is_last_level_and_wrong_ext_case = true` + // in the case of wrong extension node. + // All other extension_branches (above it) need to have it `false` (constraint in + // extension_branch.rs) + // TODO: Use is_last_level_and_wrong_ext_case as a flag for one of the three cases + // require!(config.parent_data[1].is_last_level_and_wrong_ext_case.expr() => true.expr()); + // TODO: use C proof everywhere for non-existing proof. + + // TODO: when non-existing-proof, it needs to be one of the following cases: + // wrong leaf, wrong extension node, nil leaf - we need to check the sum of these + // three cases is 1. + // To check whether it's the wrong leaf case - parent is not extension, leaf is not placeholder + // To check whether it's wrong extension node - is_last_level_and_wrong_ext_case = 1, parent is extension + // To check whether it's the nil leaf - use IsPlaceholderLeafGadget + config.wrong_ext_node = WrongExtNodeGadget::construct( cb, key_item.hash_rlc(), diff --git a/zkevm-circuits/src/mpt_circuit/extension_branch.rs b/zkevm-circuits/src/mpt_circuit/extension_branch.rs index e3d162c99d..28b1f99ae8 100644 --- a/zkevm-circuits/src/mpt_circuit/extension_branch.rs +++ b/zkevm-circuits/src/mpt_circuit/extension_branch.rs @@ -26,7 +26,7 @@ pub(crate) struct ExtensionBranchConfig { parent_data: [ParentData; 2], is_placeholder: [Cell; 2], is_extension: Cell, - is_last_level: Cell, + is_last_level_and_wrong_ext_case: Cell, extension: ExtensionGadget, branch: BranchGadget, } @@ -42,7 +42,7 @@ impl ExtensionBranchConfig { circuit!([meta, cb], { // General inputs config.is_extension = cb.query_bool(); - config.is_last_level = cb.query_bool(); + config.is_last_level_and_wrong_ext_case = cb.query_bool(); // If we're in a placeholder, both the extension and the branch parts are // placeholders for is_s in [true, false] { @@ -140,6 +140,11 @@ impl ExtensionBranchConfig { // Set the new keys for is_s in [true, false] { + // The extension_branch in the last level needs to have `is_ext_last_level = true` (checked + // in account_leaf.rs / storage_leaf.rs). + // All other extension_branches need to have it `false`: + require!(config.parent_data[is_s.idx()].is_last_level_and_wrong_ext_case.expr() => false.expr()); + ifx! {not!(config.is_placeholder[is_s.idx()].expr()) => { KeyData::store( cb, @@ -161,7 +166,7 @@ impl ExtensionBranchConfig { false.expr(), false.expr(), config.is_extension.expr(), - config.is_last_level.expr(), + config.is_last_level_and_wrong_ext_case.expr(), WordLoHi::zero(), ); } elsex { @@ -189,9 +194,9 @@ impl ExtensionBranchConfig { config.parent_data[is_s.idx()].is_root.expr(), true.expr(), config.is_extension.expr(), - config.is_last_level.expr(), + config.is_last_level_and_wrong_ext_case.expr(), branch.mod_word[is_s.idx()].clone(), - ); + ); }} } }); @@ -214,8 +219,8 @@ impl ExtensionBranchConfig { let is_extension = extension_branch.is_extension.scalar(); self.is_extension.assign(region, offset, is_extension)?; - let is_last_level = extension_branch.is_last_level.scalar(); - self.is_last_level.assign(region, offset, is_last_level)?; + let is_last_level_and_wrong_ext_case = extension_branch.is_last_level_and_wrong_ext_case.scalar(); + self.is_last_level_and_wrong_ext_case.assign(region, offset, is_last_level_and_wrong_ext_case)?; let key_data = self.key_data @@ -301,7 +306,7 @@ impl ExtensionBranchConfig { false, false, is_extension == 1.into(), - is_last_level == 1.into(), + is_last_level_and_wrong_ext_case == 1.into(), WordLoHi::zero(), )?; } else { @@ -325,7 +330,7 @@ impl ExtensionBranchConfig { parent_data[is_s.idx()].is_root, true, is_extension == 1.into(), - is_last_level == 1.into(), + is_last_level_and_wrong_ext_case == 1.into(), mod_node_hash_word[is_s.idx()], )?; } diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 90f3ec85a0..b514106e92 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -561,10 +561,11 @@ pub(crate) struct ParentData { // is_extension is used only in a non-existing proof / wrong extension node case - // in account/storage leaf to check whether the parent is an extension node pub(crate) is_extension: Cell, - // is_ext_last_level is used only in a non-existing proof - in wrong extension node case the branch - // is a placeholder and the check for a branch hash being in the parent extension node needs to be ignored, - // but it needs to be ignored only in the last branch (the branch above the leaf into which the lookup is made) - pub(crate) is_ext_last_level: Cell, + // is_last_level_and_wrong_ext_case is used only in a non-existing proof in wrong extension node case - + // the last branch is a placeholder in this case and the check for a branch hash being in the parent + // extension node needs to be ignored, but it needs to be ignored only in the last branch + // (the branch above the leaf into which the lookup is made) + pub(crate) is_last_level_and_wrong_ext_case: Cell, pub(crate) drifted_parent_hash: WordLoHiCell, } @@ -591,7 +592,7 @@ impl ParentData { is_root: cb.query_cell(), is_placeholder: cb.query_cell(), is_extension: cb.query_cell(), - is_ext_last_level: cb.query_cell(), + is_last_level_and_wrong_ext_case: cb.query_cell(), drifted_parent_hash: cb.query_word_unchecked(), }; circuit!([meta, cb.base], { @@ -605,7 +606,7 @@ impl ParentData { parent_data.is_root.expr(), parent_data.is_placeholder.expr(), parent_data.is_extension.expr(), - parent_data.is_ext_last_level.expr(), + parent_data.is_last_level_and_wrong_ext_case.expr(), parent_data.drifted_parent_hash.lo().expr(), parent_data.drifted_parent_hash.hi().expr(), ], @@ -686,7 +687,7 @@ impl ParentData { self.is_root.assign(region, offset, values[3])?; self.is_placeholder.assign(region, offset, values[4])?; self.is_extension.assign(region, offset, values[5])?; - self.is_ext_last_level.assign(region, offset, values[6])?; + self.is_last_level_and_wrong_ext_case.assign(region, offset, values[6])?; self.drifted_parent_hash .lo() .assign(region, offset, values[7])?; diff --git a/zkevm-circuits/src/mpt_circuit/witness_row.rs b/zkevm-circuits/src/mpt_circuit/witness_row.rs index 9ce6c47f52..bd6c5963f1 100644 --- a/zkevm-circuits/src/mpt_circuit/witness_row.rs +++ b/zkevm-circuits/src/mpt_circuit/witness_row.rs @@ -138,6 +138,8 @@ pub struct ExtensionBranchNode { /// TODO Doc. pub is_extension: bool, /// TODO Doc. + pub is_last_level_and_wrong_ext_case: bool, + /// TODO Doc. pub(crate) is_mod_extension: [bool; 2], /// TODO Doc. pub is_placeholder: [bool; 2], From 133d8b23d69b23f00ae251a5fe85c4b0d0e38d9f Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 9 Apr 2024 12:07:27 +0200 Subject: [PATCH 28/43] Wrong extension node case - constraints that don't apply ignored --- .../src/mpt_circuit/account_leaf.rs | 21 +++++++++++++------ zkevm-circuits/src/mpt_circuit/branch.rs | 3 ++- .../src/mpt_circuit/extension_branch.rs | 1 + zkevm-circuits/src/mpt_circuit/helpers.rs | 7 ++----- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 95063dfeb2..4b518911b5 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -205,6 +205,8 @@ impl AccountLeafConfig { MPTProofType::CodeHashChanged.expr(), ); + let is_wrong_ext_case = parent_data[1].is_last_level_and_wrong_ext_case.expr(); + for is_s in [true, false] { ifx! {not!(config.is_mod_extension[is_s.idx()].expr()) => { // Placeholder leaf checks @@ -273,7 +275,9 @@ impl AccountLeafConfig { // Total number of nibbles needs to be KEY_LEN_IN_NIBBLES. let num_nibbles = num_nibbles::expr(rlp_key.key_value.len(), key_data[is_s.idx()].is_odd.expr()); - require!(key_data[is_s.idx()].num_nibbles.expr() + num_nibbles.expr() => KEY_LEN_IN_NIBBLES); + ifx! {not!(is_wrong_ext_case) => { + require!(key_data[is_s.idx()].num_nibbles.expr() + num_nibbles.expr() => KEY_LEN_IN_NIBBLES); + }} // Check if the leaf is in its parent. // Check is skipped for placeholder leaves which are dummy leaves. @@ -282,7 +286,8 @@ impl AccountLeafConfig { // Note that the constraint works for the case when there is the placeholder branch above // the leaf too - in this case `parent_data.hash` contains the hash of the node above the placeholder // branch. - ifx! {not!(config.is_placeholder_leaf[is_s.idx()]) => { + ifx! {not!(or::expr(&[config.is_placeholder_leaf[is_s.idx()].expr(), is_wrong_ext_case.clone()])) => { + // ifx! {not!(config.is_placeholder_leaf[is_s.idx()]) => { let hash = parent_data[is_s.idx()].hash.expr(); require!((1.expr(), leaf_rlc, rlp_key.rlp_list.num_bytes(), hash.lo(), hash.hi()) =>> @KECCAK); } elsex { @@ -305,7 +310,9 @@ impl AccountLeafConfig { // Note that this does not hold when there is NonExistingAccountProof wrong leaf scenario, // in this case there is a non-nil leaf. However, in this case the leaf is not a placeholder, // so the check below is not triggered. - require!(parent_data[is_s.idx()].rlc.expr() => 128.expr()); + ifx! {not!(is_wrong_ext_case) => { + require!(parent_data[is_s.idx()].rlc.expr() => 128.expr()); + }} }} }} }} @@ -407,18 +414,20 @@ impl AccountLeafConfig { // To check whether it's wrong extension node - is_last_level_and_wrong_ext_case = 1, parent is extension // To check whether it's the nil leaf - use IsPlaceholderLeafGadget + // TODO: when is_last_level_and_wrong_ext_case, the proof type needs to be non-existing + // config.is_non_existing_account_proof.expr(), + // config.parent_data[true.idx()].is_extension.expr(), + config.wrong_ext_node = WrongExtNodeGadget::construct( cb, key_item.hash_rlc(), - config.is_non_existing_account_proof.expr(), + is_wrong_ext_case, &wrong_ext_middle, &wrong_ext_middle_nibbles, &wrong_ext_after, &wrong_ext_after_nibbles, - config.parent_data[true.idx()].is_extension.expr(), config.key_data[true.idx()].clone(), config.key_data_prev.clone(), - &cb.key_r.expr(), ); // Anything following this node is below the account diff --git a/zkevm-circuits/src/mpt_circuit/branch.rs b/zkevm-circuits/src/mpt_circuit/branch.rs index 56ba3e8312..8f36d7eb4a 100644 --- a/zkevm-circuits/src/mpt_circuit/branch.rs +++ b/zkevm-circuits/src/mpt_circuit/branch.rs @@ -64,6 +64,7 @@ impl BranchGadget { key_mult: Expression, num_nibbles: Expression, is_key_odd: Expression, + is_last_level_and_wrong_ext_case: Expression, ) -> Self { let mut config = BranchGadget::default(); @@ -193,7 +194,7 @@ impl BranchGadget { ) }; - ifx! {not!(is_placeholder[is_s.idx()]) => { + ifx! {not!(or::expr(&[is_placeholder[is_s.idx()].expr(), is_last_level_and_wrong_ext_case.clone()])) => { ifx!{or::expr(&[is_root[is_s.idx()].expr(), not!(is_not_hashed)]) => { // Hashed branch hash in parent branch let hash = &parent_hash[is_s.idx()]; diff --git a/zkevm-circuits/src/mpt_circuit/extension_branch.rs b/zkevm-circuits/src/mpt_circuit/extension_branch.rs index 28b1f99ae8..174d0cfe80 100644 --- a/zkevm-circuits/src/mpt_circuit/extension_branch.rs +++ b/zkevm-circuits/src/mpt_circuit/extension_branch.rs @@ -135,6 +135,7 @@ impl ExtensionBranchConfig { key_mult_post_ext.expr(), num_nibbles.expr(), is_key_odd.expr(), + config.is_last_level_and_wrong_ext_case.expr(), ); let branch = config.branch.get_post_state(); diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index b514106e92..d8abcae403 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1329,20 +1329,17 @@ impl WrongExtNodeGadget { pub(crate) fn construct( cb: &mut MPTConstraintBuilder, expected_key: Expression, - is_non_existing: Expression, + is_wrong_ext_case: Expression, wrong_ext_middle: &RLPItemView, wrong_ext_middle_nibbles: &RLPItemView, wrong_ext_after: &RLPItemView, wrong_ext_after_nibbles: &RLPItemView, - is_parent_extension: Expression, key_data: KeyData, key_data_prev: KeyData, - r: &Expression, ) -> Self { let mut config = WrongExtNodeGadget::default(); circuit!([meta, cb.base], { - // TODO: distinguish between wrong extension node / wrong leaf / nil leaf - ifx! {and::expr(&[is_non_existing, is_parent_extension]) => { + ifx! {is_wrong_ext_case => { // We have a key split into three parts, // meaning that there the first part parity doesn't // tell us about the parity of the second part (depends on the third part as well). From 89c3bbb93e2c86a2821680758044fe570a25f3d5 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 10 Apr 2024 12:11:37 +0200 Subject: [PATCH 29/43] Wrong extension node: selector constraints; wrong extension node gadget added to storage leaf --- .../gethutil/mpt/witness/prepare_witness.go | 8 +- zkevm-circuits/src/mpt_circuit.rs | 3 +- .../src/mpt_circuit/account_leaf.rs | 45 +++++----- zkevm-circuits/src/mpt_circuit/helpers.rs | 8 +- .../src/mpt_circuit/storage_leaf.rs | 87 +++++++++++++++---- 5 files changed, 98 insertions(+), 53 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 4ddc43e756..83474eb4fe 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -533,29 +533,23 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] key[keyIndex], key[keyIndex], false, false, isExtension, true) nodes = append(nodes, bNode) - // Let's construct the leaf L1 that will have the correct key (the queried one) if isAccountProof { dummyLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) - node = equipLeafWithWrongExtension(node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) - nodes = append(nodes, node) } else { - // The remaining `key` nibbles are to be stored in the constructed leaf - in our example [1 2 4 ...] compact := trie.HexToCompact(key[start:]) // Add RLP: compactLen := byte(len(compact)) rlp2 := 128 + compactLen rlp1 := 192 + compactLen + 1 - // Constructed leaf L1: dummyLeaf := append([]byte{rlp1, rlp2}, compact...) - // Add dummy value: dummyLeaf = append(dummyLeaf, 0) - node := prepareStorageLeafNode(dummyLeaf, dummyLeaf, dummyLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + node = equipLeafWithWrongExtension(node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) nodes = append(nodes, node) } } diff --git a/zkevm-circuits/src/mpt_circuit.rs b/zkevm-circuits/src/mpt_circuit.rs index 73586f5ede..f6472d6ce3 100644 --- a/zkevm-circuits/src/mpt_circuit.rs +++ b/zkevm-circuits/src/mpt_circuit.rs @@ -253,7 +253,7 @@ impl MPTConfig { let mut state_cm = CellManager::new(50, 0); state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase1, 0, false, 20); - state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase2, 1, false, 7); + state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase2, 1, false, 8); state_cm.add_columns(meta, &mut cb.base, MptCellType::StoragePhase3, 2, false, 5); state_cm.add_columns(meta, &mut cb.base, lu(MptTableType::Byte), 0, false, 4); state_cm.add_columns(meta, &mut cb.base, lu(MptTableType::Fixed), 2, false, 3); @@ -771,7 +771,6 @@ mod tests { #[test] fn test_mpt() { let path = "src/mpt_circuit/tests"; - let files = fs::read_dir(path).unwrap(); files .filter_map(Result::ok) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 4b518911b5..c5fec451a2 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -287,7 +287,6 @@ impl AccountLeafConfig { // the leaf too - in this case `parent_data.hash` contains the hash of the node above the placeholder // branch. ifx! {not!(or::expr(&[config.is_placeholder_leaf[is_s.idx()].expr(), is_wrong_ext_case.clone()])) => { - // ifx! {not!(config.is_placeholder_leaf[is_s.idx()]) => { let hash = parent_data[is_s.idx()].hash.expr(); require!((1.expr(), leaf_rlc, rlp_key.rlp_list.num_bytes(), hash.lo(), hash.hi()) =>> @KECCAK); } elsex { @@ -374,18 +373,30 @@ impl AccountLeafConfig { &config.is_mod_extension, &cb.key_r.expr(), ); + + let is_wrong_leaf_case = and::expr(&[config.is_non_existing_account_proof.expr(), not!(config.parent_data[1].is_extension), not!(config.is_placeholder_leaf[1].expr())]); + + // When non-existing-proof, it needs to be one of the following cases: + // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of these + // three cases is 1. + ifx! {config.is_non_existing_account_proof => { + require!(is_wrong_ext_case.clone() + is_wrong_leaf_case.clone() + config.is_placeholder_leaf[1].expr() => 1.expr()); + }} + + // When is_last_level_and_wrong_ext_case, the proof type needs to be non-existing + ifx! {is_wrong_ext_case => { + require!(config.is_non_existing_account_proof.expr() => 1.expr()); + }} // Wrong leaf handling config.wrong_leaf = WrongLeafGadget::construct( cb, key_item.hash_rlc(), - config.is_non_existing_account_proof.expr(), - &config.rlp_key[true.idx()].key_value, - &key_rlc[true.idx()], + is_wrong_leaf_case, + &config.rlp_key[1].key_value, // C proof is used for non-existing proof + &key_rlc[1], &wrong_bytes, - config.is_placeholder_leaf[true.idx()].expr(), - config.parent_data[true.idx()].is_extension.expr(), - config.key_data[true.idx()].clone(), + config.key_data[1].clone(), &cb.key_r.expr(), ); @@ -403,20 +414,6 @@ impl AccountLeafConfig { // in the case of wrong extension node. // All other extension_branches (above it) need to have it `false` (constraint in // extension_branch.rs) - // TODO: Use is_last_level_and_wrong_ext_case as a flag for one of the three cases - // require!(config.parent_data[1].is_last_level_and_wrong_ext_case.expr() => true.expr()); - // TODO: use C proof everywhere for non-existing proof. - - // TODO: when non-existing-proof, it needs to be one of the following cases: - // wrong leaf, wrong extension node, nil leaf - we need to check the sum of these - // three cases is 1. - // To check whether it's the wrong leaf case - parent is not extension, leaf is not placeholder - // To check whether it's wrong extension node - is_last_level_and_wrong_ext_case = 1, parent is extension - // To check whether it's the nil leaf - use IsPlaceholderLeafGadget - - // TODO: when is_last_level_and_wrong_ext_case, the proof type needs to be non-existing - // config.is_non_existing_account_proof.expr(), - // config.parent_data[true.idx()].is_extension.expr(), config.wrong_ext_node = WrongExtNodeGadget::construct( cb, @@ -426,7 +423,7 @@ impl AccountLeafConfig { &wrong_ext_middle_nibbles, &wrong_ext_after, &wrong_ext_after_nibbles, - config.key_data[true.idx()].clone(), + config.key_data[1].clone(), // C proof is used for non-existing proof config.key_data_prev.clone(), ); @@ -766,7 +763,7 @@ impl AccountLeafConfig { &account.wrong_rlp_bytes, &expected_item, true, - key_data[true.idx()].clone(), + key_data[1].clone(), region.key_r, )?; @@ -777,7 +774,7 @@ impl AccountLeafConfig { offset, wrong_ext_middle, wrong_ext_middle_nibbles, - key_data[true.idx()].clone(), + key_data[1].clone(), key_data_prev.clone(), ); diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index d8abcae403..6ffa1c7c14 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1241,18 +1241,16 @@ impl WrongLeafGadget { pub(crate) fn construct( cb: &mut MPTConstraintBuilder, expected_key: Expression, - is_non_existing: Expression, + is_wrong_leaf_case: Expression, key_value: &RLPItemView, key_rlc: &Expression, expected_item: &RLPItemView, - is_placeholder: Expression, - is_parent_extension: Expression, key_data: KeyData, r: &Expression, ) -> Self { let mut config = WrongLeafGadget::default(); circuit!([meta, cb.base], { - ifx! {and::expr(&[is_non_existing, not!(is_placeholder), not!(is_parent_extension)]) => { + ifx! {is_wrong_leaf_case => { config.wrong_rlp_key = ListKeyGadget::construct(cb, expected_item); let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( @@ -1341,7 +1339,7 @@ impl WrongExtNodeGadget { circuit!([meta, cb.base], { ifx! {is_wrong_ext_case => { // We have a key split into three parts, - // meaning that there the first part parity doesn't + // meaning that the first part parity doesn't // tell us about the parity of the second part (depends on the third part as well). let data0 = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles.clone()]; diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 852d962ef8..11a2dd2808 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -16,9 +16,7 @@ use crate::{ }, mpt_circuit::{ helpers::{ - key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, - IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, MainData, ParentData, - ParentDataWitness, KECCAK, + key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, MainData, ParentData, ParentDataWitness, WrongExtNodeGadget, KECCAK }, param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES}, MPTConfig, MPTContext, MptMemory, RlpItemType, @@ -49,6 +47,7 @@ pub(crate) struct StorageLeafConfig { is_placeholder_leaf: [IsPlaceholderLeafGadget; 2], drifted: DriftedGadget, wrong_leaf: WrongLeafGadget, + wrong_ext_node: WrongExtNodeGadget, is_storage_mod_proof: IsEqualGadget, is_non_existing_storage_proof: IsEqualGadget, is_mod_extension: [Cell; 2], @@ -131,6 +130,8 @@ impl StorageLeafConfig { MPTProofType::StorageDoesNotExist.expr(), ); + let is_wrong_ext_case = parent_data[1].is_last_level_and_wrong_ext_case.expr(); + for is_s in [true, false] { ifx! {not!(config.is_mod_extension[is_s.idx()].expr()) => { // Placeholder leaf checks @@ -190,7 +191,9 @@ impl StorageLeafConfig { // Total number of nibbles needs to be KEY_LEN_IN_NIBBLES let num_nibbles = num_nibbles::expr(rlp_key.key_value.len(), key_data[is_s.idx()].is_odd.expr()); - require!(key_data[is_s.idx()].num_nibbles.expr() + num_nibbles => KEY_LEN_IN_NIBBLES); + ifx! {not!(is_wrong_ext_case) => { + require!(key_data[is_s.idx()].num_nibbles.expr() + num_nibbles => KEY_LEN_IN_NIBBLES); + }} // Placeholder leaves default to value `0`. ifx! {is_placeholder_leaf => { @@ -199,14 +202,16 @@ impl StorageLeafConfig { // Make sure the RLP encoding is correct. // storage = [key, "value"] - require!(rlp_key.rlp_list.len() => key_items[is_s.idx()].num_bytes() + config.rlp_value[is_s.idx()].num_bytes()); + ifx! {not!(is_wrong_ext_case) => { + require!(rlp_key.rlp_list.len() => key_items[is_s.idx()].num_bytes() + config.rlp_value[is_s.idx()].num_bytes()); + }} // Check if the leaf is in its parent. // Check is skipped for placeholder leaves which are dummy leaves. // Note that the constraint works for the case when there is the placeholder branch above // the leaf too - in this case `parent_data.hash` contains the hash of the node above the placeholder // branch. - ifx! {not!(is_placeholder_leaf) => { + ifx! {not!(or::expr(&[config.is_placeholder_leaf[is_s.idx()].expr(), is_wrong_ext_case.clone()])) => { config.is_not_hashed[is_s.idx()] = LtGadget::construct(&mut cb.base, rlp_key.rlp_list.num_bytes(), 32.expr()); ifx!{or::expr(&[parent_data[is_s.idx()].is_root.expr(), not!(config.is_not_hashed[is_s.idx()])]) => { // Hashed leaf in parent branch @@ -236,7 +241,9 @@ impl StorageLeafConfig { // Note that this does not hold when there is NonExistingStorageProof wrong leaf scenario, // in this case there is a non-nil leaf. However, in this case the leaf is not a placeholder, // so the check below is not triggered. - require!(parent_data[is_s.idx()].rlc.expr() => 128.expr()); + ifx! {not!(is_wrong_ext_case) => { + require!(parent_data[is_s.idx()].rlc.expr() => 128.expr()); + }} }} }} @@ -287,20 +294,59 @@ impl StorageLeafConfig { &cb.key_r.expr(), ); - // Wrong leaf / extension node handling + let is_wrong_leaf_case = and::expr(&[config.is_non_existing_storage_proof.expr(), not!(config.parent_data[1].is_extension), not!(config.is_placeholder_leaf[1].expr())]); + + // When non-existing-proof, it needs to be one of the following cases: + // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of these + // three cases is 1. + ifx! {config.is_non_existing_storage_proof => { + require!(is_wrong_ext_case.clone() + is_wrong_leaf_case.clone() + config.is_placeholder_leaf[1].expr() => 1.expr()); + }} + + // When is_last_level_and_wrong_ext_case, the proof type needs to be non-existing + ifx! {is_wrong_ext_case => { + require!(config.is_non_existing_storage_proof.expr() => 1.expr()); + }} + + // Wrong leaf handling config.wrong_leaf = WrongLeafGadget::construct( cb, key_item.hash_rlc(), - config.is_non_existing_storage_proof.expr(), - &config.rlp_key[true.idx()].key_value, - &key_rlc[true.idx()], + is_wrong_leaf_case, + &config.rlp_key[1].key_value, // C proof is used for non-existing proof + &key_rlc[1], &expected_item, - config.is_placeholder_leaf[true.idx()].expr(), - config.parent_data[true.idx()].is_extension.expr(), - config.key_data[true.idx()].clone(), + config.key_data[1].clone(), &cb.key_r.expr(), ); + // Wrong extension node handling + let wrong_ext_middle = + ctx.rlp_item(meta, cb, StorageRowType::LongExtNodeKey as usize, RlpItemType::Key); + let wrong_ext_middle_nibbles = + ctx.rlp_item(meta, cb, StorageRowType::LongExtNodeNibbles as usize, RlpItemType::Nibbles); + let wrong_ext_after = + ctx.rlp_item(meta, cb, StorageRowType::ShortExtNodeKey as usize, RlpItemType::Key); + let wrong_ext_after_nibbles = + ctx.rlp_item(meta, cb, StorageRowType::ShortExtNodeNibbles as usize, RlpItemType::Nibbles); + + // The extension_branch in the last level needs has `is_last_level_and_wrong_ext_case = true` + // in the case of wrong extension node. + // All other extension_branches (above it) need to have it `false` (constraint in + // extension_branch.rs) + + config.wrong_ext_node = WrongExtNodeGadget::construct( + cb, + key_item.hash_rlc(), + is_wrong_ext_case, + &wrong_ext_middle, + &wrong_ext_middle_nibbles, + &wrong_ext_after, + &wrong_ext_after_nibbles, + config.key_data[1].clone(), // C proof should be used everywhere for non-existing proof + config.key_data_prev.clone(), + ); + // Reset the main memory // This need to be the last node for this proof MainData::store( @@ -573,10 +619,21 @@ impl StorageLeafConfig { &storage.wrong_rlp_bytes, &expected_item, false, - key_data[true.idx()].clone(), + key_data[1].clone(), region.key_r, )?; + let wrong_ext_middle = rlp_values[StorageRowType::LongExtNodeKey as usize].clone(); + let wrong_ext_middle_nibbles = rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); + self.wrong_ext_node.assign( + region, + offset, + wrong_ext_middle, + wrong_ext_middle_nibbles, + key_data[1].clone(), + key_data_prev.clone(), + ); + // Reset the main memory MainData::witness_store( region, From f41a249c02cd293d6dec61b9cf0c3eb2123c6344 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 12 Apr 2024 10:57:36 +0200 Subject: [PATCH 30/43] Wrong extension node: expected RLC computation fixed --- ...gen_witness_from_infura_blockchain_test.go | 44 +- .../gethutil/mpt/witness/prepare_witness.go | 6 +- zkevm-circuits/src/mpt_circuit/helpers.rs | 59 ++- .../src/mpt_circuit/storage_leaf.rs | 3 + .../tests/AccountWrongExtensionNode.json | 92 ++-- .../tests/StorageWrongExtensionNode.json | 81 ++-- .../tests/StorageWrongExtensionNode1.json | 418 ++++++++++++++++++ 7 files changed, 605 insertions(+), 98 deletions(-) create mode 100644 zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode1.json diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 7ab979038a..39d920ab29 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2361,7 +2361,7 @@ func TestStorageWrongExtensionNode(t *testing.T) { statedb.IntermediateRoot(false) // Returns extension node - key3 := common.HexToHash("0x1200000000000000000000000000000000000000000000000000000000000000") + key3 := common.HexToHash("0x1277000000000000000000000000000000000000000000000000000000000000") val := common.BigToHash(big.NewInt(int64(17))) trieMod := TrieModification{ @@ -2376,3 +2376,45 @@ func TestStorageWrongExtensionNode(t *testing.T) { oracle.PreventHashingInSecureTrie = false } + +func TestStorageWrongExtensionNode1(t *testing.T) { + blockNum := 0 + blockNumberParent := big.NewInt(int64(blockNum)) + blockHeaderParent := oracle.PrefetchBlock(blockNumberParent, true, nil) + database := state.NewDatabase(blockHeaderParent) + statedb, _ := state.New(blockHeaderParent.Root, database, nil) + addr := common.HexToAddress("0x40efbf12580138bc623c95757286df4e24eb81c9") + + statedb.DisableLoadingRemoteAccounts() + oracle.PreventHashingInSecureTrie = true // to store the unchanged key + + statedb.CreateAccount(addr) + statedb.IntermediateRoot(false) + + key1 := common.HexToHash("0x01230000000000000000000000000000000000000000000000000000000000000") + key2 := common.HexToHash("0x01231000000000000000000000000000000000000000000000000000000000000") + + val1 := common.HexToHash("0xCE9F6C9634165F91E22E58B90E3EDE393D959E47") + val2 := common.HexToHash("0xEC9F6C9634165F91E22E58B90E3EDE393D959E47") + + statedb.SetState(addr, key1, val1) + statedb.SetState(addr, key2, val2) + + statedb.IntermediateRoot(false) + + // Returns extension node + key3 := common.HexToHash("0x01277000000000000000000000000000000000000000000000000000000000000") + + val := common.BigToHash(big.NewInt(int64(17))) + trieMod := TrieModification{ + Type: StorageDoesNotExist, + Key: key3, + Value: val, + Address: addr, + } + trieModifications := []TrieModification{trieMod} + + prepareWitness("StorageWrongExtensionNode1", trieModifications, statedb) + + oracle.PreventHashingInSecureTrie = false +} diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 83474eb4fe..30c68a3356 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -108,7 +108,7 @@ func obtainAccountProofAndConvertToWitness(tMod TrieModification, statedb *state cRoot := statedb.GetTrie().Hash() accountProof1, aNeighbourNode2, aExtNibbles2, isLastLeaf2, aIsNeighbourNodeHashed2, err := statedb.GetProof(addr) - check(err) + check(err) if tMod.Type == AccountDoesNotExist && len(accountProof) == 0 { // If there is only one account in the state trie and we want to prove for some @@ -524,9 +524,9 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] keyAfter = append(keyAfter, trie.HexToCompact(nibblesAfter)...) isExtension := true - // Dummy branch. The constraint of the branch being in the extension node and the constraint of the + // Dummy branch with no empty nodes. The constraint of the branch being in the extension node and the constraint of the // leaf being in the branch need to be disabled for this case. - branchRlp := []byte{248, 81, 160, 244, 245, 0, 27, 233, 28, 128, 158, 163, 228, 185, 193, 250, 228, 226, 205, 233, 119, 98, 15, 183, 171, 187, 182, 172, 113, 115, 190, 167, 217, 33, 211, 160, 72, 229, 31, 123, 46, 26, 63, 24, 242, 142, 183, 252, 47, 111, 99, 255, 0, 118, 149, 196, 125, 165, 118, 4, 189, 149, 202, 221, 129, 141, 240, 209, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}; + branchRlp := []byte{249, 2, 17, 160, 215, 178, 43, 142, 72, 221, 147, 48, 230, 157, 99, 126, 109, 240, 144, 184, 54, 167, 1, 19, 157, 71, 126, 226, 97, 100, 220, 221, 118, 5, 202, 114, 160, 195, 19, 38, 251, 242, 179, 135, 46, 118, 82, 177, 213, 78, 156, 167, 171, 134, 95, 6, 233, 153, 168, 219, 176, 131, 34, 215, 213, 95, 252, 168, 165, 160, 242, 119, 75, 182, 209, 50, 158, 172, 168, 239, 218, 202, 172, 144, 155, 94, 44, 154, 149, 92, 253, 83, 150, 12, 4, 176, 33, 46, 25, 36, 170, 225, 160, 156, 18, 160, 254, 15, 159, 132, 100, 9, 112, 178, 98, 98, 93, 76, 54, 189, 166, 63, 219, 45, 193, 25, 238, 218, 78, 235, 150, 206, 67, 252, 253, 160, 100, 75, 99, 34, 122, 170, 85, 172, 143, 62, 172, 142, 154, 219, 40, 105, 162, 136, 113, 194, 41, 38, 129, 211, 105, 114, 94, 62, 145, 244, 97, 170, 160, 229, 94, 177, 9, 226, 34, 180, 156, 33, 249, 119, 163, 74, 194, 218, 172, 92, 90, 13, 44, 22, 231, 5, 100, 72, 203, 19, 192, 62, 46, 34, 34, 160, 15, 175, 179, 52, 244, 84, 197, 105, 112, 43, 252, 115, 186, 76, 237, 251, 88, 5, 62, 201, 157, 9, 7, 153, 100, 224, 202, 249, 250, 183, 125, 248, 160, 14, 229, 239, 45, 75, 116, 39, 109, 41, 89, 200, 43, 18, 94, 204, 133, 62, 175, 23, 200, 68, 93, 170, 95, 36, 226, 233, 183, 66, 98, 37, 184, 160, 6, 197, 49, 201, 57, 39, 248, 81, 26, 196, 11, 167, 230, 243, 100, 223, 97, 38, 20, 1, 226, 39, 180, 161, 172, 204, 67, 80, 173, 223, 89, 42, 160, 3, 131, 195, 206, 124, 22, 207, 14, 142, 91, 216, 135, 77, 202, 69, 1, 53, 115, 223, 85, 52, 95, 43, 227, 237, 82, 138, 95, 93, 70, 227, 232, 160, 98, 109, 64, 32, 201, 140, 205, 221, 164, 1, 209, 57, 84, 209, 249, 108, 87, 101, 70, 12, 37, 160, 114, 139, 27, 145, 104, 130, 62, 183, 150, 108, 160, 91, 17, 33, 207, 142, 243, 30, 99, 20, 173, 20, 129, 191, 59, 158, 186, 174, 22, 77, 226, 131, 140, 56, 74, 194, 53, 68, 176, 249, 189, 108, 176, 160, 39, 24, 29, 240, 236, 191, 237, 195, 74, 255, 251, 61, 19, 232, 218, 181, 111, 83, 69, 125, 70, 208, 135, 182, 81, 0, 125, 85, 38, 21, 25, 11, 160, 191, 249, 76, 252, 217, 172, 58, 95, 133, 138, 144, 243, 9, 87, 191, 253, 23, 150, 215, 186, 153, 214, 27, 17, 128, 10, 154, 202, 202, 43, 193, 173, 160, 238, 147, 22, 82, 116, 71, 41, 238, 84, 0, 62, 40, 0, 153, 205, 90, 194, 234, 61, 255, 205, 197, 55, 0, 41, 239, 197, 174, 219, 163, 6, 130, 160, 22, 99, 129, 222, 131, 163, 115, 40, 32, 94, 210, 97, 181, 141, 77, 173, 9, 184, 214, 164, 50, 44, 139, 113, 241, 255, 7, 213, 43, 8, 145, 41, 128} extNode := proof2[len(proof2)-1] // Let's name it E1 bNode := prepareBranchNode(branchRlp, branchRlp, extNode, extNode, extListRlpBytes, extValues, diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 6ffa1c7c14..f66c782745 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1320,6 +1320,7 @@ impl WrongLeafGadget { #[derive(Clone, Debug, Default)] pub struct WrongExtNodeGadget { is_key_equal: IsEqualGadget, + mult_without_branch_nibble: Cell, } impl WrongExtNodeGadget { @@ -1338,17 +1339,31 @@ impl WrongExtNodeGadget { let mut config = WrongExtNodeGadget::default(); circuit!([meta, cb.base], { ifx! {is_wrong_ext_case => { + config.mult_without_branch_nibble = cb.query_cell(); + // We have a key split into three parts, // meaning that the first part parity doesn't // tell us about the parity of the second part (depends on the third part as well). let data0 = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles.clone()]; + + // key_data.is_odd (and key_data.num_nibbles) takes into account also the branch nibble and we do not want this, + // the actual value we need is not!(key_data.is_odd) + + // key_data.is_odd (and key_data.num_nibbles) takes into account also the branch nibble and we do not want this, + // the actual value we need is !key_data.is_odd + // key_data_prev.is_odd = true, key_data.is_odd = true -> is_key_part_odd = true + // key_data_prev.is_odd = true, key_data.is_odd = false -> is_key_part_odd = false + // key_data_prev.is_odd = false, key_data.is_odd = true -> is_key_part_odd = false + // key_data_prev.is_odd = false, key_data.is_odd = false -> is_key_part_odd = true + let is_key_part_odd = not!(xor::expr(key_data_prev.is_odd.expr(), key_data.is_odd.expr())); + let after_middle_rlc = key_data_prev.rlc.expr() + ext_key_rlc_expr( cb, wrong_ext_middle.clone(), key_data_prev.mult.expr(), - key_data.is_odd.expr(), + is_key_part_odd, key_data_prev.is_odd.expr(), data0 .iter() @@ -1359,22 +1374,25 @@ impl WrongExtNodeGadget { &cb.key_r.expr(), ); - // odd odd -> even - // odd even -> odd - // even odd -> odd - // even even -> even - let after_two_parts_is_odd = - xor::expr(key_data_prev.is_odd.expr(), key_data.is_odd.expr()); + let after_two_parts_is_odd = not!(key_data.is_odd.expr()); // The total number of nibbles is odd, thus: let third_part_is_odd = after_two_parts_is_odd.clone(); + // We cannot use key_data.mult because it takes into account also the branch nibble. + let mult = config.mult_without_branch_nibble.expr(); + ifx! {key_data.is_odd => { + require!(mult => key_data.mult.expr()); + } elsex { + require!(mult.clone() * cb.key_r.expr() => key_data.mult.expr()); + }} + let data1 = [wrong_ext_after.clone(), wrong_ext_after_nibbles.clone()]; let rlc = after_middle_rlc.clone() + ext_key_rlc_expr( cb, wrong_ext_after.clone(), - key_data.mult.expr(), + mult.clone(), third_part_is_odd, after_two_parts_is_odd, data1 @@ -1411,10 +1429,18 @@ impl WrongExtNodeGadget { key_data_prev: KeyDataWitness, ) { let items = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles]; - let (after_middle_rlc, _) = ext_key_rlc_calc_value( + + // key_data.is_odd (and key_data.num_nibbles) takes into account also the branch nibble and we do not want this, + // the actual value we need is !key_data.is_odd + // key_data_prev.is_odd = true, key_data.is_odd = true -> is_key_part_odd = true + // key_data_prev.is_odd = true, key_data.is_odd = false -> is_key_part_odd = false + // key_data_prev.is_odd = false, key_data.is_odd = true -> is_key_part_odd = false + // key_data_prev.is_odd = false, key_data.is_odd = false -> is_key_part_odd = true + let is_key_part_odd = key_data_prev.is_odd == key_data.is_odd; + let after_middle_rlc = key_data_prev.rlc + ext_key_rlc_calc_value( wrong_ext_middle, key_data_prev.mult, - key_data.is_odd, + is_key_part_odd, key_data_prev.is_odd, items .iter() @@ -1423,7 +1449,18 @@ impl WrongExtNodeGadget { .try_into() .unwrap(), region.key_r, - ); + ).0; + + let mut mult = key_data.mult; + if !key_data.is_odd { + let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd + mult = F::one(); + + for _ in 0..iters { + mult = mult * region.key_r; + } + } + let _ = self.mult_without_branch_nibble.assign(region, offset, mult); let _ = self.is_key_equal.assign( region, diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 11a2dd2808..851e617d7f 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -296,6 +296,9 @@ impl StorageLeafConfig { let is_wrong_leaf_case = and::expr(&[config.is_non_existing_storage_proof.expr(), not!(config.parent_data[1].is_extension), not!(config.is_placeholder_leaf[1].expr())]); + require!(is_wrong_leaf_case => 0.expr()); + require!(config.is_placeholder_leaf[1].expr() => 0.expr()); + // When non-existing-proof, it needs to be one of the following cases: // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of these // three cases is 1. diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json index 64879f7d4f..8e0029087a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a02d76cb756b3842bc3b6ae4244c91a3cb937be8986a52335b85597a97d3cb528f00", - "a02d76cb756b3842bc3b6ae4244c91a3cb937be8986a52335b85597a97d3cb528f00" + "a0d8b86d99fd4b3f3fff7a7ede1705c2b72630b37ebbd2e81ff6081950ed8195df00", + "a0d8b86d99fd4b3f3fff7a7ede1705c2b72630b37ebbd2e81ff6081950ed8195df00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -48,10 +49,10 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", - "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", + "a0338773aaf24451c4214ca3db54a865a2f0255a7fe217ae8168b7207336f23d1400", "a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0967be23021569a88609525fa4c9ac65e0faf0a70eb9d3e2c1177d42a57ab0f9500", + "a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580900", "80000000000000000000000000000000000000000000000000000000000000000000", "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a0967be23021569a88609525fa4c9ac65e0faf0a70eb9d3e2c1177d42a57ab0f9580a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a0967be23021569a88609525fa4c9ac65e0faf0a70eb9d3e2c1177d42a57ab0f9580a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0338773aaf24451c4214ca3db54a865a2f0255a7fe217ae8168b7207336f23d14a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0338773aaf24451c4214ca3db54a865a2f0255a7fe217ae8168b7207336f23d14a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": true, "extension": { "list_rlp_bytes": "e4" }, @@ -88,8 +90,8 @@ "modified_index": 1, "drifted_index": 1, "list_rlp_bytes": [ - "f871", - "f871" + "f90211", + "f90211" ] } }, @@ -97,31 +99,31 @@ "storage": null, "mod_extension": null, "values": [ - "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", - "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", - "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", - "a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c5695800", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a500", + "a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca7200", + "a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a500", + "a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae100", + "a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfd00", + "a0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aa00", + "a0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e222200", + "a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df800", + "a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b800", + "a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592a00", + "a00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e800", + "a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966c00", + "a05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb000", + "a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190b00", + "a0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ad00", + "a0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba3068200", + "a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912900", "82102300000000000000000000000000000000000000000000000000000000000000", "a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe3800", "00000300000000000000000000000000000000000000000000000000000000000000", "a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe3800" ], "keccak_data": [ - "f871a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c569588080808080808080808080808080", - "f871a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c56958a034d56ff493be9f147e27d41d558c096871bf65c5169137860ba4d9f6c1c569588080808080808080808080808080", + "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", + "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", "e4821023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38", "e4821023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38" ] @@ -133,16 +135,16 @@ "address": "0018100000000000000000000000000000000000", "key": "0018100000000000000000000000000000000000000000000000000000000000", "list_rlp_bytes": [ - "f867", - "f867" + "f86c", + "f86c" ], "value_rlp_bytes": [ - "b846", - "b846" + "b84c", + "b84c" ], "value_list_rlp_bytes": [ - "f844", - "f844" + "f84a", + "f84a" ], "drifted_rlp_bytes": "00", "wrong_rlp_bytes": "f86c", @@ -158,28 +160,28 @@ "storage": null, "mod_extension": null, "values": [ - "9e300000000000000000000000000000000000000000000000000000000000000000", - "9e300000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "9d342d35c77812a50e6d16048dc6e980db2cf7daf1e702ce7df63af60f0300000000", + "9d342d35c77812a50e6d16048dc6e980db2cf7daf1e702ce7df63af60f0300000000", + "04000000000000000000000000000000000000000000000000000000000000000000", + "86559cd06c0800000000000000000000000000000000000000000000000000000000", "a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42100", "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "04000000000000000000000000000000000000000000000000000000000000000000", + "86559cd06c0800000000000000000000000000000000000000000000000000000000", "a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b42100", "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", "00000000000000000000000000000000000000000000000000000000000000000000", - "a0301810000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", + "9d300000000000000000000000000000000000000000000000000000000000000000", + "a01018", + "00000800000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", + "a000100000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8679e300000000000000000000000000000000000000000000000000000000000b846f8448080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "f8679e300000000000000000000000000000000000000000000000000000000000b846f8448080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f86c9d342d35c77812a50e6d16048dc6e980db2cf7daf1e702ce7df63af60f03b84cf84a0486559cd06c0800a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f86c9d342d35c77812a50e6d16048dc6e980db2cf7daf1e702ce7df63af60f03b84cf84a0486559cd06c0800a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "0018100000000000000000000000000000000000" ] }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json index 58c6c32bae..7a2aa2572a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -303,15 +307,16 @@ false, false ], + "is_last_level_and_wrong_ext_case": true, "extension": { "list_rlp_bytes": "e4" }, "branch": { - "modified_index": 0, - "drifted_index": 0, + "modified_index": 7, + "drifted_index": 7, "list_rlp_bytes": [ - "f851", - "f851" + "f90211", + "f90211" ] } }, @@ -319,31 +324,31 @@ "storage": null, "mod_extension": null, "values": [ - "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", - "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", - "a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d100", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b800", + "a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca7200", + "a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a500", + "a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae100", + "a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfd00", + "a0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aa00", + "a0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e222200", + "a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df800", + "a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b800", + "a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592a00", + "a00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e800", + "a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966c00", + "a05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb000", + "a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190b00", + "a0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ad00", + "a0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba3068200", + "a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912900", "82112300000000000000000000000000000000000000000000000000000000000000", "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900", "00000300000000000000000000000000000000000000000000000000000000000000", "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900" ], "keccak_data": [ - "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", - "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", + "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", + "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39", "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39" ] @@ -353,15 +358,15 @@ "extension_branch": null, "account": null, "storage": { - "address": "1200000000000000000000000000000000000000000000000000000000000000", - "key": "1200000000000000000000000000000000000000000000000000000000000000", + "address": "1277000000000000000000000000000000000000000000000000000000000000", + "key": "1277000000000000000000000000000000000000000000000000000000000000", "list_rlp_bytes": [ - "f6", - "f6" + "e2", + "e2" ], "value_rlp_bytes": [ - "95", - "95" + "00", + "00" ], "drifted_rlp_bytes": "00", "wrong_rlp_bytes": "e2", @@ -376,23 +381,23 @@ }, "mod_extension": null, "values": [ - "9f200000000000000000000000000000000000000000000000000000000000000000", - "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", - "9f200000000000000000000000000000000000000000000000000000000000000000", - "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "a1201200000000000000000000000000000000000000000000000000000000000000", + "a1201277000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", + "a1201277000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", + "a1201277000000000000000000000000000000000000000000000000000000000000", + "a01127", + "00000700000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", + "a017000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", - "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", - "1200000000000000000000000000000000000000000000000000000000000000" + "e2a120127700000000000000000000000000000000000000000000000000000000000000", + "e2a120127700000000000000000000000000000000000000000000000000000000000000", + "1277000000000000000000000000000000000000000000000000000000000000" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode1.json b/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode1.json new file mode 100644 index 0000000000..7a2aa2572a --- /dev/null +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageWrongExtensionNode1.json @@ -0,0 +1,418 @@ +[ + { + "start": { + "disable_preimage_check": true, + "proof_type": "StorageDoesNotExist" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200", + "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200" + ], + "keccak_data": [] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", + "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", + "a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bd00", + "a0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf002100", + "a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e000", + "a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d84464800", + "a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e700", + "a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92d00", + "a0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb72100", + "a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd7168100", + "a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec8447200", + "a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8e00", + "a09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc220800", + "a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94ec00", + "a07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df47500", + "a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a000", + "a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb00", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80", + "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 15, + "drifted_index": 15, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", + "a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063e00", + "a033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b900", + "a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f91400", + "a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c900", + "a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6b00", + "a08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef700", + "a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb76600", + "a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e100", + "a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef5681115500", + "a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f200", + "a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a38360000", + "a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b1700", + "a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abace00", + "a00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f500", + "a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d400", + "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580", + "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 2, + "drifted_index": 2, + "list_rlp_bytes": [ + "f901b1", + "f901b1" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", + "a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218a00", + "a019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e800", + "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a11000", + "a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa61500", + "a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96400", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecc00", + "a0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d42468289295100", + "a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d5100", + "a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0be00", + "a080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd1165500", + "a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153400", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480", + "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 6, + "drifted_index": 6, + "list_rlp_bytes": [ + "f891", + "f891" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b16300", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080", + "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080" + ] + }, + { + "start": null, + "extension_branch": null, + "account": { + "address": "40efbf12580138bc623c95757286df4e24eb81c9", + "key": "0f266f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e", + "list_rlp_bytes": [ + "f868", + "f868" + ], + "value_rlp_bytes": [ + "b846", + "b846" + ], + "value_list_rlp_bytes": [ + "f844", + "f844" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "f868", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "storage": null, + "mod_extension": null, + "values": [ + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "40efbf12580138bc623c95757286df4e24eb81c9" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": true, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": true, + "extension": { + "list_rlp_bytes": "e4" + }, + "branch": { + "modified_index": 7, + "drifted_index": 7, + "list_rlp_bytes": [ + "f90211", + "f90211" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b800", + "a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca7200", + "a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a500", + "a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae100", + "a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfd00", + "a0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aa00", + "a0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e222200", + "a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df800", + "a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b800", + "a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592a00", + "a00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e800", + "a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966c00", + "a05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb000", + "a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190b00", + "a0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ad00", + "a0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba3068200", + "a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912900", + "82112300000000000000000000000000000000000000000000000000000000000000", + "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900", + "00000300000000000000000000000000000000000000000000000000000000000000", + "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900" + ], + "keccak_data": [ + "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", + "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", + "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39", + "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39" + ] + }, + { + "start": null, + "extension_branch": null, + "account": null, + "storage": { + "address": "1277000000000000000000000000000000000000000000000000000000000000", + "key": "1277000000000000000000000000000000000000000000000000000000000000", + "list_rlp_bytes": [ + "e2", + "e2" + ], + "value_rlp_bytes": [ + "00", + "00" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "e2", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "mod_extension": null, + "values": [ + "a1201277000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a1201277000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a1201277000000000000000000000000000000000000000000000000000000000000", + "a01127", + "00000700000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a017000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "e2a120127700000000000000000000000000000000000000000000000000000000000000", + "e2a120127700000000000000000000000000000000000000000000000000000000000000", + "1277000000000000000000000000000000000000000000000000000000000000" + ] + }, + { + "start": { + "disable_preimage_check": false, + "proof_type": "Disabled" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0000000000000000000000000000000000000000000000000000000000000000000", + "a0000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [] + } +] \ No newline at end of file From b1c8824ef1ac985289b3498056103c499e4e347b Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 12 Apr 2024 10:59:09 +0200 Subject: [PATCH 31/43] Debugging constraints removed --- zkevm-circuits/src/mpt_circuit/storage_leaf.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 851e617d7f..11a2dd2808 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -296,9 +296,6 @@ impl StorageLeafConfig { let is_wrong_leaf_case = and::expr(&[config.is_non_existing_storage_proof.expr(), not!(config.parent_data[1].is_extension), not!(config.is_placeholder_leaf[1].expr())]); - require!(is_wrong_leaf_case => 0.expr()); - require!(config.is_placeholder_leaf[1].expr() => 0.expr()); - // When non-existing-proof, it needs to be one of the following cases: // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of these // three cases is 1. From d10281f8f4066b9d078d4b58b06db307cc8082f0 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 16 Apr 2024 12:08:28 +0200 Subject: [PATCH 32/43] Fixing problems introduced by adding wrong extension node gadget --- .../gethutil/mpt/witness/prepare_witness.go | 14 +++-- .../src/mpt_circuit/account_leaf.rs | 60 ++++++++++--------- zkevm-circuits/src/mpt_circuit/helpers.rs | 10 ++-- .../src/mpt_circuit/storage_leaf.rs | 58 +++++++++--------- 4 files changed, 77 insertions(+), 65 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 30c68a3356..e3c6ed77b8 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -428,8 +428,16 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] leafRow0 = proof2[len2-1] } + extensionNibblesS := []byte{} + extensionNibblesC := []byte{} + if len1 > 2 { + extensionNibblesS = extNibblesS[len1-3] + } + if len2 > 2 { + extensionNibblesC = extNibblesC[len2-3] + } isModifiedExtNode, _, numberOfNibbles, bNode := addBranchAndPlaceholder(proof1, proof2, - extNibblesS[len1-1], extNibblesC[len2-1], + extensionNibblesS, extensionNibblesC, leafRow0, key, keyIndex, isShorterProofLastLeaf) @@ -484,9 +492,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // When non existing proof and only the branches are returned, we add a placeholder leaf. // This is to enable the lookup (in account leaf row), most constraints are disabled for these rows. - isLastBranch := isBranch(proof2[len(proof2)-1]) - - if (len1 == 0 && len2 == 0) || isLastBranch { + if (len1 == 0 && len2 == 0) || isBranch(proof2[len(proof2)-1]) { // We need to add a placeholder leaf if isAccountProof { node := prepareAccountLeafPlaceholderNode(addr, addrh, key, keyIndex) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index c5fec451a2..702bfc8a69 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -745,38 +745,40 @@ impl AccountLeafConfig { region.key_r, )?; - // Wrong leaf / extension node handling - let mut key_data_prev = KeyDataWitness::default(); - if offset > 2 { - key_data_prev = self.key_data_prev.witness_load( + if is_non_existing_proof { + // Wrong leaf / extension node handling + let mut key_data_prev = KeyDataWitness::default(); + if offset > 2 { + key_data_prev = self.key_data_prev.witness_load( + region, + offset, + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; + } + self.wrong_leaf.assign( region, offset, - &mut memory[key_memory(false)], - 2, // 2 instead of 1 because default values have already been stored above - )?; - } - self.wrong_leaf.assign( - region, - offset, - is_non_existing_proof, - &key_rlc, - &account.wrong_rlp_bytes, - &expected_item, - true, - key_data[1].clone(), - region.key_r, - )?; + is_non_existing_proof, + &key_rlc, + &account.wrong_rlp_bytes, + &expected_item, + true, + key_data[1].clone(), + region.key_r, + )?; - let wrong_ext_middle = rlp_values[AccountRowType::LongExtNodeKey as usize].clone(); - let wrong_ext_middle_nibbles = rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); - self.wrong_ext_node.assign( - region, - offset, - wrong_ext_middle, - wrong_ext_middle_nibbles, - key_data[1].clone(), - key_data_prev.clone(), - ); + let wrong_ext_middle = rlp_values[AccountRowType::LongExtNodeKey as usize].clone(); + let wrong_ext_middle_nibbles = rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); + self.wrong_ext_node.assign( + region, + offset, + wrong_ext_middle, + wrong_ext_middle_nibbles, + key_data[1].clone(), + key_data_prev.clone(), + ); + } // Anything following this node is below the account MainData::witness_store( diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index f66c782745..79b005c520 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -1453,11 +1453,13 @@ impl WrongExtNodeGadget { let mut mult = key_data.mult; if !key_data.is_odd { - let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd - mult = F::one(); + if key_data.num_nibbles > 1 { + let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd + mult = F::one(); - for _ in 0..iters { - mult = mult * region.key_r; + for _ in 0..iters { + mult = mult * region.key_r; + } } } let _ = self.mult_without_branch_nibble.assign(region, offset, mult); diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 11a2dd2808..b5f4c52476 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -604,35 +604,37 @@ impl StorageLeafConfig { region.key_r, )?; - // Wrong leaf / extension node handling - let key_data_prev = self.key_data_prev.witness_load( - region, - offset, - &mut memory[key_memory(false)], - 2, // 2 instead of 1 because default values have already been stored above - )?; - let (_key_rlc, _) = self.wrong_leaf.assign( - region, - offset, - is_non_existing_proof, - &key_rlc, - &storage.wrong_rlp_bytes, - &expected_item, - false, - key_data[1].clone(), - region.key_r, - )?; + if is_non_existing_proof { + // Wrong leaf / extension node handling + let key_data_prev = self.key_data_prev.witness_load( + region, + offset, + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; + let (_key_rlc, _) = self.wrong_leaf.assign( + region, + offset, + is_non_existing_proof, + &key_rlc, + &storage.wrong_rlp_bytes, + &expected_item, + false, + key_data[1].clone(), + region.key_r, + )?; - let wrong_ext_middle = rlp_values[StorageRowType::LongExtNodeKey as usize].clone(); - let wrong_ext_middle_nibbles = rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); - self.wrong_ext_node.assign( - region, - offset, - wrong_ext_middle, - wrong_ext_middle_nibbles, - key_data[1].clone(), - key_data_prev.clone(), - ); + let wrong_ext_middle = rlp_values[StorageRowType::LongExtNodeKey as usize].clone(); + let wrong_ext_middle_nibbles = rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); + self.wrong_ext_node.assign( + region, + offset, + wrong_ext_middle, + wrong_ext_middle_nibbles, + key_data[1].clone(), + key_data_prev.clone(), + ); + } // Reset the main memory MainData::witness_store( From b2063d62aad91390ac4b56b6729e3a04b5da4ead Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 17 Apr 2024 12:01:45 +0200 Subject: [PATCH 33/43] WrongExtensionGadget implemented; tests pass --- .../src/mpt_circuit/account_leaf.rs | 60 ++- zkevm-circuits/src/mpt_circuit/helpers.rs | 1 - .../src/mpt_circuit/storage_leaf.rs | 58 ++- .../tests/AccountAddPlaceholderBranch.json | 8 + .../tests/AccountAddPlaceholderExtension.json | 8 + .../tests/AccountAfterFirstLevel.json | 17 +- .../tests/AccountBranchPlaceholder.json | 18 +- .../tests/AccountBranchPlaceholderDeeper.json | 8 + .../AccountBranchPlaceholderInFirstLevel.json | 1 + .../tests/AccountDeletePlaceholderBranch.json | 8 + .../AccountDeletePlaceholderExtension.json | 8 + .../tests/AccountExtensionInFirstLevel.json | 1 + ...countExtensionThreeNibblesInEvenLevel.json | 16 +- ...ccountExtensionThreeNibblesInOddLevel.json | 17 +- ...AccountExtensionTwoNibblesInEvenLevel.json | 15 +- .../tests/AccountWrongExtensionNode.json | 12 +- .../src/mpt_circuit/tests/AddAccount.json | 4 + .../src/mpt_circuit/tests/AddBranch.json | 9 + .../src/mpt_circuit/tests/AddBranchLong.json | 9 + .../mpt_circuit/tests/AddBranchTwoLevels.json | 11 + .../tests/AddBranchTwoLevelsLong.json | 11 + .../mpt_circuit/tests/BalanceModCLong.json | 7 + .../mpt_circuit/tests/BalanceModCShort.json | 7 + .../mpt_circuit/tests/BranchAfterExtNode.json | 6 + .../src/mpt_circuit/tests/Delete.json | 9 + .../src/mpt_circuit/tests/DeleteAccount.json | 4 + .../src/mpt_circuit/tests/DeleteBranch.json | 10 + .../mpt_circuit/tests/DeleteBranchLong.json | 10 + .../tests/DeleteBranchTwoLevels.json | 11 + .../tests/DeleteBranchTwoLevelsLong.json | 10 + .../mpt_circuit/tests/DeleteToEmptyTrie.json | 8 + .../tests/ExtNodeDeletedBefore4After1.json | 35 +- ...ExtNodeDeletedBefore6After1FirstLevel.json | 33 +- ...ExtNodeDeletedBranchDeletedFirstLevel.json | 33 +- ...NodeDeletedExtShortIsBranchFirstLevel.json | 33 +- .../tests/ExtNodeInsertedBefore4After1.json | 35 +- ...xtNodeInsertedBefore5After1FirstLevel.json | 33 +- ...xtNodeInsertedBefore5After2FirstLevel.json | 33 +- ...xtNodeInsertedBefore5After3FirstLevel.json | 33 +- ...xtNodeInsertedBefore6After1FirstLevel.json | 33 +- ...xtNodeInsertedBefore6After2FirstLevel.json | 33 +- ...xtNodeInsertedBefore6After4FirstLevel.json | 33 +- ...odeInsertedExtShortIsBranchFirstLevel.json | 33 +- .../ExtNodeInsertedInNewBranchFirstLevel.json | 33 +- ...ionAddedInFirstStorageLevelOneKeyByte.json | 10 + ...onAddedInFirstStorageLevelTwoKeyBytes.json | 10 + .../tests/ExtensionAddedOneKeyByteSel1.json | 9 + .../tests/ExtensionAddedOneKeyByteSel2.json | 11 + .../ExtensionAddedThreeKeyBytesSel2.json | 10 + .../tests/ExtensionAddedTwoKeyBytesSel1.json | 11 + .../tests/ExtensionAddedTwoKeyBytesSel2.json | 11 + .../tests/ExtensionDeletedOneKeyByteSel1.json | 9 + .../tests/ExtensionDeletedOneKeyByteSel2.json | 11 + .../ExtensionDeletedThreeKeyBytesSel2.json | 10 + .../ExtensionDeletedTwoKeyBytesSel1.json | 11 + .../ExtensionDeletedTwoKeyBytesSel2.json | 11 + .../tests/ExtensionInFirstStorageLevel.json | 9 + ...xtensionInFirstStorageLevelOneKeyByte.json | 10 + ...tensionInFirstStorageLevelTwoKeyBytes.json | 10 + .../tests/ExtensionIntoBranch.json | 362 +++++++++++++++ .../tests/ExtensionOneKeyByteSel1.json | 9 + .../tests/ExtensionThreeKeyBytes.json | 10 + .../tests/ExtensionThreeKeyBytesSel2.json | 10 + .../tests/ExtensionTwoKeyBytesSel1.json | 11 + .../tests/ExtensionTwoKeyBytesSel2.json | 11 + .../src/mpt_circuit/tests/FromNilToValue.json | 10 + .../ImplicitlyCreateAccountWithBalance.json | 4 + .../ImplicitlyCreateAccountWithCodeHash.json | 4 + .../ImplicitlyCreateAccountWithNonce.json | 4 + .../tests/LeafAddedToEmptyTrie.json | 8 + .../mpt_circuit/tests/LeafInLastLevel.json | 5 + .../tests/LeafWithMoreNibbles.json | 5 + .../mpt_circuit/tests/LeafWithOneNibble.json | 5 + .../src/mpt_circuit/tests/LongKey.json | 10 + .../tests/NeighbourNodeInHashedBranch.json | 11 + .../mpt_circuit/tests/NonExistingAccount.json | 7 + .../NonExistingAccountAfterFirstLevel.json | 17 +- .../tests/NonExistingAccountNilObject.json | 4 + ...nExistingAccountNilObjectInFirstLevel.json | 17 +- .../mpt_circuit/tests/NonExistingStorage.json | 8 + .../tests/NonExistingStorageLong.json | 8 + .../tests/NonExistingStorageNil.json | 12 +- .../src/mpt_circuit/tests/NonceModCLong.json | 7 + .../src/mpt_circuit/tests/NonceModCShort.json | 7 + .../tests/OnlyLeafInStorageProof.json | 8 + .../tests/StorageDoesNotExistOnlySProof.json | 16 +- .../tests/StorageInFirstLevelNonExisting.json | 17 +- .../StorageInFirstLevelNonExistingLong.json | 17 +- ...orageLeafInFirstLevelAfterPlaceholder.json | 9 + .../tests/TrieDoesNotExistLongVal.json | 6 + .../tests/TrieDoesNotExistShortVal.json | 6 + .../src/mpt_circuit/tests/UpdateOneLevel.json | 9 + .../mpt_circuit/tests/UpdateOneLevel1.json | 8 + .../tests/UpdateOneLevelBigVal.json | 8 + .../tests/UpdateOneLevelEvenAddress.json | 9 + .../mpt_circuit/tests/UpdateThreeLevels.json | 11 + .../mpt_circuit/tests/UpdateTwoLevels.json | 9 + .../tests/UpdateTwoLevelsBigVal.json | 9 + .../tests/UpdateTwoModifications.json | 18 + .../src/mpt_circuit/tests/WrongAccount.json | 18 + .../mpt_circuit/tests/WrongExtensionNode.json | 413 ------------------ 101 files changed, 1379 insertions(+), 746 deletions(-) create mode 100644 zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json delete mode 100644 zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 702bfc8a69..c5fec451a2 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -745,40 +745,38 @@ impl AccountLeafConfig { region.key_r, )?; - if is_non_existing_proof { - // Wrong leaf / extension node handling - let mut key_data_prev = KeyDataWitness::default(); - if offset > 2 { - key_data_prev = self.key_data_prev.witness_load( - region, - offset, - &mut memory[key_memory(false)], - 2, // 2 instead of 1 because default values have already been stored above - )?; - } - self.wrong_leaf.assign( - region, - offset, - is_non_existing_proof, - &key_rlc, - &account.wrong_rlp_bytes, - &expected_item, - true, - key_data[1].clone(), - region.key_r, - )?; - - let wrong_ext_middle = rlp_values[AccountRowType::LongExtNodeKey as usize].clone(); - let wrong_ext_middle_nibbles = rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); - self.wrong_ext_node.assign( + // Wrong leaf / extension node handling + let mut key_data_prev = KeyDataWitness::default(); + if offset > 2 { + key_data_prev = self.key_data_prev.witness_load( region, offset, - wrong_ext_middle, - wrong_ext_middle_nibbles, - key_data[1].clone(), - key_data_prev.clone(), - ); + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; } + self.wrong_leaf.assign( + region, + offset, + is_non_existing_proof, + &key_rlc, + &account.wrong_rlp_bytes, + &expected_item, + true, + key_data[1].clone(), + region.key_r, + )?; + + let wrong_ext_middle = rlp_values[AccountRowType::LongExtNodeKey as usize].clone(); + let wrong_ext_middle_nibbles = rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); + self.wrong_ext_node.assign( + region, + offset, + wrong_ext_middle, + wrong_ext_middle_nibbles, + key_data[1].clone(), + key_data_prev.clone(), + ); // Anything following this node is below the account MainData::witness_store( diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 79b005c520..3e709c5dcf 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -895,7 +895,6 @@ pub(crate) fn ext_key_rlc_value( key_mult_first_odd, ) } else { - assert!(bytes[0] == KEY_PREFIX_EVEN.scalar()); (0.scalar(), 1.scalar()) }; (rlc, key_mult_prev * mult).rlc_chain_value(bytes[1..].iter().collect::>(), r) diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index b5f4c52476..11a2dd2808 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -604,37 +604,35 @@ impl StorageLeafConfig { region.key_r, )?; - if is_non_existing_proof { - // Wrong leaf / extension node handling - let key_data_prev = self.key_data_prev.witness_load( - region, - offset, - &mut memory[key_memory(false)], - 2, // 2 instead of 1 because default values have already been stored above - )?; - let (_key_rlc, _) = self.wrong_leaf.assign( - region, - offset, - is_non_existing_proof, - &key_rlc, - &storage.wrong_rlp_bytes, - &expected_item, - false, - key_data[1].clone(), - region.key_r, - )?; + // Wrong leaf / extension node handling + let key_data_prev = self.key_data_prev.witness_load( + region, + offset, + &mut memory[key_memory(false)], + 2, // 2 instead of 1 because default values have already been stored above + )?; + let (_key_rlc, _) = self.wrong_leaf.assign( + region, + offset, + is_non_existing_proof, + &key_rlc, + &storage.wrong_rlp_bytes, + &expected_item, + false, + key_data[1].clone(), + region.key_r, + )?; - let wrong_ext_middle = rlp_values[StorageRowType::LongExtNodeKey as usize].clone(); - let wrong_ext_middle_nibbles = rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); - self.wrong_ext_node.assign( - region, - offset, - wrong_ext_middle, - wrong_ext_middle_nibbles, - key_data[1].clone(), - key_data_prev.clone(), - ); - } + let wrong_ext_middle = rlp_values[StorageRowType::LongExtNodeKey as usize].clone(); + let wrong_ext_middle_nibbles = rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); + self.wrong_ext_node.assign( + region, + offset, + wrong_ext_middle, + wrong_ext_middle_nibbles, + key_data[1].clone(), + key_data_prev.clone(), + ); // Reset the main memory MainData::witness_store( diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderBranch.json b/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderBranch.json index 5012764761..f1bd6aedfe 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderBranch.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderBranch.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderExtension.json b/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderExtension.json index 3ee77066b6..f07c32da2b 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderExtension.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountAddPlaceholderExtension.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json index 2f2c1a1919..c8d7121710 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a06d97588c118770972c4f6b20f6ca9c780a898083abccef90a90c99404695f1dd00", - "a0910f97667341afd9f49f1ee6c28fc2cd946d66c7af6998ddfcf5cb450def7e4700" + "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", + "a0f27607e62c4a7a95dd1d5d63a72a129b1e42d14a59421045d8c11c29c7f8f70900" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90131", - "f90151" + "f90111", + "f90131" ] } }, @@ -45,7 +46,7 @@ "a0a47179bacb2563d64a4da3bfd1a3afc4e15e58cb7671232a1393aa56e84e210700", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9015180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0a47179bacb2563d64a4da3bfd1a3afc4e15e58cb7671232a1393aa56e84e210780" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0a47179bacb2563d64a4da3bfd1a3afc4e15e58cb7671232a1393aa56e84e210780" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json index b5b56b6a0c..0c6e83923e 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a06d97588c118770972c4f6b20f6ca9c780a898083abccef90a90c99404695f1dd00", - "a0ec5c94e18ca6573f42e8ad96ad374df0351a9df9a974a5c17ab3ce7072b64bf600" + "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", + "a0b220559455e7817aad815d51c2e1455060ddaaf60eeb300b69345eb407714c7e00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -45,7 +46,7 @@ "a0f5668715bad00d67745187cb0ca429735ffd25f9c22ea8a96b90752b9f11cde500", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a0f5668715bad00d67745187cb0ca429735ffd25f9c22ea8a96b90752b9f11cde58080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a0f5668715bad00d67745187cb0ca429735ffd25f9c22ea8a96b90752b9f11cde58080" ] }, { @@ -81,6 +82,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderDeeper.json b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderDeeper.json index a3ba6979bd..9a682daf0f 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderDeeper.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderDeeper.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderInFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderInFirstLevel.json index a2d61a57b3..e59db0a503 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderInFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholderInFirstLevel.json @@ -26,6 +26,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderBranch.json b/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderBranch.json index 64cabd8498..a2b9f1fec3 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderBranch.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderBranch.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderExtension.json b/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderExtension.json index 0546c95cbc..c86368175b 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderExtension.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountDeletePlaceholderExtension.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionInFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionInFirstLevel.json index 93448def18..7eee18f953 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionInFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionInFirstLevel.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json index 2a105d74f1..c94725c45f 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a07ff75eb943c0204628082550ac3072589cb19ad45470efedb0110489a522098300", - "a04829a71b169d3f94253c256540b7a30167f9d5c23fa33839606aeb2510acf18900" + "a0d4f83e51c78aeae92abfa769bc9eecf8a5dd361c2aa4b9219b49f73b4ea3531500", + "a09483cae1f3d6f923e9f3d6d387e9b65ac74190fddf26259ac020afbef5d0c80000" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -45,7 +46,7 @@ "a00165d78eb2d06873f7a076909093b34881dc3527b63cd33f0c19ae635eb15fc100", "a0d14c2a3a9c74f61ceb04bd565a49c5a86741af97d3dbeca89be38e45095c9b2f00", "a073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db4042176509300", - "a0650c07037fa5e083afe01ebc76d49a4b2682d3813f35f60c487b821280b3e47900", + "a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72a00", "a0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea9397700", "a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b614900", "a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f7800", @@ -56,7 +57,7 @@ "a05247e1e89587276142445f2235dfccbef844df7432098e5217f395913390588600", "a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b3000", "a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff1034700", - "a061c387163a9bddfec70a358a871a998355673598e3c16df94d63b61acdd6ca0400", + "a0e966e706e85e1ec5954cb87a48ac9205c1bf013059acbd85e07bb9423d637ef700", "a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b900", "a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045800", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a0d14c2a3a9c74f61ceb04bd565a49c5a86741af97d3dbeca89be38e45095c9b2fa073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a0650c07037fa5e083afe01ebc76d49a4b2682d3813f35f60c487b821280b3e479a0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a061c387163a9bddfec70a358a871a998355673598e3c16df94d63b61acdd6ca04a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880", - "f90211a00165d78eb2d06873f7a076909093b34881dc3527b63cd33f0c19ae635eb15fc1a073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a0650c07037fa5e083afe01ebc76d49a4b2682d3813f35f60c487b821280b3e479a0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a061c387163a9bddfec70a358a871a998355673598e3c16df94d63b61acdd6ca04a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880" + "f90211a0d14c2a3a9c74f61ceb04bd565a49c5a86741af97d3dbeca89be38e45095c9b2fa073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72aa0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a0e966e706e85e1ec5954cb87a48ac9205c1bf013059acbd85e07bb9423d637ef7a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880", + "f90211a00165d78eb2d06873f7a076909093b34881dc3527b63cd33f0c19ae635eb15fc1a073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72aa0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a0e966e706e85e1ec5954cb87a48ac9205c1bf013059acbd85e07bb9423d637ef7a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json index 9da2373863..e8054eec45 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a04ee30217fdb57fe9a8979017298d14724c4433b81d1916f24fd595e91585520400", - "a0a1579362b9ca792b49223ebe9168a563160d1a29437dc20657dd8ec91f5934c700" + "a06076a491d6fbf97d076a4db1836aa8c9fbf474b980546a2bc7d11ac14d9ebf1500", + "a0dc1cd18f4227f78b445f0896a39da3f2411bec6a4a34b857d9c1a7ba74a53f5500" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -45,7 +46,7 @@ "a029bc928d4b56e3e88d97c4ad644b1e96c3a0e830ab73584555e53d1267c6e34200", "a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e6900", "a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f31700", - "a020ca0a4d9f48085255640876e57f2db770d68f932e15d1b5c4424590ae39c96d00", + "a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c2900", "a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b1983700", "a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2d00", "a086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e000", @@ -56,7 +57,7 @@ "a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a200", "a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee700", "a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57c00", - "a0cf24dddebca06787d76f2ec01e0769b774b974c4a0046527ea34e1fc9bcc4ec900", + "a0ed068762642f09bde1608aedb9422d576a8a030875e900c6228bc6f10809223200", "a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdf00", "a0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5300", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e69a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a020ca0a4d9f48085255640876e57f2db770d68f932e15d1b5c4424590ae39c96da056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a0e8a83ed5093d0257a5dcbe0bfa96b7ea967536dc76225f48146e19318abfcf17a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0cf24dddebca06787d76f2ec01e0769b774b974c4a0046527ea34e1fc9bcc4ec9a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380", - "f90211a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e69a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a020ca0a4d9f48085255640876e57f2db770d68f932e15d1b5c4424590ae39c96da056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a029bc928d4b56e3e88d97c4ad644b1e96c3a0e830ab73584555e53d1267c6e342a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0cf24dddebca06787d76f2ec01e0769b774b974c4a0046527ea34e1fc9bcc4ec9a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380" + "f90211a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e69a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c29a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a0e8a83ed5093d0257a5dcbe0bfa96b7ea967536dc76225f48146e19318abfcf17a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0ed068762642f09bde1608aedb9422d576a8a030875e900c6228bc6f108092232a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380", + "f90211a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e69a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c29a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a029bc928d4b56e3e88d97c4ad644b1e96c3a0e830ab73584555e53d1267c6e342a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0ed068762642f09bde1608aedb9422d576a8a030875e900c6228bc6f108092232a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json index 1864f0f3cb..3652a7babb 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a019686fada6346b3d41cc8a3bc7b3b6ebd0d363ba993b43482218a3d4ec35d01500", - "a0fce60ea7841da962ab2ec796ccf42e5bd4104a3f8fc6ca631ac97b3c6d6bd28600" + "a09af29d59e28fdc38fdab99c7196bb57abef45b1d7d519a86258166a8b76cda9f00", + "a07c235c242e7a8665065b9c5badd2fb00e224a8cda2be750086875af5c3857b2600" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -45,7 +46,7 @@ "a050ecd22fad9c981f1659378fa2592c14cea949f0d7399f369ba5fa3797baa1e100", "a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b75900", "a005394ea3697f0d1a4b1a491780d3ec90bc36c3bcf303d1fb4db14fb4dc33b7f100", - "a05e049e4ead1e0bb66bec6ba8fb541e302b1a532d3ca836c626a68d8f0bffdee700", + "a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b94400", "a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b73800", "a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2be00", "a0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519f00", @@ -56,7 +57,7 @@ "a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3b00", "a05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707ef00", "a07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf242578800", - "a0897708188be3c96ab9662a9a088f4424ca8a2900c9a30e0d1d5d15645c980e9900", + "a0ea2daebfd939a3b71bb40e163c69dbf58ffb231717379c9ffe28fc46ada8f46500", "a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1b00", "a060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125700", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b759a005394ea3697f0d1a4b1a491780d3ec90bc36c3bcf303d1fb4db14fb4dc33b7f1a05e049e4ead1e0bb66bec6ba8fb541e302b1a532d3ca836c626a68d8f0bffdee7a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0897708188be3c96ab9662a9a088f4424ca8a2900c9a30e0d1d5d15645c980e99a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780", - "f90211a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b759a050ecd22fad9c981f1659378fa2592c14cea949f0d7399f369ba5fa3797baa1e1a05e049e4ead1e0bb66bec6ba8fb541e302b1a532d3ca836c626a68d8f0bffdee7a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0897708188be3c96ab9662a9a088f4424ca8a2900c9a30e0d1d5d15645c980e99a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780" + "f90211a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b759a005394ea3697f0d1a4b1a491780d3ec90bc36c3bcf303d1fb4db14fb4dc33b7f1a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b944a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0ea2daebfd939a3b71bb40e163c69dbf58ffb231717379c9ffe28fc46ada8f465a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780", + "f90211a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b759a050ecd22fad9c981f1659378fa2592c14cea949f0d7399f369ba5fa3797baa1e1a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b944a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0ea2daebfd939a3b71bb40e163c69dbf58ffb231717379c9ffe28fc46ada8f465a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json index 8e0029087a..ad17df2223 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0d8b86d99fd4b3f3fff7a7ede1705c2b72630b37ebbd2e81ff6081950ed8195df00", - "a0d8b86d99fd4b3f3fff7a7ede1705c2b72630b37ebbd2e81ff6081950ed8195df00" + "a0e2da51be53d789e31efedb5dd6dec64935937dbcc23ad5b811c74f112ed13b3400", + "a0e2da51be53d789e31efedb5dd6dec64935937dbcc23ad5b811c74f112ed13b3400" ], "keccak_data": [] }, @@ -49,7 +49,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", - "a0338773aaf24451c4214ca3db54a865a2f0255a7fe217ae8168b7207336f23d1400", + "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", "a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86000", "80000000000000000000000000000000000000000000000000000000000000000000", "a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580900", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0338773aaf24451c4214ca3db54a865a2f0255a7fe217ae8168b7207336f23d14a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0338773aaf24451c4214ca3db54a865a2f0255a7fe217ae8168b7207336f23d14a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AddAccount.json b/zkevm-circuits/src/mpt_circuit/tests/AddAccount.json index 8e404cc9d0..a9285d3be1 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AddAccount.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AddAccount.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AddBranch.json b/zkevm-circuits/src/mpt_circuit/tests/AddBranch.json index 78eca91e5b..9eb46c1b5c 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AddBranch.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AddBranch.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AddBranchLong.json b/zkevm-circuits/src/mpt_circuit/tests/AddBranchLong.json index cba38d0e24..884559d7eb 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AddBranchLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AddBranchLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevels.json b/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevels.json index 1dafdb0398..b7684c2069 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevels.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevels.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevelsLong.json b/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevelsLong.json index 390e604007..6240f50f73 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevelsLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AddBranchTwoLevelsLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/BalanceModCLong.json b/zkevm-circuits/src/mpt_circuit/tests/BalanceModCLong.json index 4aef77f450..3e9748aaed 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/BalanceModCLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/BalanceModCLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/BalanceModCShort.json b/zkevm-circuits/src/mpt_circuit/tests/BalanceModCShort.json index 28b578016c..4372cd9c20 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/BalanceModCShort.json +++ b/zkevm-circuits/src/mpt_circuit/tests/BalanceModCShort.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/BranchAfterExtNode.json b/zkevm-circuits/src/mpt_circuit/tests/BranchAfterExtNode.json index 5212062f63..52adb82840 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/BranchAfterExtNode.json +++ b/zkevm-circuits/src/mpt_circuit/tests/BranchAfterExtNode.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -303,6 +307,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "f6" }, @@ -360,6 +365,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "f6" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/Delete.json b/zkevm-circuits/src/mpt_circuit/tests/Delete.json index c0d2fd4f5c..9c4c83c90e 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/Delete.json +++ b/zkevm-circuits/src/mpt_circuit/tests/Delete.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/DeleteAccount.json b/zkevm-circuits/src/mpt_circuit/tests/DeleteAccount.json index de80087cfb..5135be4eb6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/DeleteAccount.json +++ b/zkevm-circuits/src/mpt_circuit/tests/DeleteAccount.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranch.json b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranch.json index 3f5c1b7fc1..149bb4efa0 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranch.json +++ b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranch.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchLong.json b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchLong.json index 3cb3679a13..0f79942b6a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevels.json b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevels.json index d77649a022..4994be0551 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevels.json +++ b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevels.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevelsLong.json b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevelsLong.json index ef1e10de7e..e53edaeb05 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevelsLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/DeleteBranchTwoLevelsLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/DeleteToEmptyTrie.json b/zkevm-circuits/src/mpt_circuit/tests/DeleteToEmptyTrie.json index d279fdad92..db49992092 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/DeleteToEmptyTrie.json +++ b/zkevm-circuits/src/mpt_circuit/tests/DeleteToEmptyTrie.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json index e98d390b9a..3877179b67 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0aee13b8fb0123f3e12ba75bf366963123c5c99d88ef7a19623a40e32b4db4a7e00", - "a09799f89b1a8d886aa0abb14e3b17caa83d300e5ff13eac6d97fa9a95b77032c500" + "a01fb27c5dcb862f9c34bbe7d1d3f6820dd1c11177b0189c9fbce5697b26894b7600", + "a0fe93777900dd532b0109e40174eed05cfe84757ae3117cb54417975424e8cd7300" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be0100", + "a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941d00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a041e524ea6ef62f8199c2c62ad00f980ce78893c5b23a01a665345422484bca3e00", + "a0335feb3b6b6a653d0af79dc2ff84e5c8d9a516733b99735e1d484d9330ca3b0100", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a041e524ea6ef62f8199c2c62ad00f980ce78893c5b23a01a665345422484bca3ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be01a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0335feb3b6b6a653d0af79dc2ff84e5c8d9a516733b99735e1d484d9330ca3b01a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0dea586a1e6eb20f0a627a0d8ead570bda5697058bb069cd60aea20d1ad6f063600", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0dea586a1e6eb20f0a627a0d8ead570bda5697058bb069cd60aea20d1ad6f06368080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0dea586a1e6eb20f0a627a0d8ead570bda5697058bb069cd60aea20d1ad6f06368080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080" ] }, { @@ -193,6 +195,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -248,6 +251,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -297,12 +301,13 @@ "is_extension": true, "is_mod_extension": [ false, - true + false ], "is_placeholder": [ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json index 11b089d297..31d0d87a84 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a05b1f919f24a67aae44b5b523186d772ec836c4ca0d3b1fa0c8cad12e22e5089f00", - "a0593a9c844064a2ca06cc1b8d7cdfd96efbe269854c1e45e7d7ac9d99b1ae43f900" + "a0dce3bb893ac0a04cd76e6c16beeb687c890038aaacaaff5ec6dd6081bfae521a00", + "a0804cc8e814123034ea541bf1505a53ba97826d2cc0563a00af086e77ee32d9e100" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a09fa7da5945e312a62501a28b587c166662de34380ca8b658a37fd0500ff504ea00", + "a03b84c68c5c2f0ae57338b04bef9d84c6a60460988de0ec8431243fafb061bf5b00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a063ccd6cd927659baddf18b3aa31a313efd3435095d3b3255f3c79d0ab792874a00", + "a0243ffa5e3afe85967fa2c3898411f282321ee7d71120bbd7968902a47c55b39700", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a063ccd6cd927659baddf18b3aa31a313efd3435095d3b3255f3c79d0ab792874aa066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a09fa7da5945e312a62501a28b587c166662de34380ca8b658a37fd0500ff504eaa066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0243ffa5e3afe85967fa2c3898411f282321ee7d71120bbd7968902a47c55b397a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a03b84c68c5c2f0ae57338b04bef9d84c6a60460988de0ec8431243fafb061bf5ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0227294955a65f5106b2bc9c8335b80f82aa191e65eac7311ff5bfa4bd74e44e000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0227294955a65f5106b2bc9c8335b80f82aa191e65eac7311ff5bfa4bd74e44e08080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a02f21ee785f3f4945b398869b9fdbf80a988cd4638080c534138c6c0b125880cc8080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0227294955a65f5106b2bc9c8335b80f82aa191e65eac7311ff5bfa4bd74e44e08080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a02f21ee785f3f4945b398869b9fdbf80a988cd4638080c534138c6c0b125880cc8080" ] }, { @@ -187,12 +189,13 @@ "is_extension": true, "is_mod_extension": [ false, - true + false ], "is_placeholder": [ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e5" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json index b0dbb1b7a7..bc01711e18 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a043126b2edd78cd909b662992ecdc2baca3fcd6f19838845ea8c9d0278248324e00", - "a01a44454781771343b4cb55194dd53a0e1765f1141981a53b93a28822b7170d3500" + "a07be7d711537387ab3d6be9621914205468460f0c0b46de4d1be1ede954afefa900", + "a038c92d7251e37ffcea5311631d7aa1f7e23fb8df348f7869014b71211bb0fcd000" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c1200", + "a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d200", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0a659e862fa10933c607c7fe06fe604aeef297aec137df792c05a14ed40ae8f8e00", + "a005cda6d36afe72e82e7ebef45272d0d69910f0bedd476dccd09a1e6f0b7c9b6400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0a659e862fa10933c607c7fe06fe604aeef297aec137df792c05a14ed40ae8f8ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c12a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a005cda6d36afe72e82e7ebef45272d0d69910f0bedd476dccd09a1e6f0b7c9b64a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a06601698b2b1c3b46d2a7e55874787a0b6e268334ec067878ec9bac45a410914e00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a06601698b2b1c3b46d2a7e55874787a0b6e268334ec067878ec9bac45a410914e8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a06601698b2b1c3b46d2a7e55874787a0b6e268334ec067878ec9bac45a410914e8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" ] }, { @@ -187,12 +189,13 @@ "is_extension": false, "is_mod_extension": [ false, - true + false ], "is_placeholder": [ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json index 9fd067af88..b6b8d98c73 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0877a59d83ad094431f4ced747c99b1ad4d3d018d4df2deb964de3b6393ece15c00", - "a01a44454781771343b4cb55194dd53a0e1765f1141981a53b93a28822b7170d3500" + "a00165aa0af332543a0d3fe661211bc5994ce5a3e614b425e64ecb1b2501b5417e00", + "a038c92d7251e37ffcea5311631d7aa1f7e23fb8df348f7869014b71211bb0fcd000" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c1200", + "a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d200", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a09b03fc2de3c936329b8e84ebabd633ed2a96122774237005e6b3e71a12002efc00", + "a0f4bb652318a0f15d555739d1ee4c32fd859663c3e2f381a993fc071921a0339900", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a09b03fc2de3c936329b8e84ebabd633ed2a96122774237005e6b3e71a12002efca066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c12a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0f4bb652318a0f15d555739d1ee4c32fd859663c3e2f381a993fc071921a03399a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0dd0d00c17fc4aeebf18a10b1c38bc63db7c507845addb89b38fb968de0bec2b700", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0dd0d00c17fc4aeebf18a10b1c38bc63db7c507845addb89b38fb968de0bec2b78080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0dd0d00c17fc4aeebf18a10b1c38bc63db7c507845addb89b38fb968de0bec2b78080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" ] }, { @@ -187,12 +189,13 @@ "is_extension": true, "is_mod_extension": [ false, - true + false ], "is_placeholder": [ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e5" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json index 09cc3f324e..9dd0cfe35a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a09799f89b1a8d886aa0abb14e3b17caa83d300e5ff13eac6d97fa9a95b77032c500", - "a0236380481fac5add6eadc8fbc388c95e6fe1ef3a73920471c1ea957409484a2200" + "a0fe93777900dd532b0109e40174eed05cfe84757ae3117cb54417975424e8cd7300", + "a0d5ab09aa0d188ce13d5401bb55f9849dc86433836f4c7f96c6b6326e5691919d00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a04707f71ed290b8e5be8b779a82c05a4a14fec40ae63fd283b1a9fe6f15e2a45700", + "a0720800eb9ebbb16205f1b83e2c427f3d503241ba170980ac4a01800c931e699500", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be0100", + "a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941d00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be01a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04707f71ed290b8e5be8b779a82c05a4a14fec40ae63fd283b1a9fe6f15e2a457a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0720800eb9ebbb16205f1b83e2c427f3d503241ba170980ac4a01800c931e6995a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a07fbdf0e81a0cf7826d6ef80d68dd85f91e51876f51f0c6ea1daf42f3162ca2798080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a07fbdf0e81a0cf7826d6ef80d68dd85f91e51876f51f0c6ea1daf42f3162ca2798080" ] }, { @@ -193,6 +195,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -248,6 +251,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -296,13 +300,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json index ca0333e637..ff4a566d99 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0276877d079439140def200c4f8964497d9ad05b300e2168f42402b61426c351d00", - "a0ae8e4d0c1d3f6c92c8c0e6c9477a9e6c2d2df5cdee3bb14e3d94894562268bc500" + "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", + "a0126b65c7395cd5e5be4e5d56de943a2451fa937e8bf58a07329a527cdb98937e00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a0f3cad22d55741b5a02cb06cf2c3c789879ad70025271f7348a4eed8a2996a4d600", + "a0de59aa84090924e14019ddc7a474760b00c6bde8826e060533c20e473ab9e4d600", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", + "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0f3cad22d55741b5a02cb06cf2c3c789879ad70025271f7348a4eed8a2996a4d6a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0de59aa84090924e14019ddc7a474760b00c6bde8826e060533c20e473ab9e4d6a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0a86128fac4cc091de8c60624410647010871a342aeb8845e664ce5ea5f9026d08080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0a86128fac4cc091de8c60624410647010871a342aeb8845e664ce5ea5f9026d08080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json index 7507f0fc95..aaf45c75c2 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0276877d079439140def200c4f8964497d9ad05b300e2168f42402b61426c351d00", - "a0816e8f7f5affaa1ae1bd70359c2e39d7d8a9a823f85ff04db4752db665ff8ece00" + "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", + "a02ebdc563953203aa4d483ec0b4c155279d3d67dd094f69b7287c1c5e6f57bb7200" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a02d2c27804cae1cabc7d2e9cfc855e23e1b7e1ef1dcb7ca2e6bc39c1d21c053fb00", + "a0ce2011879023724bf7232bbb674dcdb4bc08979934bc7c977b2daa454daa2bc800", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", + "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a02d2c27804cae1cabc7d2e9cfc855e23e1b7e1ef1dcb7ca2e6bc39c1d21c053fba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ce2011879023724bf7232bbb674dcdb4bc08979934bc7c977b2daa454daa2bc8a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0fb279ae949a1f68e723fd9859135fcefa3e37f46a8130aef66ffceedd475cd6a8080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0fb279ae949a1f68e723fd9859135fcefa3e37f46a8130aef66ffceedd475cd6a8080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json index ff92e73130..62ff36016f 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0276877d079439140def200c4f8964497d9ad05b300e2168f42402b61426c351d00", - "a0748eff20e2f71b6ad7bcfc70f229a2e7a8d32b3e095dd6cce70f71c8a6a3688200" + "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", + "a08d65425f1cbb59252a336d8dbade50f0d6b2bbcc01283d0f6042895db60d443d00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a0ac674d1b703b8824b26c9f9a9ffa957c517a9f6d6b36dbaacdc4253df9a9f32000", + "a0ba0b9d83deb6b898f1db064694abe5bb19e71f60309284408570c1701847615d00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", + "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ac674d1b703b8824b26c9f9a9ffa957c517a9f6d6b36dbaacdc4253df9a9f320a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ba0b9d83deb6b898f1db064694abe5bb19e71f60309284408570c1701847615da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0a270fe8b519da58761d8ad2a550ba083db50fc30c625260ed1cab8a5348c59198080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0a270fe8b519da58761d8ad2a550ba083db50fc30c625260ed1cab8a5348c59198080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json index 2eed640d50..cba3d93dbc 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a03d88f0b0dd1e0077645a2ed42eae02fb5b86e0b6fc2ecc1a3b38c211ac62a68400", - "a0a27c9991cc77a9764587418b1189a44c21d8c74ac40b8495f7c062dc44e8f71000" + "a0f2cd1783c504f66b8f37c580aaceb5dab5e84497572177995e861e22e3bce5df00", + "a0983976070bc780ea0729aabc34034e80f4521f8612258e654a2d7ee7593df32200" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a0bfe0c7caab351f5da526b2901d3616ec01278a814f4599ce2d840a9aa1c9ad1b00", + "a04624f128fd7c40d4f870ab0d0fdae13453d31bb332a6178a5297f1948320c3ae00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738b00", + "a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0bfe0c7caab351f5da526b2901d3616ec01278a814f4599ce2d840a9aa1c9ad1ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04624f128fd7c40d4f870ab0d0fdae13453d31bb332a6178a5297f1948320c3aea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03f0edc47ed07bac0b4f417e10d989deb422bfbd832cf994f5c04e2df50dfc4768080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03f0edc47ed07bac0b4f417e10d989deb422bfbd832cf994f5c04e2df50dfc4768080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e5" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json index b553528b90..9076e3d177 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a03d88f0b0dd1e0077645a2ed42eae02fb5b86e0b6fc2ecc1a3b38c211ac62a68400", - "a042e3533621f63d741a77fb8894b8f5ebaba6e7e12920a63e4df167b15d7f1e9a00" + "a0f2cd1783c504f66b8f37c580aaceb5dab5e84497572177995e861e22e3bce5df00", + "a03a6e6c9094f96af3099ccc150b7154cb0f1d9e0b86d243b92cbd8a36fa91436800" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a080ba1e579a6f530f3f5ef6e4f4ab90bbb0ad7021b958a445c778ba1223c3b6c900", + "a04776885f8215cc721fb6022eda3c960690e8a0b6dbbc214511e7e7e0027de4f200", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738b00", + "a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a080ba1e579a6f530f3f5ef6e4f4ab90bbb0ad7021b958a445c778ba1223c3b6c9a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04776885f8215cc721fb6022eda3c960690e8a0b6dbbc214511e7e7e0027de4f2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a07bd180a06d9476ff8a19a22be57c8a41ecc57b27b57e9c83aafe050929e485e88080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a07bd180a06d9476ff8a19a22be57c8a41ecc57b27b57e9c83aafe050929e485e88080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json index 19cefba4ac..9d3abf8df9 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a03d88f0b0dd1e0077645a2ed42eae02fb5b86e0b6fc2ecc1a3b38c211ac62a68400", - "a01b3cfffc0419846e5604df1ca51730500a0fb864d09ae9af5f9b3b9a19393b5100" + "a0f2cd1783c504f66b8f37c580aaceb5dab5e84497572177995e861e22e3bce5df00", + "a0c146b6beed1fa6da815e9d20bd312e0a5dce7b0bfa8f876007e73171aee75ead00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a04d805944bb5a1e60c04931be76b0f2164b7a52e9a73cb9b7094f873b31bdfe0500", + "a0dba517c04418b0e35c17fb1db2698283882f72fbdd68f7562006648db5afc7f000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738b00", + "a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04d805944bb5a1e60c04931be76b0f2164b7a52e9a73cb9b7094f873b31bdfe05a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0dba517c04418b0e35c17fb1db2698283882f72fbdd68f7562006648db5afc7f0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03fb632d1b373bfe19c0b83f1f62fbfc631dda6c1d02e16d98ffa6968209c5c428080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03fb632d1b373bfe19c0b83f1f62fbfc631dda6c1d02e16d98ffa6968209c5c428080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json index fb732983ce..0ebf597ebc 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0276877d079439140def200c4f8964497d9ad05b300e2168f42402b61426c351d00", - "a0fdbe173312412e254e8e57116f6653d849572bd5e3d2a3304fc75556ca0a85b700" + "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", + "a0e1583fd2dcb686b942aa7f2b9ce00d874e77b3abf54c4103ce6cf768707322c900" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a04302d4fa284e1825678b91c7f7a21ce8e450049efeb512c5969b890b39e6f01300", + "a0ad2bedbc0f8c43da33f5211dd8a01f8df97c4f1a21690c9a14970adf41860bfa00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", + "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04302d4fa284e1825678b91c7f7a21ce8e450049efeb512c5969b890b39e6f013a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ad2bedbc0f8c43da33f5211dd8a01f8df97c4f1a21690c9a14970adf41860bfaa066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03c376d903a16b0f15fc878e3cf248541c0195d256ae44ccda3861ed784a327f78080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03c376d903a16b0f15fc878e3cf248541c0195d256ae44ccda3861ed784a327f78080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": true, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e5" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json index d8ef8d11e6..c6dd9ff696 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0276877d079439140def200c4f8964497d9ad05b300e2168f42402b61426c351d00", - "a029ea2cfd79ac67a8e72eb8ed313bac66f5c9d88119b5490ae35c9c4d773a260d00" + "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", + "a0b56337f1538767ab36ed8256c14420eea15d3c1a6b4ec6cab35d41154087bff100" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -42,10 +43,10 @@ "storage": null, "mod_extension": null, "values": [ - "a090b0b99e6bfda6f21367140879cf5bab6e8e3dc87075f3556a33dfc722536b4c00", + "a09bd74bc59a41096445c13404fdd1ecc6da241a20356ad3d204222e791afbbc0d00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", + "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a090b0b99e6bfda6f21367140879cf5bab6e8e3dc87075f3556a33dfc722536b4ca066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a09bd74bc59a41096445c13404fdd1ecc6da241a20356ad3d204222e791afbbc0da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -88,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f851", - "f851" + "f871", + "f871" ] } }, @@ -110,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -120,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a06d02ace83a9377574bc546acce6ae3264e34e0d09294116f102263e5a36039a38080" + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a06d02ace83a9377574bc546acce6ae3264e34e0d09294116f102263e5a36039a38080" ] }, { @@ -186,13 +188,14 @@ "extension_branch": { "is_extension": false, "is_mod_extension": [ - true, + false, false ], "is_placeholder": [ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelOneKeyByte.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelOneKeyByte.json index 5c46ce21df..6b665ee155 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelOneKeyByte.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelOneKeyByte.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -466,6 +474,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelTwoKeyBytes.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelTwoKeyBytes.json index 6d9002795f..449e23f11d 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelTwoKeyBytes.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedInFirstStorageLevelTwoKeyBytes.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -466,6 +474,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel1.json index 658f6ed282..19640c75ea 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel2.json index 1398f90aac..bcf140548c 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedOneKeyByteSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedThreeKeyBytesSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedThreeKeyBytesSel2.json index c8ede7771d..79050a49b4 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedThreeKeyBytesSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedThreeKeyBytesSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel1.json index d39cca0189..8005851a49 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel2.json index c212f973c8..d91942174a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionAddedTwoKeyBytesSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel1.json index e4d45d418d..22afaba500 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel2.json index 29391330b5..1b3e97ade8 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedOneKeyByteSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedThreeKeyBytesSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedThreeKeyBytesSel2.json index 9a738b27b3..3df8211376 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedThreeKeyBytesSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedThreeKeyBytesSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel1.json index fd4cfbfb62..a8a79b3232 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel2.json index 7744486414..c1bc991e65 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionDeletedTwoKeyBytesSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevel.json index 883fc5f363..c03830ae4d 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevel.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelOneKeyByte.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelOneKeyByte.json index 7cbb712fd1..ea61e15bd3 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelOneKeyByte.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelOneKeyByte.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -466,6 +474,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelTwoKeyBytes.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelTwoKeyBytes.json index f49fc82cef..a382ac0d77 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelTwoKeyBytes.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionInFirstStorageLevelTwoKeyBytes.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -466,6 +474,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json new file mode 100644 index 0000000000..c9b1a51072 --- /dev/null +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json @@ -0,0 +1,362 @@ +[ + { + "start": { + "disable_preimage_check": true, + "proof_type": "StorageChanged" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0198ecef2b1da18c37fa6e435336eafdd4a7955ebf9dcb61f8a486c64ccc61eb900", + "a0104d2b3a224f2a20987a5d9bf81f5d8fd3f61f1de4c6cc48b0d7934fa330a0c100" + ], + "keccak_data": [] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 13, + "drifted_index": 13, + "list_rlp_bytes": [ + "f90111", + "f90111" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0df9727eeee3dbaceec09f27569ca580783fb93f4eabce11d5667d8f6a70fb3e600", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", + "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", + "a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580900", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a02ac00ba4cde24327d8f82b45197129b9911da57cdd16a7cefe0a524bcd7345e200", + "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a02ac00ba4cde24327d8f82b45197129b9911da57cdd16a7cefe0a524bcd7345e2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0df9727eeee3dbaceec09f27569ca580783fb93f4eabce11d5667d8f6a70fb3e6a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 14, + "drifted_index": 14, + "list_rlp_bytes": [ + "f871", + "f871" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a03904685eec6d8d3e6357c1a7c0e34fbb9bbe036eb34d88b4187e5f73acd1221400", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0444f38b75c480b42c37fa40b55a95411c163fd1d675363c70f1ca2f15a8ae0db00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0444f38b75c480b42c37fa40b55a95411c163fd1d675363c70f1ca2f15a8ae0db8080", + "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03904685eec6d8d3e6357c1a7c0e34fbb9bbe036eb34d88b4187e5f73acd122148080" + ] + }, + { + "start": null, + "extension_branch": null, + "account": { + "address": "50efbf12580138bc623c95757286df4e24eb81c9", + "key": "de78f6b8c63d212dc53ac48185d23080e4df5a698fe337dddb6fe3e7784c81b8", + "list_rlp_bytes": [ + "f869", + "f869" + ], + "value_rlp_bytes": [ + "b846", + "b846" + ], + "value_list_rlp_bytes": [ + "f844", + "f844" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "f869", + "is_mod_extension": [ + false, + false + ], + "mod_list_rlp_bytes": [ + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "storage": null, + "mod_extension": null, + "values": [ + "a02078f6b8c63d212dc53ac48185d23080e4df5a698fe337dddb6fe3e7784c81b800", + "a02078f6b8c63d212dc53ac48185d23080e4df5a698fe337dddb6fe3e7784c81b800", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a045b9ce799720f57d6324f7232363499b06cafd7c86ad6fc0ad174c7c376a377100", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0e37a2f57d1dc50340ff2ce97093b5452922d1f76d1ef37a0cb16a6a7466c2c1900", + "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a02078f6b8c63d212dc53ac48185d23080e4df5a698fe337dddb6fe3e7784c81b800", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f869a02078f6b8c63d212dc53ac48185d23080e4df5a698fe337dddb6fe3e7784c81b8b846f8448080a045b9ce799720f57d6324f7232363499b06cafd7c86ad6fc0ad174c7c376a3771a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "f869a02078f6b8c63d212dc53ac48185d23080e4df5a698fe337dddb6fe3e7784c81b8b846f8448080a0e37a2f57d1dc50340ff2ce97093b5452922d1f76d1ef37a0cb16a6a7466c2c19a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "50efbf12580138bc623c95757286df4e24eb81c9" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 1, + "drifted_index": 1, + "list_rlp_bytes": [ + "f851", + "f851" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a091c1f425408320632f89fe716a3fc6f66641a57d048f68616e1a17b3a506aed300", + "a051786a8d3bc13523fe2a4a4de42ba891617b2aad3a2da9a0681c6efa2263f43400", + "a010344283684ed0865853499c2c9eb40203635fec6656cde11e3dbbefeccc8e7600", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f851a051786a8d3bc13523fe2a4a4de42ba891617b2aad3a2da9a0681c6efa2263f434a010344283684ed0865853499c2c9eb40203635fec6656cde11e3dbbefeccc8e76808080808080808080808080808080", + "f851a051786a8d3bc13523fe2a4a4de42ba891617b2aad3a2da9a0681c6efa2263f434a091c1f425408320632f89fe716a3fc6f66641a57d048f68616e1a17b3a506aed3808080808080808080808080808080" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + true, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 4, + "drifted_index": 2, + "list_rlp_bytes": [ + "f851", + "f851" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a061fde1340b9ba964a5cc430816b50596fc20257286b2d5986246d6d5620f361500", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a08e6f2a67b86487fc1554460ca767535156ba7150fdfa256a28cc859ed2cc959a00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a061fde1340b9ba964a5cc430816b50596fc20257286b2d5986246d6d5620f361500", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f8518080a08e6f2a67b86487fc1554460ca767535156ba7150fdfa256a28cc859ed2cc959a80a061fde1340b9ba964a5cc430816b50596fc20257286b2d5986246d6d5620f3615808080808080808080808080", + "f8518080a08e6f2a67b86487fc1554460ca767535156ba7150fdfa256a28cc859ed2cc959a80a061fde1340b9ba964a5cc430816b50596fc20257286b2d5986246d6d5620f3615808080808080808080808080" + ] + }, + { + "start": null, + "extension_branch": null, + "account": null, + "storage": { + "address": "1434563000000000000000000000000000000000000000000000000000000000", + "key": "1434563000000000000000000000000000000000000000000000000000000000", + "list_rlp_bytes": [ + "e2", + "e4" + ], + "value_rlp_bytes": [ + "00", + "82" + ], + "drifted_rlp_bytes": "00", + "wrong_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000", + "is_mod_extension": [ + true, + false + ], + "mod_list_rlp_bytes": [ + "e2", + "e2" + ] + }, + "mod_extension": null, + "values": [ + "a0203456300000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a0203456300000000000000000000000000000000000000000000000000000000000", + "81bb0000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "12000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a08e6f2a67b86487fc1554460ca767535156ba7150fdfa256a28cc859ed2cc959a00", + "12000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "a08e6f2a67b86487fc1554460ca767535156ba7150fdfa256a28cc859ed2cc959a00" + ], + "keccak_data": [ + "e4a020345630000000000000000000000000000000000000000000000000000000008281bb", + "e4a020345630000000000000000000000000000000000000000000000000000000008281bb", + "1434563000000000000000000000000000000000000000000000000000000000", + "e212a08e6f2a67b86487fc1554460ca767535156ba7150fdfa256a28cc859ed2cc959a", + "00000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + { + "start": { + "disable_preimage_check": false, + "proof_type": "Disabled" + }, + "extension_branch": null, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0000000000000000000000000000000000000000000000000000000000000000000", + "a0000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [] + } +] \ No newline at end of file diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionOneKeyByteSel1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionOneKeyByteSel1.json index 109366a5dc..54c4e243b2 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionOneKeyByteSel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionOneKeyByteSel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e2" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytes.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytes.json index 7590919923..e752bb3b33 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytes.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytes.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytesSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytesSel2.json index b0a438dde0..cec06e5fc9 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytesSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionThreeKeyBytesSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel1.json index a58d1453d1..659fa51300 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel2.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel2.json index 702c7277df..f175299272 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel2.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionTwoKeyBytesSel2.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "e4" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/FromNilToValue.json b/zkevm-circuits/src/mpt_circuit/tests/FromNilToValue.json index ec40c3e209..ef0065d670 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/FromNilToValue.json +++ b/zkevm-circuits/src/mpt_circuit/tests/FromNilToValue.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithBalance.json b/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithBalance.json index 8dfae428e9..9c13bba63d 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithBalance.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithBalance.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithCodeHash.json b/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithCodeHash.json index b324cb71bb..374be747da 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithCodeHash.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithCodeHash.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithNonce.json b/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithNonce.json index 97d480d8a2..9dc4daf2c9 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithNonce.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ImplicitlyCreateAccountWithNonce.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/LeafAddedToEmptyTrie.json b/zkevm-circuits/src/mpt_circuit/tests/LeafAddedToEmptyTrie.json index b8c599d281..0e45a6ee33 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/LeafAddedToEmptyTrie.json +++ b/zkevm-circuits/src/mpt_circuit/tests/LeafAddedToEmptyTrie.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/LeafInLastLevel.json b/zkevm-circuits/src/mpt_circuit/tests/LeafInLastLevel.json index 10046eb8eb..a8126086cb 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/LeafInLastLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/LeafInLastLevel.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -303,6 +307,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "f7" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/LeafWithMoreNibbles.json b/zkevm-circuits/src/mpt_circuit/tests/LeafWithMoreNibbles.json index 587b6c0c32..12c74111df 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/LeafWithMoreNibbles.json +++ b/zkevm-circuits/src/mpt_circuit/tests/LeafWithMoreNibbles.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -303,6 +307,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "f7" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/LeafWithOneNibble.json b/zkevm-circuits/src/mpt_circuit/tests/LeafWithOneNibble.json index 92b2c68e9b..4888c1f810 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/LeafWithOneNibble.json +++ b/zkevm-circuits/src/mpt_circuit/tests/LeafWithOneNibble.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -303,6 +307,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "f7" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/LongKey.json b/zkevm-circuits/src/mpt_circuit/tests/LongKey.json index f4a088bb82..29cac305eb 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/LongKey.json +++ b/zkevm-circuits/src/mpt_circuit/tests/LongKey.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -413,6 +419,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NeighbourNodeInHashedBranch.json b/zkevm-circuits/src/mpt_circuit/tests/NeighbourNodeInHashedBranch.json index a86c9cc1e4..e851e50841 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NeighbourNodeInHashedBranch.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NeighbourNodeInHashedBranch.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -413,6 +419,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, true ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccount.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccount.json index f2966d365d..7fda7738d6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccount.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccount.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json index d977faae41..79afcb98d9 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a06d97588c118770972c4f6b20f6ca9c780a898083abccef90a90c99404695f1dd00", - "a06d97588c118770972c4f6b20f6ca9c780a898083abccef90a90c99404695f1dd00" + "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", + "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -45,7 +46,7 @@ "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObject.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObject.json index 04e4b53cd6..88e171ef55 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObject.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObject.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json index 9a887e686a..9bb03688d6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a06d97588c118770972c4f6b20f6ca9c780a898083abccef90a90c99404695f1dd00", - "a06d97588c118770972c4f6b20f6ca9c780a898083abccef90a90c99404695f1dd00" + "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", + "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90111", + "f90111" ] } }, @@ -45,7 +46,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorage.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorage.json index 921b9702f0..26267af4d8 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorage.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorage.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageLong.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageLong.json index 5cd6444ed2..0c85e06914 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageNil.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageNil.json index 4d7191d097..1548d9fb73 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageNil.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingStorageNil.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -553,8 +561,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "e2a03100000000000000000000000000000000000000000000000000000000000000", - "e2a03100000000000000000000000000000000000000000000000000000000000000", + "e2a0310000000000000000000000000000000000000000000000000000000000000000", + "e2a0310000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000022" ] }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonceModCLong.json b/zkevm-circuits/src/mpt_circuit/tests/NonceModCLong.json index eb15c38eae..3f7afac8f6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonceModCLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonceModCLong.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonceModCShort.json b/zkevm-circuits/src/mpt_circuit/tests/NonceModCShort.json index f4c3623761..2b93af17de 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonceModCShort.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonceModCShort.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/OnlyLeafInStorageProof.json b/zkevm-circuits/src/mpt_circuit/tests/OnlyLeafInStorageProof.json index 1803e9e71f..b91b52d2ff 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/OnlyLeafInStorageProof.json +++ b/zkevm-circuits/src/mpt_circuit/tests/OnlyLeafInStorageProof.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageDoesNotExistOnlySProof.json b/zkevm-circuits/src/mpt_circuit/tests/StorageDoesNotExistOnlySProof.json index ad5a9c33e7..c783149c2a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageDoesNotExistOnlySProof.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageDoesNotExistOnlySProof.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -444,6 +450,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -499,6 +506,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -554,6 +562,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -609,6 +618,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -664,6 +674,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -719,6 +730,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -861,8 +873,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "e3a12000000000000000000000000000000000000000000000000000000000000000", - "e3a12000000000000000000000000000000000000000000000000000000000000000", + "e3a1200000000000000000000000000000000000000000000000000000000000000000", + "e3a1200000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ] }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json index d53e431713..728de076eb 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0da76bf85fa1464f5642cc457dd6a9a3137e8850f339d7762db55756651c3e1b400", - "a0da76bf85fa1464f5642cc457dd6a9a3137e8850f339d7762db55756651c3e1b400" + "a0e36357ff21583b48c9625a721f0f546330d24c6c0d239108cc21217cd61406c900", + "a0e36357ff21583b48c9625a721f0f546330d24c6c0d239108cc21217cd61406c900" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90151", - "f90151" + "f90131", + "f90131" ] } }, @@ -45,7 +46,7 @@ "a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d00", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d00", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9015180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80", - "f9015180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80" + "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80", + "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json index 911c3cf46a..b5dbd034e0 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0e0a100b6366d47ecd53c1791968fa101b5ff1f473233e7bf65f31091eb10dde800", - "a0e0a100b6366d47ecd53c1791968fa101b5ff1f473233e7bf65f31091eb10dde800" + "a0601c8ae613f946a293f9aacd219cc6ca8d572b2654c55f06d100d3ed1e0490fd00", + "a0601c8ae613f946a293f9aacd219cc6ca8d572b2654c55f06d100d3ed1e0490fd00" ], "keccak_data": [] }, @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -33,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90151", - "f90151" + "f90131", + "f90131" ] } }, @@ -45,7 +46,7 @@ "a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381100", "80000000000000000000000000000000000000000000000000000000000000000000", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", - "a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31000", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a0400", "a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f400", @@ -56,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", + "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381100", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -65,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9015180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180", - "f9015180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf1a02bd9ab5b41379c7e214b0dc3dc01d30502817a812564359ef730a80e6568d31080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180" + "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180", + "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageLeafInFirstLevelAfterPlaceholder.json b/zkevm-circuits/src/mpt_circuit/tests/StorageLeafInFirstLevelAfterPlaceholder.json index 9bea0c11ea..1ea91e4c16 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageLeafInFirstLevelAfterPlaceholder.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageLeafInFirstLevelAfterPlaceholder.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistLongVal.json b/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistLongVal.json index f109b39bf3..41dc65d0b4 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistLongVal.json +++ b/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistLongVal.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistShortVal.json b/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistShortVal.json index 43dbd02d67..9602022a63 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistShortVal.json +++ b/zkevm-circuits/src/mpt_circuit/tests/TrieDoesNotExistShortVal.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel.json index 4c7d55d7f5..6dc68799a6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel1.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel1.json index 07d173749f..ef7074ff4c 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevel1.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelBigVal.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelBigVal.json index 387e696803..85b35db0df 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelBigVal.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelBigVal.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelEvenAddress.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelEvenAddress.json index 392e1ede7c..d7dede7a4b 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelEvenAddress.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateOneLevelEvenAddress.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateThreeLevels.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateThreeLevels.json index d51100ab97..9163d887ab 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateThreeLevels.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateThreeLevels.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -578,6 +587,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -633,6 +643,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevels.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevels.json index f2108cef0d..7c1c93a475 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevels.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevels.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevelsBigVal.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevelsBigVal.json index 3015bb3ff2..a22d8def2d 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevelsBigVal.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoLevelsBigVal.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -468,6 +475,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoModifications.json b/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoModifications.json index 1dec0d149e..df270cce22 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoModifications.json +++ b/zkevm-circuits/src/mpt_circuit/tests/UpdateTwoModifications.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -356,6 +362,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -411,6 +418,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -523,6 +531,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -655,6 +664,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -710,6 +720,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -765,6 +776,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -820,6 +832,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -875,6 +888,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -930,6 +944,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -985,6 +1000,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -1040,6 +1056,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -1152,6 +1169,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/WrongAccount.json b/zkevm-circuits/src/mpt_circuit/tests/WrongAccount.json index 013f70338d..a86f5e665e 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/WrongAccount.json +++ b/zkevm-circuits/src/mpt_circuit/tests/WrongAccount.json @@ -26,6 +26,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -81,6 +82,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -136,6 +138,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -191,6 +194,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -246,6 +250,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -301,6 +306,7 @@ true, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -444,6 +450,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -499,6 +506,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -554,6 +562,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -609,6 +618,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -664,6 +674,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -719,6 +730,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -861,6 +873,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -916,6 +929,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -971,6 +985,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -1026,6 +1041,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -1081,6 +1097,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, @@ -1136,6 +1153,7 @@ false, false ], + "is_last_level_and_wrong_ext_case": false, "extension": { "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" }, diff --git a/zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json deleted file mode 100644 index 58c6c32bae..0000000000 --- a/zkevm-circuits/src/mpt_circuit/tests/WrongExtensionNode.json +++ /dev/null @@ -1,413 +0,0 @@ -[ - { - "start": { - "disable_preimage_check": true, - "proof_type": "StorageDoesNotExist" - }, - "extension_branch": null, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200", - "a09cfa792154469ff54b3768a91424e6f86e43fab348c189b266e95da89f0ff4c200" - ], - "keccak_data": [] - }, - { - "start": null, - "extension_branch": { - "is_extension": false, - "is_mod_extension": [ - false, - false - ], - "is_placeholder": [ - false, - false - ], - "extension": { - "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" - }, - "branch": { - "modified_index": 0, - "drifted_index": 0, - "list_rlp_bytes": [ - "f90211", - "f90211" - ] - } - }, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", - "a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e1000", - "a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bd00", - "a0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf002100", - "a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e000", - "a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d84464800", - "a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e700", - "a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92d00", - "a0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb72100", - "a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd7168100", - "a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec8447200", - "a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8e00", - "a09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc220800", - "a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94ec00", - "a07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df47500", - "a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a000", - "a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb00", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [ - "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80", - "f90211a0a338569f5b4c2617e94d7b461980cc40f87ae677b560df6f2ff960e488ae4e10a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80" - ] - }, - { - "start": null, - "extension_branch": { - "is_extension": false, - "is_mod_extension": [ - false, - false - ], - "is_placeholder": [ - false, - false - ], - "extension": { - "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" - }, - "branch": { - "modified_index": 15, - "drifted_index": 15, - "list_rlp_bytes": [ - "f90211", - "f90211" - ] - } - }, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", - "a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063e00", - "a033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b900", - "a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f91400", - "a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c900", - "a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6b00", - "a08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef700", - "a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb76600", - "a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e100", - "a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef5681115500", - "a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f200", - "a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a38360000", - "a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b1700", - "a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abace00", - "a00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f500", - "a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d400", - "a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468500", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [ - "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580", - "f90211a0e45a9e85cab1b6eb18b30df2c6acc448bbac6a30d81646823b31223e16e5063ea033bd7171d556b981f6849064eb09412b24fedc0812127db936067043f53db1b9a0ca56945f074da4f15587404593faf3a50d17ea0e21a418ad6ec99bdf4bf3f914a0da23e9004f782df128eea1adff77952dc85f91b7f7ca4893aac5f21d24c3a1c9a0ba5ec61fa780ee02af19db99677c37560fc4f0df5c278d9dfa2837f30f72bc6ba08310ad91625c2e3429a74066b7e2e0c958325e4e7fa3ec486b73b7c8300cfef7a0732e5c103bf4d5adfef83773026809d9405539b67e93293a02342e83ad2fb766a030d14ff0c2aab57d1fbaf498ab14519b4e9d94f149a3dc15f0eec5adf8df25e1a038f4db0ccaf2e3ecefec2c38e903dfc52033806102d36fd2b9aa21ef56811155a05a43bd92e55aa78df60e70b6b53b6366c4080fd6a5bdd7b533b46aff4a75f6f2a0a0c410aa59efe416b1213166fab680ce330bd46c3ebf877ff14609ee6a383600a02f41e918786e557293068b1eda9b3f9f86ed4e65a6a5363ee3262109f6e08b17a001f42a40f02f6f24bb97b09c4d3934e8b03be7cfbb902acc1c8fd67a7a5abacea00acbdce2787a6ea177209bd13bfc9d0779d7e2b5249e0211a2974164e14312f5a0dadbe113e4132e0c0c3cd4867e0a2044d0e5a3d44b350677ed42fc9244d004d4a06184c5229b2aad6b212365a7fa829677c78e0404597811fdfcbe37760976468580" - ] - }, - { - "start": null, - "extension_branch": { - "is_extension": false, - "is_mod_extension": [ - false, - false - ], - "is_placeholder": [ - false, - false - ], - "extension": { - "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" - }, - "branch": { - "modified_index": 2, - "drifted_index": 2, - "list_rlp_bytes": [ - "f901b1", - "f901b1" - ] - } - }, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", - "a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218a00", - "a019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e800", - "a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24200", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a11000", - "a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa61500", - "a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96400", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecc00", - "a0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d42468289295100", - "a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d5100", - "a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca00", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0be00", - "a080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd1165500", - "a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153400", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [ - "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480", - "f901b1a063b12612d289f8800d79b045bfebcebfb575b1de0e105fcc6ed000a3b681218aa019d297f57cf479fc7e2d774b7fecb2c323e7cc23c0865b4f39843d8d755eb3e8a0d57ae600726ec499eab19bc2d1bcecaf7cb3012774f24b4b7c08e6cbb04ad24280a087e1e054dc75d06145bf158b7c746d35586ea0ea64b4943b092c7657f268a110a049b3e569f9d418875fd44d4229cf721b7279e987addbd33ccd400ca5ed5fa615a0dbe00d606478b8e631b340e94a0ce269f784cc8eb28a404324ebf9fdfb4df96480a0903ba3bcfdd428a7ccd89390cea3c243dbff5041423e0be3729bb54444805ecca0cd3f06248b9f8b5144e2a3e4d00bcd716f912dbba8cc2df0192d424682892951a063c3b649ef9f70cb8bc3e17a9c97bebdca7c6d278f0e91b8860d6d4ae4996d51a0fd2dfee971a13227c533b827c63de3946c2f13d54e15a3295856f93f793f4bca80a07da50003001a681080d1857e5bb585522c7869aa1ac71f1d8625a6220ff9b0bea080f0de734d631d5e27e1bb7b5712461617aa759e7d80fcea708345443bd11655a07f64010b162255f7b3cb0a3c58691fc4de275bf09d43ed597a983ff5ddaf153480" - ] - }, - { - "start": null, - "extension_branch": { - "is_extension": false, - "is_mod_extension": [ - false, - false - ], - "is_placeholder": [ - false, - false - ], - "extension": { - "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" - }, - "branch": { - "modified_index": 6, - "drifted_index": 6, - "list_rlp_bytes": [ - "f891", - "f891" - ] - } - }, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b16300", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f7100", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf00", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f00", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [ - "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080", - "f8918080a0ee9ac94d62c4c8cc79dd318661e827a072a08d1e72fc1ad61c3a34e22ec9b163808080a0aa6f12742de82c56b0091bd3c424a8d8e3f455cf704968d3f3e7bbdb86e97f718080a0dae35f34d52d840f886acc959882bd4bc3efd964258348cc12ea17a3c798e3bf808080a09c8b167e43eb32dffe9cb219d0851375a4aa157b0a6596c2bad23599575e586f808080" - ] - }, - { - "start": null, - "extension_branch": null, - "account": { - "address": "40efbf12580138bc623c95757286df4e24eb81c9", - "key": "0f266f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e", - "list_rlp_bytes": [ - "f868", - "f868" - ], - "value_rlp_bytes": [ - "b846", - "b846" - ], - "value_list_rlp_bytes": [ - "f844", - "f844" - ], - "drifted_rlp_bytes": "00", - "wrong_rlp_bytes": "f868", - "is_mod_extension": [ - false, - false - ], - "mod_list_rlp_bytes": [ - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ] - }, - "storage": null, - "mod_extension": null, - "values": [ - "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", - "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", - "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c50500", - "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "9f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6e0000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [ - "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "f8689f206f5398c792c50d07f79e8dec3c1da167a9a305a781a8f9c263fbbc066c6eb846f8448080a0ff54dd129857d7eb12d75c536439aef73d55019a84c862bacec6888f5ef9c505a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "40efbf12580138bc623c95757286df4e24eb81c9" - ] - }, - { - "start": null, - "extension_branch": { - "is_extension": true, - "is_mod_extension": [ - false, - false - ], - "is_placeholder": [ - false, - false - ], - "extension": { - "list_rlp_bytes": "e4" - }, - "branch": { - "modified_index": 0, - "drifted_index": 0, - "list_rlp_bytes": [ - "f851", - "f851" - ] - } - }, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", - "a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d300", - "a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d100", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", - "82112300000000000000000000000000000000000000000000000000000000000000", - "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900", - "00000300000000000000000000000000000000000000000000000000000000000000", - "a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e3900" - ], - "keccak_data": [ - "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", - "f851a0f4f5001be91d809ea3e4b9c1fae4e2cde977620fb7abbbb6ac7173bea7d921d3a048e51f7b2e1a3f18f28eb7fc2f6f63ff007695c47da57604bd95cadd818df0d1808080808080808080808080808080", - "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39", - "e4821123a01878e8bf339547d494447a5bb5879c5258e73d54144731c8222c278380c05e39" - ] - }, - { - "start": null, - "extension_branch": null, - "account": null, - "storage": { - "address": "1200000000000000000000000000000000000000000000000000000000000000", - "key": "1200000000000000000000000000000000000000000000000000000000000000", - "list_rlp_bytes": [ - "f6", - "f6" - ], - "value_rlp_bytes": [ - "95", - "95" - ], - "drifted_rlp_bytes": "00", - "wrong_rlp_bytes": "e2", - "is_mod_extension": [ - false, - false - ], - "mod_list_rlp_bytes": [ - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ] - }, - "mod_extension": null, - "values": [ - "9f200000000000000000000000000000000000000000000000000000000000000000", - "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", - "9f200000000000000000000000000000000000000000000000000000000000000000", - "94ce9f6c9634165f91e22e58b90e3ede393d959e4700000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "a1201200000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [ - "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", - "f69f200000000000000000000000000000000000000000000000000000000000009594ce9f6c9634165f91e22e58b90e3ede393d959e47", - "1200000000000000000000000000000000000000000000000000000000000000" - ] - }, - { - "start": { - "disable_preimage_check": false, - "proof_type": "Disabled" - }, - "extension_branch": null, - "account": null, - "storage": null, - "mod_extension": null, - "values": [ - "a0000000000000000000000000000000000000000000000000000000000000000000", - "a0000000000000000000000000000000000000000000000000000000000000000000" - ], - "keccak_data": [] - } -] \ No newline at end of file From b38ab98b6ace8bf52543d96fb1e7e9baddd187a3 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 17 Apr 2024 12:04:35 +0200 Subject: [PATCH 34/43] gofmt --- geth-utils/gethutil/mpt/state/statedb.go | 2 +- geth-utils/gethutil/mpt/witness/branch.go | 12 ++++++------ .../gen_witness_from_local_blockchain_test.go | 2 +- geth-utils/gethutil/mpt/witness/leaf.go | 12 ++++++------ geth-utils/gethutil/mpt/witness/nodes.go | 10 +++++----- geth-utils/gethutil/mpt/witness/prepare_witness.go | 10 +++++----- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/geth-utils/gethutil/mpt/state/statedb.go b/geth-utils/gethutil/mpt/state/statedb.go index 12414c504d..68619e8547 100644 --- a/geth-utils/gethutil/mpt/state/statedb.go +++ b/geth-utils/gethutil/mpt/state/statedb.go @@ -544,7 +544,7 @@ func (s *StateDB) updateStateObject(obj *stateObject) { if err != nil { panic(fmt.Errorf("can't encode object at %x: %v", addr[:], err)) } - + if !oracle.AccountPreventHashingInSecureTrie { if err = s.trie.TryUpdateAlwaysHash(addr[:], data); err != nil { s.setError(fmt.Errorf("updateStateObject (%x) error: %v", addr[:], err)) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 2d3b93343d..6cd204d119 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -113,11 +113,11 @@ func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []b } extensionBranch := ExtensionBranchNode{ - IsExtension: isExtension, - IsPlaceholder: [2]bool{isBranchSPlaceholder, isBranchCPlaceholder}, - IsLastLevelAndWrongExtCase: isLastLevel, - Extension: extensionNode, - Branch: branchNode, + IsExtension: isExtension, + IsPlaceholder: [2]bool{isBranchSPlaceholder, isBranchCPlaceholder}, + IsLastLevelAndWrongExtCase: isLastLevel, + Extension: extensionNode, + Branch: branchNode, } values := make([][]byte, 17) @@ -199,7 +199,7 @@ func getNibbles(leafKeyRow []byte) []byte { // getDriftedPosition returns the position in branch to which the leaf drifted because another // leaf has been added to the same slot. This information is stored into a branch init row. func getDriftedPosition(leafKeyRow []byte, numberOfNibbles int) byte { - nibbles := getNibbles(leafKeyRow) + nibbles := getNibbles(leafKeyRow) return nibbles[numberOfNibbles] } diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go index b98ea2c651..bf4f87cc78 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_local_blockchain_test.go @@ -1007,7 +1007,7 @@ func TestAccountWrongExtensionNode(t *testing.T) { trieMod := TrieModification{ Type: AccountDoesNotExist, - Address: addr3, + Address: addr3, } trieModifications := []TrieModification{trieMod} diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index 84772c8fc8..fc6f1ad51a 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -585,7 +585,7 @@ func equipLeafWithWrongExtension(leafNode Node, keyMiddle, keyAfter, nibblesMidd leafNode.Values[l-modifiedExtensionNodeRowLen] = keyMiddle startNibblePos := 2 // we don't need any nibbles for case keyLen = 1 if len(keyMiddle) > 1 { - if len(nibblesMiddle) % 2 == 0 { + if len(nibblesMiddle)%2 == 0 { startNibblePos = 1 } else { startNibblePos = 2 @@ -593,14 +593,14 @@ func equipLeafWithWrongExtension(leafNode Node, keyMiddle, keyAfter, nibblesMidd } ind := 0 for j := startNibblePos; j < len(nibblesMiddle); j += 2 { - leafNode.Values[l-modifiedExtensionNodeRowLen + 1][2+ind] = nibblesMiddle[j] + leafNode.Values[l-modifiedExtensionNodeRowLen+1][2+ind] = nibblesMiddle[j] ind++ } - leafNode.Values[l-modifiedExtensionNodeRowLen + 3] = keyAfter + leafNode.Values[l-modifiedExtensionNodeRowLen+3] = keyAfter startNibblePos = 2 // we don't need any nibbles for case keyLen = 1 if len(keyAfter) > 1 { - if len(nibblesAfter) % 2 == 0 { + if len(nibblesAfter)%2 == 0 { startNibblePos = 1 } else { startNibblePos = 2 @@ -608,9 +608,9 @@ func equipLeafWithWrongExtension(leafNode Node, keyMiddle, keyAfter, nibblesMidd } ind = 0 for j := startNibblePos; j < len(nibblesAfter); j += 2 { - leafNode.Values[l-modifiedExtensionNodeRowLen + 4][2+ind] = nibblesAfter[j] + leafNode.Values[l-modifiedExtensionNodeRowLen+4][2+ind] = nibblesAfter[j] ind++ } return leafNode -} \ No newline at end of file +} diff --git a/geth-utils/gethutil/mpt/witness/nodes.go b/geth-utils/gethutil/mpt/witness/nodes.go index 4896ba7d89..90ec1e3eca 100644 --- a/geth-utils/gethutil/mpt/witness/nodes.go +++ b/geth-utils/gethutil/mpt/witness/nodes.go @@ -68,11 +68,11 @@ type ExtensionBranchNode struct { // extension node. IsModExtension is not set to true for the newly appeared extension node (nibbles // of the extension node that caused replacement + nibbles of the newly appeared extension node = // nibbles of the original extension node). - IsModExtension [2]bool `json:"is_mod_extension"` - IsPlaceholder [2]bool `json:"is_placeholder"` - IsLastLevelAndWrongExtCase bool `json:"is_last_level_and_wrong_ext_case"` - Extension ExtensionNode `json:"extension"` - Branch BranchNode `json:"branch"` + IsModExtension [2]bool `json:"is_mod_extension"` + IsPlaceholder [2]bool `json:"is_placeholder"` + IsLastLevelAndWrongExtCase bool `json:"is_last_level_and_wrong_ext_case"` + Extension ExtensionNode `json:"extension"` + Branch BranchNode `json:"branch"` } type ModExtensionNode struct { diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index e3c6ed77b8..82926358ff 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -108,7 +108,7 @@ func obtainAccountProofAndConvertToWitness(tMod TrieModification, statedb *state cRoot := statedb.GetTrie().Hash() accountProof1, aNeighbourNode2, aExtNibbles2, isLastLeaf2, aIsNeighbourNodeHashed2, err := statedb.GetProof(addr) - check(err) + check(err) if tMod.Type == AccountDoesNotExist && len(accountProof) == 0 { // If there is only one account in the state trie and we want to prove for some @@ -508,7 +508,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] // We are in a non-existing-proof and an extension node is the last element of getProof. // However, this extension node has not been added to the nodes yet (it's always added // together with a branch). - + nibbles := getNibbles(proof2[len(proof2)-1]) newKey := make([]byte, len(key)) copy(newKey, key) @@ -518,14 +518,14 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] newKey = make([]byte, len(addr_nibbles)) copy(newKey, addr_nibbles) } - + start := keyIndex - len(nibbles) nibblesMiddle := newKey[start:keyIndex] keyMiddle := []byte{160} keyMiddle = append(keyMiddle, trie.HexToCompact(nibblesMiddle)...) - nibblesAfter := newKey[keyIndex:len(newKey)-1] // Remove the last flag (16) + nibblesAfter := newKey[keyIndex : len(newKey)-1] // Remove the last flag (16) keyAfter := []byte{160} keyAfter = append(keyAfter, trie.HexToCompact(nibblesAfter)...) @@ -540,7 +540,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] nodes = append(nodes, bNode) if isAccountProof { - dummyLeaf := []byte{248,108,157,52,45,53,199,120,18,165,14,109,22,4,141,198,233,128,219,44,247,218,241,231,2,206,125,246,58,246,15,3,184,76,248,74,4,134,85,156,208,108,8,0,160,86,232,31,23,27,204,85,166,255,131,69,230,146,192,248,110,91,72,224,27,153,108,173,192,1,98,47,181,227,99,180,33,160,197,210,70,1,134,247,35,60,146,126,125,178,220,199,3,192,229,0,182,83,202,130,39,59,123,250,216,4,93,133,164,112} + dummyLeaf := []byte{248, 108, 157, 52, 45, 53, 199, 120, 18, 165, 14, 109, 22, 4, 141, 198, 233, 128, 219, 44, 247, 218, 241, 231, 2, 206, 125, 246, 58, 246, 15, 3, 184, 76, 248, 74, 4, 134, 85, 156, 208, 108, 8, 0, 160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 160, 197, 210, 70, 1, 134, 247, 35, 60, 146, 126, 125, 178, 220, 199, 3, 192, 229, 0, 182, 83, 202, 130, 39, 59, 123, 250, 216, 4, 93, 133, 164, 112} node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) node = equipLeafWithWrongExtension(node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) nodes = append(nodes, node) From 8b9818790602aa1b4a30fa74c609fa8af63f6c3f Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Wed, 17 Apr 2024 12:05:13 +0200 Subject: [PATCH 35/43] cargo fmt --- bin/mpt-test/src/circuit/witness.rs | 11 ++-- .../src/mpt_circuit/account_leaf.rs | 63 +++++++++++++------ .../src/mpt_circuit/extension_branch.rs | 15 +++-- zkevm-circuits/src/mpt_circuit/helpers.rs | 56 ++++++++--------- .../src/mpt_circuit/storage_leaf.rs | 58 ++++++++++++----- 5 files changed, 128 insertions(+), 75 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index e8284df34a..831e91ee64 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -217,7 +217,7 @@ impl Witness { storage_keys: Vec::new(), }); } - } + } let mut initial_values = Vec::new(); let mut changed_values = Vec::new(); @@ -239,8 +239,10 @@ impl Witness { .await?; // Skip if the account doesn't exist in the old block. - if old.balance.is_zero() && old.code_hash.is_zero() - && old.nonce.is_zero() && old.storage_hash.is_zero() + if old.balance.is_zero() + && old.code_hash.is_zero() + && old.nonce.is_zero() + && old.storage_hash.is_zero() { continue; } @@ -302,8 +304,7 @@ impl Witness { changed_values.push(TrieModification::balance(address, new.balance)); } - if old.code_hash != new.code_hash && new.code_hash != *DEFAULT_CODE_HASH - { + if old.code_hash != new.code_hash && new.code_hash != *DEFAULT_CODE_HASH { changed_values.push(TrieModification::codehash(address, new.code_hash)); } diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index c5fec451a2..b611500ffb 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -22,7 +22,9 @@ use crate::{ evm_circuit::util::from_bytes, mpt_circuit::{ helpers::{ - key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongExtNodeGadget, WrongLeafGadget, KECCAK + key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, Indexable, + IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, ParentData, WrongExtNodeGadget, + WrongLeafGadget, KECCAK, }, param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES, RLP_LIST_LONG, RLP_LONG}, MPTConfig, MPTContext, MptMemory, RlpItemType, @@ -373,12 +375,16 @@ impl AccountLeafConfig { &config.is_mod_extension, &cb.key_r.expr(), ); - - let is_wrong_leaf_case = and::expr(&[config.is_non_existing_account_proof.expr(), not!(config.parent_data[1].is_extension), not!(config.is_placeholder_leaf[1].expr())]); + + let is_wrong_leaf_case = and::expr(&[ + config.is_non_existing_account_proof.expr(), + not!(config.parent_data[1].is_extension), + not!(config.is_placeholder_leaf[1].expr()), + ]); // When non-existing-proof, it needs to be one of the following cases: - // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of these - // three cases is 1. + // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of + // these three cases is 1. ifx! {config.is_non_existing_account_proof => { require!(is_wrong_ext_case.clone() + is_wrong_leaf_case.clone() + config.is_placeholder_leaf[1].expr() => 1.expr()); }} @@ -401,17 +407,33 @@ impl AccountLeafConfig { ); // Wrong extension node handling - let wrong_ext_middle = - ctx.rlp_item(meta, cb, AccountRowType::LongExtNodeKey as usize, RlpItemType::Key); - let wrong_ext_middle_nibbles = - ctx.rlp_item(meta, cb, AccountRowType::LongExtNodeNibbles as usize, RlpItemType::Nibbles); - let wrong_ext_after = - ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeKey as usize, RlpItemType::Key); - let wrong_ext_after_nibbles = - ctx.rlp_item(meta, cb, AccountRowType::ShortExtNodeNibbles as usize, RlpItemType::Nibbles); - - // The extension_branch in the last level needs has `is_last_level_and_wrong_ext_case = true` - // in the case of wrong extension node. + let wrong_ext_middle = ctx.rlp_item( + meta, + cb, + AccountRowType::LongExtNodeKey as usize, + RlpItemType::Key, + ); + let wrong_ext_middle_nibbles = ctx.rlp_item( + meta, + cb, + AccountRowType::LongExtNodeNibbles as usize, + RlpItemType::Nibbles, + ); + let wrong_ext_after = ctx.rlp_item( + meta, + cb, + AccountRowType::ShortExtNodeKey as usize, + RlpItemType::Key, + ); + let wrong_ext_after_nibbles = ctx.rlp_item( + meta, + cb, + AccountRowType::ShortExtNodeNibbles as usize, + RlpItemType::Nibbles, + ); + + // The extension_branch in the last level needs has `is_last_level_and_wrong_ext_case = + // true` in the case of wrong extension node. // All other extension_branches (above it) need to have it `false` (constraint in // extension_branch.rs) @@ -425,8 +447,8 @@ impl AccountLeafConfig { &wrong_ext_after_nibbles, config.key_data[1].clone(), // C proof is used for non-existing proof config.key_data_prev.clone(), - ); - + ); + // Anything following this node is below the account // TODO(Brecht): For non-existing accounts it should be impossible to prove // storage leaves unless it's also a non-existing proof? @@ -765,10 +787,11 @@ impl AccountLeafConfig { true, key_data[1].clone(), region.key_r, - )?; + )?; let wrong_ext_middle = rlp_values[AccountRowType::LongExtNodeKey as usize].clone(); - let wrong_ext_middle_nibbles = rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); + let wrong_ext_middle_nibbles = + rlp_values[AccountRowType::LongExtNodeNibbles as usize].clone(); self.wrong_ext_node.assign( region, offset, diff --git a/zkevm-circuits/src/mpt_circuit/extension_branch.rs b/zkevm-circuits/src/mpt_circuit/extension_branch.rs index 174d0cfe80..c47b7bba5b 100644 --- a/zkevm-circuits/src/mpt_circuit/extension_branch.rs +++ b/zkevm-circuits/src/mpt_circuit/extension_branch.rs @@ -141,8 +141,8 @@ impl ExtensionBranchConfig { // Set the new keys for is_s in [true, false] { - // The extension_branch in the last level needs to have `is_ext_last_level = true` (checked - // in account_leaf.rs / storage_leaf.rs). + // The extension_branch in the last level needs to have `is_ext_last_level = true` + // (checked in account_leaf.rs / storage_leaf.rs). // All other extension_branches need to have it `false`: require!(config.parent_data[is_s.idx()].is_last_level_and_wrong_ext_case.expr() => false.expr()); @@ -197,7 +197,7 @@ impl ExtensionBranchConfig { config.is_extension.expr(), config.is_last_level_and_wrong_ext_case.expr(), branch.mod_word[is_s.idx()].clone(), - ); + ); }} } }); @@ -220,8 +220,13 @@ impl ExtensionBranchConfig { let is_extension = extension_branch.is_extension.scalar(); self.is_extension.assign(region, offset, is_extension)?; - let is_last_level_and_wrong_ext_case = extension_branch.is_last_level_and_wrong_ext_case.scalar(); - self.is_last_level_and_wrong_ext_case.assign(region, offset, is_last_level_and_wrong_ext_case)?; + let is_last_level_and_wrong_ext_case = + extension_branch.is_last_level_and_wrong_ext_case.scalar(); + self.is_last_level_and_wrong_ext_case.assign( + region, + offset, + is_last_level_and_wrong_ext_case, + )?; let key_data = self.key_data diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 3e709c5dcf..9f661eec3a 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -561,10 +561,10 @@ pub(crate) struct ParentData { // is_extension is used only in a non-existing proof / wrong extension node case - // in account/storage leaf to check whether the parent is an extension node pub(crate) is_extension: Cell, - // is_last_level_and_wrong_ext_case is used only in a non-existing proof in wrong extension node case - - // the last branch is a placeholder in this case and the check for a branch hash being in the parent - // extension node needs to be ignored, but it needs to be ignored only in the last branch - // (the branch above the leaf into which the lookup is made) + // is_last_level_and_wrong_ext_case is used only in a non-existing proof in wrong extension + // node case - the last branch is a placeholder in this case and the check for a branch + // hash being in the parent extension node needs to be ignored, but it needs to be ignored + // only in the last branch (the branch above the leaf into which the lookup is made) pub(crate) is_last_level_and_wrong_ext_case: Cell, pub(crate) drifted_parent_hash: WordLoHiCell, } @@ -687,7 +687,8 @@ impl ParentData { self.is_root.assign(region, offset, values[3])?; self.is_placeholder.assign(region, offset, values[4])?; self.is_extension.assign(region, offset, values[5])?; - self.is_last_level_and_wrong_ext_case.assign(region, offset, values[6])?; + self.is_last_level_and_wrong_ext_case + .assign(region, offset, values[6])?; self.drifted_parent_hash .lo() .assign(region, offset, values[7])?; @@ -1249,7 +1250,7 @@ impl WrongLeafGadget { ) -> Self { let mut config = WrongLeafGadget::default(); circuit!([meta, cb.base], { - ifx! {is_wrong_leaf_case => { + ifx! {is_wrong_leaf_case => { config.wrong_rlp_key = ListKeyGadget::construct(cb, expected_item); let key_rlc_wrong = key_data.rlc.expr() + config.wrong_rlp_key.key.expr( @@ -1337,7 +1338,7 @@ impl WrongExtNodeGadget { ) -> Self { let mut config = WrongExtNodeGadget::default(); circuit!([meta, cb.base], { - ifx! {is_wrong_ext_case => { + ifx! {is_wrong_ext_case => { config.mult_without_branch_nibble = cb.query_cell(); // We have a key split into three parts, @@ -1429,26 +1430,28 @@ impl WrongExtNodeGadget { ) { let items = [wrong_ext_middle.clone(), wrong_ext_middle_nibbles]; - // key_data.is_odd (and key_data.num_nibbles) takes into account also the branch nibble and we do not want this, - // the actual value we need is !key_data.is_odd + // key_data.is_odd (and key_data.num_nibbles) takes into account also the branch nibble and + // we do not want this, the actual value we need is !key_data.is_odd // key_data_prev.is_odd = true, key_data.is_odd = true -> is_key_part_odd = true // key_data_prev.is_odd = true, key_data.is_odd = false -> is_key_part_odd = false // key_data_prev.is_odd = false, key_data.is_odd = true -> is_key_part_odd = false // key_data_prev.is_odd = false, key_data.is_odd = false -> is_key_part_odd = true let is_key_part_odd = key_data_prev.is_odd == key_data.is_odd; - let after_middle_rlc = key_data_prev.rlc + ext_key_rlc_calc_value( - wrong_ext_middle, - key_data_prev.mult, - is_key_part_odd, - key_data_prev.is_odd, - items - .iter() - .map(|item| item.bytes.clone()) - .collect::>() - .try_into() - .unwrap(), - region.key_r, - ).0; + let after_middle_rlc = key_data_prev.rlc + + ext_key_rlc_calc_value( + wrong_ext_middle, + key_data_prev.mult, + is_key_part_odd, + key_data_prev.is_odd, + items + .iter() + .map(|item| item.bytes.clone()) + .collect::>() + .try_into() + .unwrap(), + region.key_r, + ) + .0; let mut mult = key_data.mult; if !key_data.is_odd { @@ -1463,12 +1466,9 @@ impl WrongExtNodeGadget { } let _ = self.mult_without_branch_nibble.assign(region, offset, mult); - let _ = self.is_key_equal.assign( - region, - offset, - key_data.rlc, - after_middle_rlc, - ); + let _ = self + .is_key_equal + .assign(region, offset, key_data.rlc, after_middle_rlc); } } diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 11a2dd2808..65bc747a13 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -16,7 +16,9 @@ use crate::{ }, mpt_circuit::{ helpers::{ - key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, MainData, ParentData, ParentDataWitness, WrongExtNodeGadget, KECCAK + key_memory, main_memory, num_nibbles, parent_memory, DriftedGadget, + IsPlaceholderLeafGadget, KeyData, MPTConstraintBuilder, MainData, ParentData, + ParentDataWitness, WrongExtNodeGadget, KECCAK, }, param::{EMPTY_TRIE_HASH, KEY_LEN_IN_NIBBLES}, MPTConfig, MPTContext, MptMemory, RlpItemType, @@ -294,11 +296,15 @@ impl StorageLeafConfig { &cb.key_r.expr(), ); - let is_wrong_leaf_case = and::expr(&[config.is_non_existing_storage_proof.expr(), not!(config.parent_data[1].is_extension), not!(config.is_placeholder_leaf[1].expr())]); + let is_wrong_leaf_case = and::expr(&[ + config.is_non_existing_storage_proof.expr(), + not!(config.parent_data[1].is_extension), + not!(config.is_placeholder_leaf[1].expr()), + ]); // When non-existing-proof, it needs to be one of the following cases: - // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of these - // three cases is 1. + // (1) wrong leaf, (2) wrong extension node, (3) nil leaf - we need to check the sum of + // these three cases is 1. ifx! {config.is_non_existing_storage_proof => { require!(is_wrong_ext_case.clone() + is_wrong_leaf_case.clone() + config.is_placeholder_leaf[1].expr() => 1.expr()); }} @@ -321,17 +327,33 @@ impl StorageLeafConfig { ); // Wrong extension node handling - let wrong_ext_middle = - ctx.rlp_item(meta, cb, StorageRowType::LongExtNodeKey as usize, RlpItemType::Key); - let wrong_ext_middle_nibbles = - ctx.rlp_item(meta, cb, StorageRowType::LongExtNodeNibbles as usize, RlpItemType::Nibbles); - let wrong_ext_after = - ctx.rlp_item(meta, cb, StorageRowType::ShortExtNodeKey as usize, RlpItemType::Key); - let wrong_ext_after_nibbles = - ctx.rlp_item(meta, cb, StorageRowType::ShortExtNodeNibbles as usize, RlpItemType::Nibbles); - - // The extension_branch in the last level needs has `is_last_level_and_wrong_ext_case = true` - // in the case of wrong extension node. + let wrong_ext_middle = ctx.rlp_item( + meta, + cb, + StorageRowType::LongExtNodeKey as usize, + RlpItemType::Key, + ); + let wrong_ext_middle_nibbles = ctx.rlp_item( + meta, + cb, + StorageRowType::LongExtNodeNibbles as usize, + RlpItemType::Nibbles, + ); + let wrong_ext_after = ctx.rlp_item( + meta, + cb, + StorageRowType::ShortExtNodeKey as usize, + RlpItemType::Key, + ); + let wrong_ext_after_nibbles = ctx.rlp_item( + meta, + cb, + StorageRowType::ShortExtNodeNibbles as usize, + RlpItemType::Nibbles, + ); + + // The extension_branch in the last level needs has `is_last_level_and_wrong_ext_case = + // true` in the case of wrong extension node. // All other extension_branches (above it) need to have it `false` (constraint in // extension_branch.rs) @@ -343,7 +365,8 @@ impl StorageLeafConfig { &wrong_ext_middle_nibbles, &wrong_ext_after, &wrong_ext_after_nibbles, - config.key_data[1].clone(), // C proof should be used everywhere for non-existing proof + config.key_data[1].clone(), /* C proof should be used everywhere for + * non-existing proof */ config.key_data_prev.clone(), ); @@ -624,7 +647,8 @@ impl StorageLeafConfig { )?; let wrong_ext_middle = rlp_values[StorageRowType::LongExtNodeKey as usize].clone(); - let wrong_ext_middle_nibbles = rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); + let wrong_ext_middle_nibbles = + rlp_values[StorageRowType::LongExtNodeNibbles as usize].clone(); self.wrong_ext_node.assign( region, offset, From 38af86192e38fb4733176b101209bde246a5ff1a Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Thu, 18 Apr 2024 08:50:53 +0200 Subject: [PATCH 36/43] ailing test ignored (debugging) --- .../mpt/witness/gen_witness_from_infura_blockchain_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 39d920ab29..b992d747bf 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -123,6 +123,7 @@ func TestUpdateTwoLevels(t *testing.T) { updateStateAndPrepareWitness("UpdateTwoLevels", ks[:], values, []common.Address{addr, addr, addr}, trieModifications) } +/* func TestUpdateTwoLevelsBigVal(t *testing.T) { ks := [...]common.Hash{common.HexToHash("0x11"), common.HexToHash("0x12"), common.HexToHash("0x21")} // this has three levels // hexed keys: @@ -155,6 +156,7 @@ func TestUpdateTwoLevelsBigVal(t *testing.T) { updateStateAndPrepareWitness("UpdateTwoLevelsBigVal", ks[:], values, []common.Address{addr, addr, addr}, trieModifications) } +*/ func TestUpdateThreeLevels(t *testing.T) { ks := [...]common.Hash{ From 612a026395c1ab8ad69750c73f70d0b08a9df52a Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Thu, 18 Apr 2024 08:56:16 +0200 Subject: [PATCH 37/43] Test reenabled --- .../mpt/witness/gen_witness_from_infura_blockchain_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index b992d747bf..39d920ab29 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -123,7 +123,6 @@ func TestUpdateTwoLevels(t *testing.T) { updateStateAndPrepareWitness("UpdateTwoLevels", ks[:], values, []common.Address{addr, addr, addr}, trieModifications) } -/* func TestUpdateTwoLevelsBigVal(t *testing.T) { ks := [...]common.Hash{common.HexToHash("0x11"), common.HexToHash("0x12"), common.HexToHash("0x21")} // this has three levels // hexed keys: @@ -156,7 +155,6 @@ func TestUpdateTwoLevelsBigVal(t *testing.T) { updateStateAndPrepareWitness("UpdateTwoLevelsBigVal", ks[:], values, []common.Address{addr, addr, addr}, trieModifications) } -*/ func TestUpdateThreeLevels(t *testing.T) { ks := [...]common.Hash{ From d325bf506f2338af73d9c1e0e6f1dc3f541992d4 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Thu, 18 Apr 2024 11:38:51 +0200 Subject: [PATCH 38/43] Failing test commented out --- .../mpt/witness/gen_witness_from_infura_blockchain_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 39d920ab29..21564fa283 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -1716,6 +1716,7 @@ func TestImplicitlyCreateAccountWithCodeHash(t *testing.T) { prepareWitness("ImplicitlyCreateAccountWithCodeHash", trieModifications, statedb) } +/* func TestAccountAddPlaceholderBranch(t *testing.T) { blockNum := 13284469 blockNumberParent := big.NewInt(int64(blockNum)) @@ -1737,6 +1738,7 @@ func TestAccountAddPlaceholderBranch(t *testing.T) { prepareWitness("AccountAddPlaceholderBranch", trieModifications, statedb) } +*/ func TestAccountDeletePlaceholderBranch(t *testing.T) { blockNum := 13284469 From 1dd40080bf00e7b1b3844f61de8956af747aa4ce Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Thu, 18 Apr 2024 11:46:21 +0200 Subject: [PATCH 39/43] Test reenabled --- .../mpt/witness/gen_witness_from_infura_blockchain_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 21564fa283..39d920ab29 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -1716,7 +1716,6 @@ func TestImplicitlyCreateAccountWithCodeHash(t *testing.T) { prepareWitness("ImplicitlyCreateAccountWithCodeHash", trieModifications, statedb) } -/* func TestAccountAddPlaceholderBranch(t *testing.T) { blockNum := 13284469 blockNumberParent := big.NewInt(int64(blockNum)) @@ -1738,7 +1737,6 @@ func TestAccountAddPlaceholderBranch(t *testing.T) { prepareWitness("AccountAddPlaceholderBranch", trieModifications, statedb) } -*/ func TestAccountDeletePlaceholderBranch(t *testing.T) { blockNum := 13284469 From ab175094e05b5e5a5f841152c7ec7cf0dc12b28b Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 19 Apr 2024 08:53:36 +0200 Subject: [PATCH 40/43] clippy fixes --- bin/mpt-test/src/circuit/witness.rs | 2 +- zkevm-circuits/src/mpt_circuit/account_leaf.rs | 2 +- zkevm-circuits/src/mpt_circuit/helpers.rs | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index 831e91ee64..214ed206b3 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -7,7 +7,7 @@ use std::{ time::Duration, }; -use ethers::core::utils; + use eth_types::{Field, ToScalar}; diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index b611500ffb..1c1b9af253 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -1,5 +1,5 @@ use eth_types::{Field, OpsIdentity, U256}; -use gadgets::util::{pow, xor, Scalar}; +use gadgets::util::{pow, Scalar}; use halo2_proofs::{ circuit::Value, plonk::{Error, Expression, VirtualCells}, diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 67350da413..cfd4262e60 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -615,6 +615,7 @@ impl ParentData { parent_data } + #[allow(clippy::too_many_arguments)] pub(crate) fn store>( cb: &mut MPTConstraintBuilder, memory: &mut MB, @@ -1454,14 +1455,12 @@ impl WrongExtNodeGadget { .0; let mut mult = key_data.mult; - if !key_data.is_odd { - if key_data.num_nibbles > 1 { - let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd - mult = F::one(); + if !key_data.is_odd && key_data.num_nibbles > 1 { + let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd + mult = F::one(); - for _ in 0..iters { - mult = mult * region.key_r; - } + for _ in 0..iters { + mult *= region.key_r; } } let _ = self.mult_without_branch_nibble.assign(region, offset, mult); From 641ef3dd4eedfaf42de262446ea9603dcf855d17 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 19 Apr 2024 09:14:35 +0200 Subject: [PATCH 41/43] cargo fmt --- bin/mpt-test/src/circuit/witness.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index 214ed206b3..b45d2b5599 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -7,8 +7,6 @@ use std::{ time::Duration, }; - - use eth_types::{Field, ToScalar}; use ethers::{ From b7b8aa1a88e42932849763fde8d1080ab75bda46 Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 23 Apr 2024 10:23:01 +0200 Subject: [PATCH 42/43] Removed constructedLeaf; some cleaning --- geth-utils/gethutil/mpt/witness/branch.go | 6 +- ...gen_witness_from_infura_blockchain_test.go | 7 ++ geth-utils/gethutil/mpt/witness/leaf.go | 38 +++------ .../gethutil/mpt/witness/prepare_witness.go | 12 +-- .../tests/AccountAfterFirstLevel.json | 16 ++-- .../tests/AccountBranchPlaceholder.json | 16 ++-- ...countExtensionThreeNibblesInEvenLevel.json | 20 ++--- ...ccountExtensionThreeNibblesInOddLevel.json | 12 +-- ...AccountExtensionTwoNibblesInEvenLevel.json | 12 +-- .../tests/AccountWrongExtensionNode.json | 78 ++++++++++++++++--- .../tests/ExtNodeDeletedBefore4After1.json | 28 +++---- ...ExtNodeDeletedBefore6After1FirstLevel.json | 28 +++---- ...ExtNodeDeletedBranchDeletedFirstLevel.json | 28 +++---- ...NodeDeletedExtShortIsBranchFirstLevel.json | 28 +++---- .../tests/ExtNodeInsertedBefore4After1.json | 28 +++---- ...xtNodeInsertedBefore5After1FirstLevel.json | 28 +++---- ...xtNodeInsertedBefore5After2FirstLevel.json | 28 +++---- ...xtNodeInsertedBefore5After3FirstLevel.json | 28 +++---- ...xtNodeInsertedBefore6After1FirstLevel.json | 28 +++---- ...xtNodeInsertedBefore6After2FirstLevel.json | 28 +++---- ...xtNodeInsertedBefore6After4FirstLevel.json | 28 +++---- ...odeInsertedExtShortIsBranchFirstLevel.json | 28 +++---- .../ExtNodeInsertedInNewBranchFirstLevel.json | 28 +++---- .../tests/ExtensionIntoBranch.json | 28 +++---- .../NonExistingAccountAfterFirstLevel.json | 16 ++-- ...nExistingAccountNilObjectInFirstLevel.json | 16 ++-- .../tests/StorageInFirstLevelNonExisting.json | 16 ++-- .../StorageInFirstLevelNonExistingLong.json | 16 ++-- 28 files changed, 361 insertions(+), 312 deletions(-) diff --git a/geth-utils/gethutil/mpt/witness/branch.go b/geth-utils/gethutil/mpt/witness/branch.go index 6cd204d119..76bad05284 100644 --- a/geth-utils/gethutil/mpt/witness/branch.go +++ b/geth-utils/gethutil/mpt/witness/branch.go @@ -153,7 +153,7 @@ func prepareBranchNode(branch1, branch2, extNode1, extNode2, extListRlpBytes []b // getNibbles returns the nibbles of the leaf or extension node. func getNibbles(leafKeyRow []byte) []byte { var nibbles []byte - if leafKeyRow[0] != 248 { + if leafKeyRow[0] < 248 { var keyLen int if leafKeyRow[1] > 128 { keyLen = int(leafKeyRow[1] - 128) @@ -175,7 +175,7 @@ func getNibbles(leafKeyRow []byte) []byte { keyLen = 1 nibbles = append(nibbles, leafKeyRow[1]-16) } - } else { + } else if leafKeyRow[0] == 248 { keyLen := int(leafKeyRow[2] - 128) if (leafKeyRow[3] != 32) && (leafKeyRow[3] != 0) { // second term is for extension node if leafKeyRow[3] < 32 { // extension node @@ -191,6 +191,8 @@ func getNibbles(leafKeyRow []byte) []byte { nibbles = append(nibbles, n1) nibbles = append(nibbles, n2) } + } else { + panic("Not supported yet.") } return nibbles diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 39d920ab29..3389336663 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2378,6 +2378,13 @@ func TestStorageWrongExtensionNode(t *testing.T) { } func TestStorageWrongExtensionNode1(t *testing.T) { + // This test slightly differs from TestStorageWrongExtensionNode in key3 - + // TestStorageWrongExtensionNode: + // key3 := common.HexToHash("0x1277000000000000000000000000000000000000000000000000000000000000") + // TestStorageWrongExtensionNode1: + // key3 := common.HexToHash("0x01277000000000000000000000000000000000000000000000000000000000000") + // This is to test different scenarios in the computation of the nibbles RLC in the circuit. + blockNum := 0 blockNumberParent := big.NewInt(int64(blockNum)) blockHeaderParent := oracle.PrefetchBlock(blockNumberParent, true, nil) diff --git a/geth-utils/gethutil/mpt/witness/leaf.go b/geth-utils/gethutil/mpt/witness/leaf.go index fc6f1ad51a..9d6bfe5b49 100644 --- a/geth-utils/gethutil/mpt/witness/leaf.go +++ b/geth-utils/gethutil/mpt/witness/leaf.go @@ -122,7 +122,7 @@ func getStorageRootCodeHashValue(leaf []byte, storageStart int) ([]byte, []byte) return storageRootValue, codeHashValue } -func prepareAccountLeafNode(addr common.Address, addrh []byte, leafS, leafC, constructedLeaf, neighbourNode, addressNibbles []byte, isPlaceholder, isSModExtension, isCModExtension bool) Node { +func prepareAccountLeafNode(addr common.Address, addrh []byte, leafS, leafC, neighbourNode, addressNibbles []byte, isPlaceholder, isSModExtension, isCModExtension bool) Node { // For non existing account proof there are two cases: // 1. A leaf is returned that is not at the required address (wrong leaf). // 2. A branch is returned as the last element of getProof and @@ -176,10 +176,6 @@ func prepareAccountLeafNode(addr common.Address, addrh []byte, leafS, leafC, con wrongLeaf := leafC wrongLen := keyLenC - if constructedLeaf != nil { - wrongLeaf = constructedLeaf - wrongLen = int(constructedLeaf[2]) - 128 - } offset := 0 nibblesNum := (wrongLen - 1) * 2 @@ -334,7 +330,7 @@ func prepareLeafAndPlaceholderNode(addr common.Address, addrh []byte, proof1, pr // When generating a proof that account doesn't exist, the length of both proofs is the same (doesn't reach // this code). - return prepareAccountLeafNode(addr, addrh, leafS, leafC, nil, nil, key, false, isSModExtension, isCModExtension) + return prepareAccountLeafNode(addr, addrh, leafS, leafC, nil, key, false, isSModExtension, isCModExtension) } else { var leaf []byte isSPlaceholder := false @@ -348,7 +344,7 @@ func prepareLeafAndPlaceholderNode(addr common.Address, addrh []byte, proof1, pr isSPlaceholder = true } - return prepareStorageLeafNode(leaf, leaf, nil, nil, storage_key, key, false, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension) + return prepareStorageLeafNode(leaf, leaf, nil, storage_key, key, false, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension) } } @@ -394,7 +390,7 @@ func prepareAccountLeafPlaceholderNode(addr common.Address, addrh, key []byte, k leaf[4+i] = remainingNibbles[2*i+offset]*16 + remainingNibbles[2*i+1+offset] } - node := prepareAccountLeafNode(addr, addrh, leaf, leaf, nil, nil, key, true, false, false) + node := prepareAccountLeafNode(addr, addrh, leaf, leaf, nil, key, true, false, false) node.Account.ValueRlpBytes[0][0] = 184 node.Account.ValueRlpBytes[0][1] = 70 @@ -423,7 +419,7 @@ func prepareStorageLeafPlaceholderNode(storage_key common.Hash, key []byte, keyI keyLen := getLeafKeyLen(keyIndex) leaf[0] = 192 + 1 + byte(keyLen) + 1 - return prepareStorageLeafNode(leaf, leaf, nil, nil, storage_key, key, false, true, true, false, false) + return prepareStorageLeafNode(leaf, leaf, nil, storage_key, key, false, true, true, false, false) } func prepareStorageLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte, []byte, []byte, []byte) { @@ -509,7 +505,7 @@ func prepareStorageLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte return key, value, keyRlp, valueRlp } -func prepareStorageLeafNode(leafS, leafC, constructedLeaf, neighbourNode []byte, storage_key common.Hash, key []byte, nonExistingStorageProof, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension bool) Node { +func prepareStorageLeafNode(leafS, leafC, neighbourNode []byte, storage_key common.Hash, key []byte, nonExistingStorageProof, isSPlaceholder, isCPlaceholder, isSModExtension, isCModExtension bool) Node { var rows [][]byte keyS, valueS, listRlpBytes1, valueRlpBytes1 := prepareStorageLeafInfo(leafS, false, isSPlaceholder) @@ -540,11 +536,7 @@ func prepareStorageLeafNode(leafS, leafC, constructedLeaf, neighbourNode []byte, var nonExistingStorageRow []byte var wrongRlpBytes []byte if nonExistingStorageProof { - if constructedLeaf != nil { - wrongRlpBytes, nonExistingStorageRow = prepareNonExistingStorageRow(constructedLeaf, key) - } else { - wrongRlpBytes, nonExistingStorageRow = prepareNonExistingStorageRow(leafC, key) - } + wrongRlpBytes, nonExistingStorageRow = prepareNonExistingStorageRow(leafC, key) } else { nonExistingStorageRow = prepareEmptyNonExistingStorageRow() } @@ -584,12 +576,8 @@ func equipLeafWithWrongExtension(leafNode Node, keyMiddle, keyAfter, nibblesMidd l := len(leafNode.Values) leafNode.Values[l-modifiedExtensionNodeRowLen] = keyMiddle startNibblePos := 2 // we don't need any nibbles for case keyLen = 1 - if len(keyMiddle) > 1 { - if len(nibblesMiddle)%2 == 0 { - startNibblePos = 1 - } else { - startNibblePos = 2 - } + if len(keyMiddle) > 1 && len(nibblesMiddle)%2 == 0 { + startNibblePos = 1 } ind := 0 for j := startNibblePos; j < len(nibblesMiddle); j += 2 { @@ -599,12 +587,8 @@ func equipLeafWithWrongExtension(leafNode Node, keyMiddle, keyAfter, nibblesMidd leafNode.Values[l-modifiedExtensionNodeRowLen+3] = keyAfter startNibblePos = 2 // we don't need any nibbles for case keyLen = 1 - if len(keyAfter) > 1 { - if len(nibblesAfter)%2 == 0 { - startNibblePos = 1 - } else { - startNibblePos = 2 - } + if len(keyAfter) > 1 && len(nibblesAfter)%2 == 0 { + startNibblePos = 1 } ind = 0 for j := startNibblePos; j < len(nibblesAfter); j += 2 { diff --git a/geth-utils/gethutil/mpt/witness/prepare_witness.go b/geth-utils/gethutil/mpt/witness/prepare_witness.go index 82926358ff..fbc1bc8ba1 100644 --- a/geth-utils/gethutil/mpt/witness/prepare_witness.go +++ b/geth-utils/gethutil/mpt/witness/prepare_witness.go @@ -397,9 +397,9 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] l := len(proof1) var node Node if isAccountProof { - node = prepareAccountLeafNode(addr, addrh, proof1[l-1], proof2[l-1], nil, nil, key, false, false, false) + node = prepareAccountLeafNode(addr, addrh, proof1[l-1], proof2[l-1], nil, key, false, false, false) } else { - node = prepareStorageLeafNode(proof1[l-1], proof2[l-1], nil, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + node = prepareStorageLeafNode(proof1[l-1], proof2[l-1], nil, storage_key, key, nonExistingStorageProof, false, false, false, false) } nodes = append(nodes, node) @@ -447,7 +447,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] if isAccountProof { // Add account leaf after branch placeholder: if !isModifiedExtNode { - leafNode = prepareAccountLeafNode(addr, addrh, proof1[len1-1], proof2[len2-1], nil, neighbourNode, key, false, false, false) + leafNode = prepareAccountLeafNode(addr, addrh, proof1[len1-1], proof2[len2-1], neighbourNode, key, false, false, false) } else { isSModExtension := false isCModExtension := false @@ -461,7 +461,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] } else { // Add storage leaf after branch placeholder if !isModifiedExtNode { - leafNode = prepareStorageLeafNode(proof1[len1-1], proof2[len2-1], nil, neighbourNode, storage_key, key, nonExistingStorageProof, false, false, false, false) + leafNode = prepareStorageLeafNode(proof1[len1-1], proof2[len2-1], neighbourNode, storage_key, key, nonExistingStorageProof, false, false, false, false) } else { isSModExtension := false isCModExtension := false @@ -541,7 +541,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] if isAccountProof { dummyLeaf := []byte{248, 108, 157, 52, 45, 53, 199, 120, 18, 165, 14, 109, 22, 4, 141, 198, 233, 128, 219, 44, 247, 218, 241, 231, 2, 206, 125, 246, 58, 246, 15, 3, 184, 76, 248, 74, 4, 134, 85, 156, 208, 108, 8, 0, 160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, 160, 197, 210, 70, 1, 134, 247, 35, 60, 146, 126, 125, 178, 220, 199, 3, 192, 229, 0, 182, 83, 202, 130, 39, 59, 123, 250, 216, 4, 93, 133, 164, 112} - node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) + node := prepareAccountLeafNode(addr, addrh, dummyLeaf, dummyLeaf, nil, addr_nibbles, false, false, false) node = equipLeafWithWrongExtension(node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) nodes = append(nodes, node) } else { @@ -554,7 +554,7 @@ func convertProofToWitness(statedb *state.StateDB, addr common.Address, addrh [] dummyLeaf := append([]byte{rlp1, rlp2}, compact...) // Add dummy value: dummyLeaf = append(dummyLeaf, 0) - node := prepareStorageLeafNode(dummyLeaf, dummyLeaf, dummyLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) + node := prepareStorageLeafNode(dummyLeaf, dummyLeaf, nil, storage_key, key, nonExistingStorageProof, false, false, false, false) node = equipLeafWithWrongExtension(node, keyMiddle, keyAfter, nibblesMiddle, nibblesAfter) nodes = append(nodes, node) } diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json index c8d7121710..d9f8dd180e 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountAfterFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", - "a0f27607e62c4a7a95dd1d5d63a72a129b1e42d14a59421045d8c11c29c7f8f70900" + "a06515b1a21d53e95962386ef49edeeebbbeba1fcf5cc17a7924fceae0eab2042c00", + "a0fd63dc2c9955d1eb90703a120d97be9ed6a7c438241194fa0be3bca04f1e8d7700" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90111", - "f90131" + "f90131", + "f90151" ] } }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a0a47179bacb2563d64a4da3bfd1a3afc4e15e58cb7671232a1393aa56e84e210700", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0a47179bacb2563d64a4da3bfd1a3afc4e15e58cb7671232a1393aa56e84e210780" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90151a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0a47179bacb2563d64a4da3bfd1a3afc4e15e58cb7671232a1393aa56e84e210780" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json index 0c6e83923e..f015be47e9 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountBranchPlaceholder.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", - "a0b220559455e7817aad815d51c2e1455060ddaaf60eeb300b69345eb407714c7e00" + "a06515b1a21d53e95962386ef49edeeebbbeba1fcf5cc17a7924fceae0eab2042c00", + "a002e6b21a9663cccb3f580494d587452ab4f8ba5b2ea37580e0e4e90f087fbc7e00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a0f5668715bad00d67745187cb0ca429735ffd25f9c22ea8a96b90752b9f11cde500", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a0f5668715bad00d67745187cb0ca429735ffd25f9c22ea8a96b90752b9f11cde58080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a0f5668715bad00d67745187cb0ca429735ffd25f9c22ea8a96b90752b9f11cde58080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json index c94725c45f..83559130cc 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInEvenLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0d4f83e51c78aeae92abfa769bc9eecf8a5dd361c2aa4b9219b49f73b4ea3531500", - "a09483cae1f3d6f923e9f3d6d387e9b65ac74190fddf26259ac020afbef5d0c80000" + "a0fcfad7fbf731d4506af2a80bb12cd7a8f56d4337554a5d2662950c6c711aaa8900", + "a09679d7ba83409694048d6898474b0d595a9ae08af4c7835ec8e820ce77221a8700" ], "keccak_data": [] }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a00165d78eb2d06873f7a076909093b34881dc3527b63cd33f0c19ae635eb15fc100", - "a0d14c2a3a9c74f61ceb04bd565a49c5a86741af97d3dbeca89be38e45095c9b2f00", + "a05f211abae3b6c436765b763c15e414ea7bcdda0632a6cc4e8b540e7acf96684300", + "a05f87698bc0dc46857a7e720f1d75336767e7d80b77a20e44e2ae01d22901073b00", "a073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db4042176509300", "a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72a00", "a0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea9397700", @@ -57,7 +57,7 @@ "a05247e1e89587276142445f2235dfccbef844df7432098e5217f395913390588600", "a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b3000", "a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff1034700", - "a0e966e706e85e1ec5954cb87a48ac9205c1bf013059acbd85e07bb9423d637ef700", + "a061c387163a9bddfec70a358a871a998355673598e3c16df94d63b61acdd6ca0400", "a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b900", "a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045800", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a0d14c2a3a9c74f61ceb04bd565a49c5a86741af97d3dbeca89be38e45095c9b2fa073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72aa0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a0e966e706e85e1ec5954cb87a48ac9205c1bf013059acbd85e07bb9423d637ef7a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880", - "f90211a00165d78eb2d06873f7a076909093b34881dc3527b63cd33f0c19ae635eb15fc1a073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72aa0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a0e966e706e85e1ec5954cb87a48ac9205c1bf013059acbd85e07bb9423d637ef7a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880" + "f90211a05f87698bc0dc46857a7e720f1d75336767e7d80b77a20e44e2ae01d22901073ba073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72aa0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a061c387163a9bddfec70a358a871a998355673598e3c16df94d63b61acdd6ca04a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880", + "f90211a05f211abae3b6c436765b763c15e414ea7bcdda0632a6cc4e8b540e7acf966843a073d08631b39e07893b9683591a1c973427918568ff5e8c196d5db40421765093a011c2fa9aaf9b6829428025c76a44111c3c437d7772acfcb31aa5f0be47d7a72aa0c3cfe012315dafc735d5ad92ab18f28b77218dc3193723053beacc462ea93977a05d92fbe7525079b8250886a5d33dbbc12c14aae59e598f7be2e2d96d5e7b6149a0d83523d2d6afddb1fd2e102db5ace42416b34c9e358219cc9d8edadc98a57f78a01090721fd280068a53c6355e798d684d5ebe25e12549462d3c1b1a8ffca3726da0e84157cbb9325309c11240d3640fa216bacb4948b522336c183b2131d81a38e1a0e64f5ffa8a4e174c70166816a4d5657fa8c7774737ccc5e57350ea6100880218a0a82fea9cb305037869a6284f800ad7c0a26f3b6c08acc8dd6bd01be1a8a4d332a05247e1e89587276142445f2235dfccbef844df7432098e5217f3959133905886a00b1058936f5b4aba5fae64e5c1a2aefc465649049a9acdc45dbed9377a7a2b30a03ffa83af97358081ddbf06a0da6fedc7b2490d89d83646a5b34953a81ff10347a061c387163a9bddfec70a358a871a998355673598e3c16df94d63b61acdd6ca04a082adcb70b6e04c04aedb3a33df449da0fc4433ecc3c19a000e3f9c38cddb84b9a04f75d42fba5715dfd873aa6891c82a545878730a40bfa2fc719b392b0a3b045880" ] }, { @@ -112,7 +112,7 @@ "a0b4c42330f705fb73fa7bd67a7c50ee43df43a0cb23b0ce98fa4e9f561c856b3d00", "a0b440d454521a9dc1f49138a206481ff3b6ef5dcbed02413c164fa6d9dc79e02e00", "a01040c486dda0d7f41e6b90eb32bdab8e84bd1d0ee13c67a56669e0a9f947422f00", - "a042c3d336e0468c84e82189a07d9cabec5ec529aa0ff113ffe813bdbf928c7aff00", + "a09cb6e9a10e9d13695ee635d586da8c919c54e10901c9256894a84244961a2bc200", "a08cfec7bafb48e82fb8ccdb5d769272d5f13d5e1573611353bb21b8bdde45b22600", "a0a49902dfbca4be6ea0b8823a70f9ca7bd245b0c014cf5b0d2719e7f58414dba300", "a0ab3247a2bc3d215a95963242126d41d38177d26e4938cbc0a10f7335a66dc8fc00", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a09be3ff2eebd72e61762e12df91ecd5986f4a63fac215599e3be9821ee4f89e85a010635b4f5acedf385a83506f19fd9cf4c966406b48b9319fd7064ae8cd99737ea05be6665637b2dd64c21ebd4ae406ae85a366c2b5311576365b4b5b28473941aba073753bc3db10a28a51a8e88704d880f5185875d06590b7eb9eb43245209d7337a00b073769bacb397dff42b2dd0f420da9bdfc8e781309a91a4ccd14a117d2b621a0997dd70d3f42e2a38dc70feb158a1d5761c697276b99357282a8a20ab2313108a0d06c62048d279829b074b6753e9b50629296a1cdd002c8c268b9f25771774b3aa096c1f76529e85663daa275cd190d9cd024cec87139eb732d24206feeacfa3c8aa0fee9436a87b2b8dbc17db657984a30bb28d8516169168218bc0903da6cead4e1a0b4c42330f705fb73fa7bd67a7c50ee43df43a0cb23b0ce98fa4e9f561c856b3da0b440d454521a9dc1f49138a206481ff3b6ef5dcbed02413c164fa6d9dc79e02ea01040c486dda0d7f41e6b90eb32bdab8e84bd1d0ee13c67a56669e0a9f947422fa042c3d336e0468c84e82189a07d9cabec5ec529aa0ff113ffe813bdbf928c7affa08cfec7bafb48e82fb8ccdb5d769272d5f13d5e1573611353bb21b8bdde45b226a0a49902dfbca4be6ea0b8823a70f9ca7bd245b0c014cf5b0d2719e7f58414dba3a0ab3247a2bc3d215a95963242126d41d38177d26e4938cbc0a10f7335a66dc8fc80", - "f90211a09be3ff2eebd72e61762e12df91ecd5986f4a63fac215599e3be9821ee4f89e85a010635b4f5acedf385a83506f19fd9cf4c966406b48b9319fd7064ae8cd99737ea0625fc5861453c6feba481d70695ac64402b676c139a168718d9b3d3b49ce3b53a073753bc3db10a28a51a8e88704d880f5185875d06590b7eb9eb43245209d7337a00b073769bacb397dff42b2dd0f420da9bdfc8e781309a91a4ccd14a117d2b621a0997dd70d3f42e2a38dc70feb158a1d5761c697276b99357282a8a20ab2313108a0d06c62048d279829b074b6753e9b50629296a1cdd002c8c268b9f25771774b3aa096c1f76529e85663daa275cd190d9cd024cec87139eb732d24206feeacfa3c8aa0fee9436a87b2b8dbc17db657984a30bb28d8516169168218bc0903da6cead4e1a0b4c42330f705fb73fa7bd67a7c50ee43df43a0cb23b0ce98fa4e9f561c856b3da0b440d454521a9dc1f49138a206481ff3b6ef5dcbed02413c164fa6d9dc79e02ea01040c486dda0d7f41e6b90eb32bdab8e84bd1d0ee13c67a56669e0a9f947422fa042c3d336e0468c84e82189a07d9cabec5ec529aa0ff113ffe813bdbf928c7affa08cfec7bafb48e82fb8ccdb5d769272d5f13d5e1573611353bb21b8bdde45b226a0a49902dfbca4be6ea0b8823a70f9ca7bd245b0c014cf5b0d2719e7f58414dba3a0ab3247a2bc3d215a95963242126d41d38177d26e4938cbc0a10f7335a66dc8fc80" + "f90211a09be3ff2eebd72e61762e12df91ecd5986f4a63fac215599e3be9821ee4f89e85a010635b4f5acedf385a83506f19fd9cf4c966406b48b9319fd7064ae8cd99737ea05be6665637b2dd64c21ebd4ae406ae85a366c2b5311576365b4b5b28473941aba073753bc3db10a28a51a8e88704d880f5185875d06590b7eb9eb43245209d7337a00b073769bacb397dff42b2dd0f420da9bdfc8e781309a91a4ccd14a117d2b621a0997dd70d3f42e2a38dc70feb158a1d5761c697276b99357282a8a20ab2313108a0d06c62048d279829b074b6753e9b50629296a1cdd002c8c268b9f25771774b3aa096c1f76529e85663daa275cd190d9cd024cec87139eb732d24206feeacfa3c8aa0fee9436a87b2b8dbc17db657984a30bb28d8516169168218bc0903da6cead4e1a0b4c42330f705fb73fa7bd67a7c50ee43df43a0cb23b0ce98fa4e9f561c856b3da0b440d454521a9dc1f49138a206481ff3b6ef5dcbed02413c164fa6d9dc79e02ea01040c486dda0d7f41e6b90eb32bdab8e84bd1d0ee13c67a56669e0a9f947422fa09cb6e9a10e9d13695ee635d586da8c919c54e10901c9256894a84244961a2bc2a08cfec7bafb48e82fb8ccdb5d769272d5f13d5e1573611353bb21b8bdde45b226a0a49902dfbca4be6ea0b8823a70f9ca7bd245b0c014cf5b0d2719e7f58414dba3a0ab3247a2bc3d215a95963242126d41d38177d26e4938cbc0a10f7335a66dc8fc80", + "f90211a09be3ff2eebd72e61762e12df91ecd5986f4a63fac215599e3be9821ee4f89e85a010635b4f5acedf385a83506f19fd9cf4c966406b48b9319fd7064ae8cd99737ea0625fc5861453c6feba481d70695ac64402b676c139a168718d9b3d3b49ce3b53a073753bc3db10a28a51a8e88704d880f5185875d06590b7eb9eb43245209d7337a00b073769bacb397dff42b2dd0f420da9bdfc8e781309a91a4ccd14a117d2b621a0997dd70d3f42e2a38dc70feb158a1d5761c697276b99357282a8a20ab2313108a0d06c62048d279829b074b6753e9b50629296a1cdd002c8c268b9f25771774b3aa096c1f76529e85663daa275cd190d9cd024cec87139eb732d24206feeacfa3c8aa0fee9436a87b2b8dbc17db657984a30bb28d8516169168218bc0903da6cead4e1a0b4c42330f705fb73fa7bd67a7c50ee43df43a0cb23b0ce98fa4e9f561c856b3da0b440d454521a9dc1f49138a206481ff3b6ef5dcbed02413c164fa6d9dc79e02ea01040c486dda0d7f41e6b90eb32bdab8e84bd1d0ee13c67a56669e0a9f947422fa09cb6e9a10e9d13695ee635d586da8c919c54e10901c9256894a84244961a2bc2a08cfec7bafb48e82fb8ccdb5d769272d5f13d5e1573611353bb21b8bdde45b226a0a49902dfbca4be6ea0b8823a70f9ca7bd245b0c014cf5b0d2719e7f58414dba3a0ab3247a2bc3d215a95963242126d41d38177d26e4938cbc0a10f7335a66dc8fc80" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json index e8054eec45..aa39fabc52 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionThreeNibblesInOddLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a06076a491d6fbf97d076a4db1836aa8c9fbf474b980546a2bc7d11ac14d9ebf1500", - "a0dc1cd18f4227f78b445f0896a39da3f2411bec6a4a34b857d9c1a7ba74a53f5500" + "a0479122748b9b2f87c4e546bd6bd45d58cca05ab6eb1f35160adf613db898aa2900", + "a0ce4bc52e3f27c2a1b0ebc7fe0b0a5bcc61353310eb5dc20b39c94d346ef74d5600" ], "keccak_data": [] }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a029bc928d4b56e3e88d97c4ad644b1e96c3a0e830ab73584555e53d1267c6e34200", - "a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e6900", + "a02280c62e531150feda6b9e6059baa43e862d6c0b5697e7675299b1081e8cc88600", "a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f31700", "a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c2900", "a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b1983700", @@ -57,7 +57,7 @@ "a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a200", "a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee700", "a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57c00", - "a0ed068762642f09bde1608aedb9422d576a8a030875e900c6228bc6f10809223200", + "a0cf24dddebca06787d76f2ec01e0769b774b974c4a0046527ea34e1fc9bcc4ec900", "a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdf00", "a0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5300", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e69a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c29a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a0e8a83ed5093d0257a5dcbe0bfa96b7ea967536dc76225f48146e19318abfcf17a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0ed068762642f09bde1608aedb9422d576a8a030875e900c6228bc6f108092232a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380", - "f90211a0a0285aea56abee8f5e3a5691fea65b8b92b6a248765b58306e0117054afb0e69a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c29a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a029bc928d4b56e3e88d97c4ad644b1e96c3a0e830ab73584555e53d1267c6e342a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0ed068762642f09bde1608aedb9422d576a8a030875e900c6228bc6f108092232a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380" + "f90211a02280c62e531150feda6b9e6059baa43e862d6c0b5697e7675299b1081e8cc886a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c29a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a0e8a83ed5093d0257a5dcbe0bfa96b7ea967536dc76225f48146e19318abfcf17a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0cf24dddebca06787d76f2ec01e0769b774b974c4a0046527ea34e1fc9bcc4ec9a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380", + "f90211a02280c62e531150feda6b9e6059baa43e862d6c0b5697e7675299b1081e8cc886a0f3be87c206a0ac0b58f1c381ae4d4c4d744a528a1155bd8190bfb849cd91f317a06fcd9c4bafaee2236668d7d089beb52907a52b1e1eee05e4b87c4b86f4ab8c29a056ef4d2c325d968478c53bd2ce6bdbe46d6fe3e263842631d6eb7e0a97b19837a0f107a60415d7a99f6ab7a4a737658d53709ac1bdbe3596c5211da0b50d78db2da086c0369e7547cb8e999cc44707d0b296adcfec7a906e472a4bcfe25378f4f8e0a029bc928d4b56e3e88d97c4ad644b1e96c3a0e830ab73584555e53d1267c6e342a097031d6df833bae2b4ef4b16a8b437de822c5853415babb79dba4cce16e52bb5a022e344678f6bd7cef8ebba50252fe401c0edf0543665338624bcbc277fba1592a0bac352dbaeaa1339687e9731e9ed4d68e4ae4ec1308622032697406779dada28a058f0dc1daca97d4ea8997446b3f59853855c71e475051797c8d78737c8a159a2a0ea6755d14077974e5b54341a729adb1570259e7293a05bd1d949eb116b53eee7a09b4316f410a639b3cb061e96e18586cb2e6c013a50457481739ecf2be0a5b57ca0cf24dddebca06787d76f2ec01e0769b774b974c4a0046527ea34e1fc9bcc4ec9a0cab13ba74c00b7e56f4ab691800e5d525f0b7d6be2786623c0160ae345bbebdfa0935313b17bc9e6533f500754e297c1945bf8eb5b22c67ff6b01ed442ecc6ed5380" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json index 3652a7babb..f15a573c8e 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountExtensionTwoNibblesInEvenLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a09af29d59e28fdc38fdab99c7196bb57abef45b1d7d519a86258166a8b76cda9f00", - "a07c235c242e7a8665065b9c5badd2fb00e224a8cda2be750086875af5c3857b2600" + "a093ab0d473e301f4fb868a401e2e0131b282c510789371f1aace2dc42f4126e8200", + "a0d55ce42f150b4ca1306a7078adbe4f43722602230994cf2d08e51ca0fd23f7c900" ], "keccak_data": [] }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a050ecd22fad9c981f1659378fa2592c14cea949f0d7399f369ba5fa3797baa1e100", - "a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b75900", + "a08929d7cbe58f49471dc59115dcce107fb80c26acb4e10fe488333486d8994e6c00", "a005394ea3697f0d1a4b1a491780d3ec90bc36c3bcf303d1fb4db14fb4dc33b7f100", "a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b94400", "a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b73800", @@ -57,7 +57,7 @@ "a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3b00", "a05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707ef00", "a07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf242578800", - "a0ea2daebfd939a3b71bb40e163c69dbf58ffb231717379c9ffe28fc46ada8f46500", + "a0897708188be3c96ab9662a9a088f4424ca8a2900c9a30e0d1d5d15645c980e9900", "a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1b00", "a060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125700", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90211a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b759a005394ea3697f0d1a4b1a491780d3ec90bc36c3bcf303d1fb4db14fb4dc33b7f1a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b944a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0ea2daebfd939a3b71bb40e163c69dbf58ffb231717379c9ffe28fc46ada8f465a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780", - "f90211a03df0ec6238f74744cb77157c19dd73f4e332fded781ed8876230d9859431b759a050ecd22fad9c981f1659378fa2592c14cea949f0d7399f369ba5fa3797baa1e1a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b944a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0ea2daebfd939a3b71bb40e163c69dbf58ffb231717379c9ffe28fc46ada8f465a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780" + "f90211a08929d7cbe58f49471dc59115dcce107fb80c26acb4e10fe488333486d8994e6ca005394ea3697f0d1a4b1a491780d3ec90bc36c3bcf303d1fb4db14fb4dc33b7f1a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b944a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0897708188be3c96ab9662a9a088f4424ca8a2900c9a30e0d1d5d15645c980e99a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780", + "f90211a08929d7cbe58f49471dc59115dcce107fb80c26acb4e10fe488333486d8994e6ca050ecd22fad9c981f1659378fa2592c14cea949f0d7399f369ba5fa3797baa1e1a0d8a8744381662bf8f66c693e0f25669099e3d504a69caf7d0d9c787f1517b944a09275065b8b5736e752fffa139b045bf544fb01db8ef9900ee622f9c40266b738a059669363292d9f0c8806794621457b8ee9c4e76237b2a1510c6efb1e6664c2bea0286a8fb8d081e4549ef670fdb82d03c29328f1fe5df262b33ac0898c19c0519fa06bdd07754d71c759de3cc3b158b6d562d790b7ffd417ceb6692da5178f183bf9a087f6cca1455dded7aaaf4dedc687e4aff0f02329d3fd1f7e65aab6f37dcbf7bca0cfedb8c8c4a27a8d2d3bf8b7d5364fc05d0d140d6ea899e6794ead88949f85e4a0b395721bef01e57d767ca8f77dcd57f49e81fe28b06764218c05e3171bc70445a0427dc608dabea2de3a1607af6934804b544e44f586744e3bac855638424a0a3ba05b490ab2800ad7f5c0e3a3f910c948b1c8fcbcc84f85b0bbeb18829678c707efa07c92720df095623f9dd7ce389fc7374d87936f747fdeca5b67d6f79cf2425788a0897708188be3c96ab9662a9a088f4424ca8a2900c9a30e0d1d5d15645c980e99a00ac7fec7b6bcc2f9a06978922b93d28ca68924d9421ce3350b58225890c93a1ba060324b2eb29958143c699646192ba7423726dd6ffe395c4fd1a40e5ff08d125780" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json index ad17df2223..1760999745 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json +++ b/zkevm-circuits/src/mpt_circuit/tests/AccountWrongExtensionNode.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0e2da51be53d789e31efedb5dd6dec64935937dbcc23ad5b811c74f112ed13b3400", - "a0e2da51be53d789e31efedb5dd6dec64935937dbcc23ad5b811c74f112ed13b3400" + "a09590d5bab0258cd40009b7f8662a6bfa81022e92bae2f384395de9a76f388be700", + "a09590d5bab0258cd40009b7f8662a6bfa81022e92bae2f384395de9a76f388be700" ], "keccak_data": [] }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b09700", - "a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b09700", + "a03b28e2d82406ab525890f9b2f2fb2636fe1a90eade3e5f15fe5c526923b0ad9300", + "a03b28e2d82406ab525890f9b2f2fb2636fe1a90eade3e5f15fe5c526923b0ad9300", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,64 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f90131a0c5038909ca72e592efce930e006679592871afe7fa8dd187d52f2066ab05b097a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a03b28e2d82406ab525890f9b2f2fb2636fe1a90eade3e5f15fe5c526923b0ad93a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a03b28e2d82406ab525890f9b2f2fb2636fe1a90eade3e5f15fe5c526923b0ad93a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + ] + }, + { + "start": null, + "extension_branch": { + "is_extension": false, + "is_mod_extension": [ + false, + false + ], + "is_placeholder": [ + false, + false + ], + "is_last_level_and_wrong_ext_case": false, + "extension": { + "list_rlp_bytes": "00000000000000000000000000000000000000000000000000000000000000000000" + }, + "branch": { + "modified_index": 0, + "drifted_index": 0, + "list_rlp_bytes": [ + "f851", + "f851" + ] + } + }, + "account": null, + "storage": null, + "mod_extension": null, + "values": [ + "a0ff495bf63ef54625b0e5ead46f8a092ec7a2632228a57be2fe21b5e7e156b49000", + "a0ff495bf63ef54625b0e5ead46f8a092ec7a2632228a57be2fe21b5e7e156b49000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ef04e8a7a5714779617d01d6d355bc53724f9a0c040752d44c83b7850f8ce4dc00", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "80000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000", + "00000000000000000000000000000000000000000000000000000000000000000000" + ], + "keccak_data": [ + "f851a0ff495bf63ef54625b0e5ead46f8a092ec7a2632228a57be2fe21b5e7e156b4908080808080808080808080a0ef04e8a7a5714779617d01d6d355bc53724f9a0c040752d44c83b7850f8ce4dc80808080", + "f851a0ff495bf63ef54625b0e5ead46f8a092ec7a2632228a57be2fe21b5e7e156b4908080808080808080808080a0ef04e8a7a5714779617d01d6d355bc53724f9a0c040752d44c83b7850f8ce4dc80808080" ] }, { @@ -116,7 +172,7 @@ "a0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ad00", "a0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba3068200", "a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912900", - "82102300000000000000000000000000000000000000000000000000000000000000", + "82002300000000000000000000000000000000000000000000000000000000000000", "a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe3800", "00000300000000000000000000000000000000000000000000000000000000000000", "a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe3800" @@ -124,8 +180,8 @@ "keccak_data": [ "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", "f90211a0d7b22b8e48dd9330e69d637e6df090b836a701139d477ee26164dcdd7605ca72a0c31326fbf2b3872e7652b1d54e9ca7ab865f06e999a8dbb08322d7d55ffca8a5a0f2774bb6d1329eaca8efdacaac909b5e2c9a955cfd53960c04b0212e1924aae1a09c12a0fe0f9f84640970b262625d4c36bda63fdb2dc119eeda4eeb96ce43fcfda0644b63227aaa55ac8f3eac8e9adb2869a28871c2292681d369725e3e91f461aaa0e55eb109e222b49c21f977a34ac2daac5c5a0d2c16e7056448cb13c03e2e2222a00fafb334f454c569702bfc73ba4cedfb58053ec99d09079964e0caf9fab77df8a00ee5ef2d4b74276d2959c82b125ecc853eaf17c8445daa5f24e2e9b7426225b8a006c531c93927f8511ac40ba7e6f364df61261401e227b4a1accc4350addf592aa00383c3ce7c16cf0e8e5bd8874dca45013573df55345f2be3ed528a5f5d46e3e8a0626d4020c98ccddda401d13954d1f96c5765460c25a0728b1b9168823eb7966ca05b1121cf8ef31e6314ad1481bf3b9ebaae164de2838c384ac23544b0f9bd6cb0a027181df0ecbfedc34afffb3d13e8dab56f53457d46d087b651007d552615190ba0bff94cfcd9ac3a5f858a90f30957bffd1796d7ba99d61b11800a9acaca2bc1ada0ee931652744729ee54003e280099cd5ac2ea3dffcdc5370029efc5aedba30682a0166381de83a37328205ed261b58d4dad09b8d6a4322c8b71f1ff07d52b08912980", - "e4821023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38", - "e4821023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38" + "e4820023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38", + "e4820023a072cb63467e9d1c8e3d7f69d2bce2b48d8f64bb442ea93c68c5b9ed122de4fe38" ] }, { @@ -172,7 +228,7 @@ "a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000", "00000000000000000000000000000000000000000000000000000000000000000000", "9d300000000000000000000000000000000000000000000000000000000000000000", - "a01018", + "a00018", "00000800000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", "a000100000000000000000000000000000000000000000000000000000000000", diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json index 3877179b67..51ef85b085 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore4After1.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a01fb27c5dcb862f9c34bbe7d1d3f6820dd1c11177b0189c9fbce5697b26894b7600", - "a0fe93777900dd532b0109e40174eed05cfe84757ae3117cb54417975424e8cd7300" + "a0e576f05198d4475a0dd9b5a27c9b758dc82b04ada48ca77de61014155890fd0400", + "a0ec7d43a4c3a5fc9846ffd6597aac16f79a30347455afbc2d65423a772d89fef100" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941d00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be0100", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0335feb3b6b6a653d0af79dc2ff84e5c8d9a516733b99735e1d484d9330ca3b0100", + "a041e524ea6ef62f8199c2c62ad00f980ce78893c5b23a01a665345422484bca3e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0335feb3b6b6a653d0af79dc2ff84e5c8d9a516733b99735e1d484d9330ca3b01a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a041e524ea6ef62f8199c2c62ad00f980ce78893c5b23a01a665345422484bca3ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be01a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0dea586a1e6eb20f0a627a0d8ead570bda5697058bb069cd60aea20d1ad6f063600", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0dea586a1e6eb20f0a627a0d8ead570bda5697058bb069cd60aea20d1ad6f06368080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0dea586a1e6eb20f0a627a0d8ead570bda5697058bb069cd60aea20d1ad6f06368080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json index 31d0d87a84..af24bc22a6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBefore6After1FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0dce3bb893ac0a04cd76e6c16beeb687c890038aaacaaff5ec6dd6081bfae521a00", - "a0804cc8e814123034ea541bf1505a53ba97826d2cc0563a00af086e77ee32d9e100" + "a0094f976b3f252927f64909b86402c7e8bb1d9b3efcf779b4381fde5dbce0ba7000", + "a07cbe87ec00f77f6420ad8f049c506924b2e6e3a1e2144694d84dc0a79e4d731500" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a03b84c68c5c2f0ae57338b04bef9d84c6a60460988de0ec8431243fafb061bf5b00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a09fa7da5945e312a62501a28b587c166662de34380ca8b658a37fd0500ff504ea00", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0243ffa5e3afe85967fa2c3898411f282321ee7d71120bbd7968902a47c55b39700", + "a063ccd6cd927659baddf18b3aa31a313efd3435095d3b3255f3c79d0ab792874a00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0243ffa5e3afe85967fa2c3898411f282321ee7d71120bbd7968902a47c55b397a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a03b84c68c5c2f0ae57338b04bef9d84c6a60460988de0ec8431243fafb061bf5ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a063ccd6cd927659baddf18b3aa31a313efd3435095d3b3255f3c79d0ab792874aa066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a09fa7da5945e312a62501a28b587c166662de34380ca8b658a37fd0500ff504eaa066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0227294955a65f5106b2bc9c8335b80f82aa191e65eac7311ff5bfa4bd74e44e000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0227294955a65f5106b2bc9c8335b80f82aa191e65eac7311ff5bfa4bd74e44e08080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a02f21ee785f3f4945b398869b9fdbf80a988cd4638080c534138c6c0b125880cc8080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0227294955a65f5106b2bc9c8335b80f82aa191e65eac7311ff5bfa4bd74e44e08080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a02f21ee785f3f4945b398869b9fdbf80a988cd4638080c534138c6c0b125880cc8080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json index bc01711e18..bcd789d463 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedBranchDeletedFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a07be7d711537387ab3d6be9621914205468460f0c0b46de4d1be1ede954afefa900", - "a038c92d7251e37ffcea5311631d7aa1f7e23fb8df348f7869014b71211bb0fcd000" + "a010bfae44201eff78b1e1689f4af6e28cf96de6256de2f70203f0e485b23c93b400", + "a021a048aa7c9ee49af0979a2dca96d0036ec6b67690dd284243340eebd77a5f0a00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d200", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c1200", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a005cda6d36afe72e82e7ebef45272d0d69910f0bedd476dccd09a1e6f0b7c9b6400", + "a0a659e862fa10933c607c7fe06fe604aeef297aec137df792c05a14ed40ae8f8e00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a005cda6d36afe72e82e7ebef45272d0d69910f0bedd476dccd09a1e6f0b7c9b64a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0a659e862fa10933c607c7fe06fe604aeef297aec137df792c05a14ed40ae8f8ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c12a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a06601698b2b1c3b46d2a7e55874787a0b6e268334ec067878ec9bac45a410914e00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a06601698b2b1c3b46d2a7e55874787a0b6e268334ec067878ec9bac45a410914e8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a06601698b2b1c3b46d2a7e55874787a0b6e268334ec067878ec9bac45a410914e8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json index b6b8d98c73..00e522f47f 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeDeletedExtShortIsBranchFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a00165aa0af332543a0d3fe661211bc5994ce5a3e614b425e64ecb1b2501b5417e00", - "a038c92d7251e37ffcea5311631d7aa1f7e23fb8df348f7869014b71211bb0fcd000" + "a09e42774afe63c0047f0240aec1fb4078c2c4f5ff9cc0a439da9b2d76c71bc03700", + "a021a048aa7c9ee49af0979a2dca96d0036ec6b67690dd284243340eebd77a5f0a00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d200", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c1200", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0f4bb652318a0f15d555739d1ee4c32fd859663c3e2f381a993fc071921a0339900", + "a09b03fc2de3c936329b8e84ebabd633ed2a96122774237005e6b3e71a12002efc00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0f4bb652318a0f15d555739d1ee4c32fd859663c3e2f381a993fc071921a03399a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a090534306b8c80895754213d368972c5f2765bef4b20215538620535d61ae22d2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a09b03fc2de3c936329b8e84ebabd633ed2a96122774237005e6b3e71a12002efca066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0b4cef5ba7a4a42b0e6bc23d70ac8d20775482ecaa2ba1e9325c258098b387c12a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0dd0d00c17fc4aeebf18a10b1c38bc63db7c507845addb89b38fb968de0bec2b700", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0dd0d00c17fc4aeebf18a10b1c38bc63db7c507845addb89b38fb968de0bec2b78080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0dd0d00c17fc4aeebf18a10b1c38bc63db7c507845addb89b38fb968de0bec2b78080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0751966489311a3dd4da8d174c746f800fbbc5a014ff95ba8a266934548786a458080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json index 9dd0cfe35a..b9416bb6ed 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore4After1.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0fe93777900dd532b0109e40174eed05cfe84757ae3117cb54417975424e8cd7300", - "a0d5ab09aa0d188ce13d5401bb55f9849dc86433836f4c7f96c6b6326e5691919d00" + "a0ec7d43a4c3a5fc9846ffd6597aac16f79a30347455afbc2d65423a772d89fef100", + "a0db8afb1c8e5f18f0ab8122d99a36b6968947ace533782261cb0d566163d2b0ea00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0720800eb9ebbb16205f1b83e2c427f3d503241ba170980ac4a01800c931e699500", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04707f71ed290b8e5be8b779a82c05a4a14fec40ae63fd283b1a9fe6f15e2a45700", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941d00", + "a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be0100", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0df515bc15d60f45cd9284e2a153d7f308e0fd544a83f95b6a60d361a0432941da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0720800eb9ebbb16205f1b83e2c427f3d503241ba170980ac4a01800c931e6995a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a06a55593fb3193f7f8995cc0b5a163105647dd6c962d7f2e43a43a47e6199be01a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04707f71ed290b8e5be8b779a82c05a4a14fec40ae63fd283b1a9fe6f15e2a457a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a07fbdf0e81a0cf7826d6ef80d68dd85f91e51876f51f0c6ea1daf42f3162ca2798080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a00bb152c057dd4b0eed88e46b34e669d455e19e89681c0532a8fa31ed6e86568c8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a07fbdf0e81a0cf7826d6ef80d68dd85f91e51876f51f0c6ea1daf42f3162ca2798080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json index ff4a566d99..cb95541dc7 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After1FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", - "a0126b65c7395cd5e5be4e5d56de943a2451fa937e8bf58a07329a527cdb98937e00" + "a01bca6c30b7849034865d516439f00605fe803d4398b7fa61b87bd2f7b4c43fc700", + "a0b7dde598834b9c8709c1ae8f5dc779155f88b4d19166c29509a85b1a10e9eb6600" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0de59aa84090924e14019ddc7a474760b00c6bde8826e060533c20e473ab9e4d600", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0f3cad22d55741b5a02cb06cf2c3c789879ad70025271f7348a4eed8a2996a4d600", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", + "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0de59aa84090924e14019ddc7a474760b00c6bde8826e060533c20e473ab9e4d6a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0f3cad22d55741b5a02cb06cf2c3c789879ad70025271f7348a4eed8a2996a4d6a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0a86128fac4cc091de8c60624410647010871a342aeb8845e664ce5ea5f9026d08080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0a86128fac4cc091de8c60624410647010871a342aeb8845e664ce5ea5f9026d08080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json index aaf45c75c2..9b5c26481e 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After2FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", - "a02ebdc563953203aa4d483ec0b4c155279d3d67dd094f69b7287c1c5e6f57bb7200" + "a01bca6c30b7849034865d516439f00605fe803d4398b7fa61b87bd2f7b4c43fc700", + "a030bc85c43c9b006092cffc9b7cb943e1e756079c486b781e32677b9f00d7ef1d00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0ce2011879023724bf7232bbb674dcdb4bc08979934bc7c977b2daa454daa2bc800", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a02d2c27804cae1cabc7d2e9cfc855e23e1b7e1ef1dcb7ca2e6bc39c1d21c053fb00", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", + "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ce2011879023724bf7232bbb674dcdb4bc08979934bc7c977b2daa454daa2bc8a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a02d2c27804cae1cabc7d2e9cfc855e23e1b7e1ef1dcb7ca2e6bc39c1d21c053fba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0fb279ae949a1f68e723fd9859135fcefa3e37f46a8130aef66ffceedd475cd6a8080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0fb279ae949a1f68e723fd9859135fcefa3e37f46a8130aef66ffceedd475cd6a8080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json index 62ff36016f..8916ccb17a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore5After3FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", - "a08d65425f1cbb59252a336d8dbade50f0d6b2bbcc01283d0f6042895db60d443d00" + "a01bca6c30b7849034865d516439f00605fe803d4398b7fa61b87bd2f7b4c43fc700", + "a0ecafef9d6585d926050b89ce9b4d12f9ff13ea182ca051e63a5f22c601bd67a400" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0ba0b9d83deb6b898f1db064694abe5bb19e71f60309284408570c1701847615d00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0ac674d1b703b8824b26c9f9a9ffa957c517a9f6d6b36dbaacdc4253df9a9f32000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", + "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ba0b9d83deb6b898f1db064694abe5bb19e71f60309284408570c1701847615da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ac674d1b703b8824b26c9f9a9ffa957c517a9f6d6b36dbaacdc4253df9a9f320a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0a270fe8b519da58761d8ad2a550ba083db50fc30c625260ed1cab8a5348c59198080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0a270fe8b519da58761d8ad2a550ba083db50fc30c625260ed1cab8a5348c59198080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json index cba3d93dbc..3522dc3db6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After1FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0f2cd1783c504f66b8f37c580aaceb5dab5e84497572177995e861e22e3bce5df00", - "a0983976070bc780ea0729aabc34034e80f4521f8612258e654a2d7ee7593df32200" + "a0ee1a7e0e81a4f3568bc4c4f595128d62de38d6a2beb038667bfdddd4c564576c00", + "a0bb8aa42f7b6f0d3ec6588d409c0566ef5bc8d4d38ad1122b3b5806c777d06f7700" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a04624f128fd7c40d4f870ab0d0fdae13453d31bb332a6178a5297f1948320c3ae00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0bfe0c7caab351f5da526b2901d3616ec01278a814f4599ce2d840a9aa1c9ad1b00", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2e00", + "a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738b00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04624f128fd7c40d4f870ab0d0fdae13453d31bb332a6178a5297f1948320c3aea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0bfe0c7caab351f5da526b2901d3616ec01278a814f4599ce2d840a9aa1c9ad1ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03f0edc47ed07bac0b4f417e10d989deb422bfbd832cf994f5c04e2df50dfc4768080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03f0edc47ed07bac0b4f417e10d989deb422bfbd832cf994f5c04e2df50dfc4768080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json index 9076e3d177..c3803b4996 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After2FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0f2cd1783c504f66b8f37c580aaceb5dab5e84497572177995e861e22e3bce5df00", - "a03a6e6c9094f96af3099ccc150b7154cb0f1d9e0b86d243b92cbd8a36fa91436800" + "a0ee1a7e0e81a4f3568bc4c4f595128d62de38d6a2beb038667bfdddd4c564576c00", + "a03ebdcd8625fa515da66564fd5efd258410496bc3a7cfc38394f27cd5b16acad600" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a04776885f8215cc721fb6022eda3c960690e8a0b6dbbc214511e7e7e0027de4f200", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a080ba1e579a6f530f3f5ef6e4f4ab90bbb0ad7021b958a445c778ba1223c3b6c900", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2e00", + "a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738b00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04776885f8215cc721fb6022eda3c960690e8a0b6dbbc214511e7e7e0027de4f2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a080ba1e579a6f530f3f5ef6e4f4ab90bbb0ad7021b958a445c778ba1223c3b6c9a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a07bd180a06d9476ff8a19a22be57c8a41ecc57b27b57e9c83aafe050929e485e88080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a07bd180a06d9476ff8a19a22be57c8a41ecc57b27b57e9c83aafe050929e485e88080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json index 9d3abf8df9..0ab4286419 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedBefore6After4FirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0f2cd1783c504f66b8f37c580aaceb5dab5e84497572177995e861e22e3bce5df00", - "a0c146b6beed1fa6da815e9d20bd312e0a5dce7b0bfa8f876007e73171aee75ead00" + "a0ee1a7e0e81a4f3568bc4c4f595128d62de38d6a2beb038667bfdddd4c564576c00", + "a00532d26d77248078301639f3f967287ec84bff4196a66074ee27d90157dacf4600" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0dba517c04418b0e35c17fb1db2698283882f72fbdd68f7562006648db5afc7f000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04d805944bb5a1e60c04931be76b0f2164b7a52e9a73cb9b7094f873b31bdfe0500", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2e00", + "a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738b00", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a08956506a7edd00ca1a8836500cff58e0465759556d67b26d8a6c9ec187eb5b2ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0dba517c04418b0e35c17fb1db2698283882f72fbdd68f7562006648db5afc7f0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a007d98b211f874588a89b8947aa9bf9ef722458aa0d5514fd1a608b104cb5738ba066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04d805944bb5a1e60c04931be76b0f2164b7a52e9a73cb9b7094f873b31bdfe05a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03fb632d1b373bfe19c0b83f1f62fbfc631dda6c1d02e16d98ffa6968209c5c428080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0321934b620a646a275a2df20f6ea1e8f53c0a25389966335874e0f6291a2edc08080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03fb632d1b373bfe19c0b83f1f62fbfc631dda6c1d02e16d98ffa6968209c5c428080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json index 0ebf597ebc..bf5532afd4 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedExtShortIsBranchFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", - "a0e1583fd2dcb686b942aa7f2b9ce00d874e77b3abf54c4103ce6cf768707322c900" + "a01bca6c30b7849034865d516439f00605fe803d4398b7fa61b87bd2f7b4c43fc700", + "a0f68d8adbc1c6717a1349a089e7f539c804a7fb74bd9dee878c9862843c1aa0b700" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0ad2bedbc0f8c43da33f5211dd8a01f8df97c4f1a21690c9a14970adf41860bfa00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a04302d4fa284e1825678b91c7f7a21ce8e450049efeb512c5969b890b39e6f01300", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", + "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0ad2bedbc0f8c43da33f5211dd8a01f8df97c4f1a21690c9a14970adf41860bfaa066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a04302d4fa284e1825678b91c7f7a21ce8e450049efeb512c5969b890b39e6f013a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03c376d903a16b0f15fc878e3cf248541c0195d256ae44ccda3861ed784a327f78080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03c376d903a16b0f15fc878e3cf248541c0195d256ae44ccda3861ed784a327f78080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json index c6dd9ff696..d52332088a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtNodeInsertedInNewBranchFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a009abc55243b91fe2e9d7487de1352bebfb625a7f34867a9fd47d585fd56c1c2b00", - "a0b56337f1538767ab36ed8256c14420eea15d3c1a6b4ec6cab35d41154087bff100" + "a01bca6c30b7849034865d516439f00605fe803d4398b7fa61b87bd2f7b4c43fc700", + "a0ba8a2b40e83a7a3c5189c84a416b53788d0537621afa9288a28d06f85d9df21f00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a09bd74bc59a41096445c13404fdd1ecc6da241a20356ad3d204222e791afbbc0d00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a090b0b99e6bfda6f21367140879cf5bab6e8e3dc87075f3556a33dfc722536b4c00", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379e00", + "a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d6300", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0defa1c3003dcada0cc4ed2f383678e49e90c883f27d21691a8fcfbf43498379ea066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a09bd74bc59a41096445c13404fdd1ecc6da241a20356ad3d204222e791afbbc0da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a093be033937b76ae8d9a81a36c953577db5cda57279e6894d08313a38ca651d63a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a090b0b99e6bfda6f21367140879cf5bab6e8e3dc87075f3556a33dfc722536b4ca066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a06d02ace83a9377574bc546acce6ae3264e34e0d09294116f102263e5a36039a38080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0b3dd78df961fd98733c40ac332dcdfd4eb782d0b53d4c4e498f57d06eaf06b9c8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a06d02ace83a9377574bc546acce6ae3264e34e0d09294116f102263e5a36039a38080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json b/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json index c9b1a51072..7292b415f6 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json +++ b/zkevm-circuits/src/mpt_circuit/tests/ExtensionIntoBranch.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0198ecef2b1da18c37fa6e435336eafdd4a7955ebf9dcb61f8a486c64ccc61eb900", - "a0104d2b3a224f2a20987a5d9bf81f5d8fd3f61f1de4c6cc48b0d7934fa330a0c100" + "a0eb604b7adf0a4f491e89a160de691560eb1f24fd79abc2e2f78aedfa6aa20f6500", + "a0348e36c4d8139388ad9c32c9aec06991296e63f29f033c8869d9aa01528cd92000" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 13, "drifted_index": 13, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -43,8 +43,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0df9727eeee3dbaceec09f27569ca580783fb93f4eabce11d5667d8f6a70fb3e600", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a07be86d309a4bf1c143e74fae9689bd566daa7c1b0528156430c6aebf307a364d00", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a02ac00ba4cde24327d8f82b45197129b9911da57cdd16a7cefe0a524bcd7345e200", + "a0d273c0435594c39eeb1d7815caf7c071d79b4e635dc35e3fafa5b02d442b2f7200", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a02ac00ba4cde24327d8f82b45197129b9911da57cdd16a7cefe0a524bcd7345e2a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0df9727eeee3dbaceec09f27569ca580783fb93f4eabce11d5667d8f6a70fb3e6a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a0d273c0435594c39eeb1d7815caf7c071d79b4e635dc35e3fafa5b02d442b2f72a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a07be86d309a4bf1c143e74fae9689bd566daa7c1b0528156430c6aebf307a364da066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { @@ -90,8 +90,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f871", - "f871" + "f851", + "f851" ] } }, @@ -112,7 +112,7 @@ "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a00", + "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", "a0444f38b75c480b42c37fa40b55a95411c163fd1d675363c70f1ca2f15a8ae0db00", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -122,8 +122,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a0444f38b75c480b42c37fa40b55a95411c163fd1d675363c70f1ca2f15a8ae0db8080", - "f8718080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e0808080808080a04404fa72ce297220deb39c91d9343df502d5c911d708b9fadc0526c043d0a50a80a03904685eec6d8d3e6357c1a7c0e34fbb9bbe036eb34d88b4187e5f73acd122148080" + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a0444f38b75c480b42c37fa40b55a95411c163fd1d675363c70f1ca2f15a8ae0db8080", + "f8518080808080a0ed2fba131fadeadeb1082f565fff16ceb008f693056e3140204716c0739cf1e08080808080808080a03904685eec6d8d3e6357c1a7c0e34fbb9bbe036eb34d88b4187e5f73acd122148080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json index 79afcb98d9..5f75ba781a 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountAfterFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", - "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900" + "a06515b1a21d53e95962386ef49edeeebbbeba1fcf5cc17a7924fceae0eab2042c00", + "a06515b1a21d53e95962386ef49edeeebbbeba1fcf5cc17a7924fceae0eab2042c00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 14, "drifted_index": 14, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json index 9bb03688d6..3bf9cadb87 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json +++ b/zkevm-circuits/src/mpt_circuit/tests/NonExistingAccountNilObjectInFirstLevel.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900", - "a0468d1a8b37720df40231d2a87c72b2ba41b6083102bf9dea6376d06129d33ae900" + "a06515b1a21d53e95962386ef49edeeebbbeba1fcf5cc17a7924fceae0eab2042c00", + "a06515b1a21d53e95962386ef49edeeebbbeba1fcf5cc17a7924fceae0eab2042c00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90111", - "f90111" + "f90131", + "f90131" ] } }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "80000000000000000000000000000000000000000000000000000000000000000000", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "80000000000000000000000000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", - "f9011180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080", + "f90131a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f0098080" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json index 728de076eb..6c327631ba 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExisting.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0e36357ff21583b48c9625a721f0f546330d24c6c0d239108cc21217cd61406c900", - "a0e36357ff21583b48c9625a721f0f546330d24c6c0d239108cc21217cd61406c900" + "a08c3959eb231ae95ba9cc0a346b266d508d6e74e18052db16805f5c8cd440715f00", + "a08c3959eb231ae95ba9cc0a346b266d508d6e74e18052db16805f5c8cd440715f00" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90151", + "f90151" ] } }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d00", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d00", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80" + "f90151a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80", + "f90151a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a01cff8afad6e714b666a0cd19b7118d6a87fe86563570e15c5bd8c06aa4fad27d80" ] }, { diff --git a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json index b5dbd034e0..fc0bf16571 100644 --- a/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json +++ b/zkevm-circuits/src/mpt_circuit/tests/StorageInFirstLevelNonExistingLong.json @@ -9,8 +9,8 @@ "storage": null, "mod_extension": null, "values": [ - "a0601c8ae613f946a293f9aacd219cc6ca8d572b2654c55f06d100d3ed1e0490fd00", - "a0601c8ae613f946a293f9aacd219cc6ca8d572b2654c55f06d100d3ed1e0490fd00" + "a04bcaa1aa5b184f53868d6ae2f5160505b04b1407e8ed464536400ed6c623d8b500", + "a04bcaa1aa5b184f53868d6ae2f5160505b04b1407e8ed464536400ed6c623d8b500" ], "keccak_data": [] }, @@ -34,8 +34,8 @@ "modified_index": 15, "drifted_index": 15, "list_rlp_bytes": [ - "f90131", - "f90131" + "f90151", + "f90151" ] } }, @@ -44,7 +44,7 @@ "mod_extension": null, "values": [ "a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381100", - "80000000000000000000000000000000000000000000000000000000000000000000", + "a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2a00", "a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf100", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", @@ -57,7 +57,7 @@ "a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb00", "80000000000000000000000000000000000000000000000000000000000000000000", "80000000000000000000000000000000000000000000000000000000000000000000", - "a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd1400", + "a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a000", "a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f00900", "a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381100", "00000000000000000000000000000000000000000000000000000000000000000000", @@ -66,8 +66,8 @@ "00000000000000000000000000000000000000000000000000000000000000000000" ], "keccak_data": [ - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180", - "f9013180a0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a085880d90258c3f5cfb586bc74bcde6c0a28149e7b7fa6bf6a69c08ae0836cd14a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180" + "f90151a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180", + "f90151a0b3c64a7e62c44e6d2f9abc6dfb6852bb61032d087db6d57aa3c7497493adda2aa0ab8cdb808c8303bb61fb48e276217be9770fa83ecf3f90f2234d558885f5abf18080a01a697e814758281972fcd13bc9707dbcd2f195986b05463d7b78426508445a04a0b5d7a91be5ee273cce27e2ad9a160d2faadd5a6ba518d384019b68728a4f62f4a0c2c799b60a0cd6acd42c1015512872e86c186bcf196e85061e76842f3b7cf86080a02e0d86c3befd177f574a20ac63804532889077e955320c9361cd10b7cc6f580980a06301b39b2ea8a44df8b0356120db64b788e71f52e1d7a6309d0d2e5b86fee7cb8080a01b7779e149cadf24d4ffb77ca7e11314b8db7097e4d70b2a173493153ca2e5a0a066a7662811491b3d352e969506b420d269e8b51a224f574b3b38b3463f43f009a0e7a5cbffa7c7d4d2fd18b246e712139596ce40ab56cba10a2510db9e5a6e381180" ] }, { From dd04884a4219ac0665e7150a8f3033c3067909ee Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Tue, 23 Apr 2024 10:23:50 +0200 Subject: [PATCH 43/43] gofmt --- .../mpt/witness/gen_witness_from_infura_blockchain_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go index 3389336663..d2eceb19b7 100644 --- a/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go +++ b/geth-utils/gethutil/mpt/witness/gen_witness_from_infura_blockchain_test.go @@ -2378,7 +2378,7 @@ func TestStorageWrongExtensionNode(t *testing.T) { } func TestStorageWrongExtensionNode1(t *testing.T) { - // This test slightly differs from TestStorageWrongExtensionNode in key3 - + // This test slightly differs from TestStorageWrongExtensionNode in key3 - // TestStorageWrongExtensionNode: // key3 := common.HexToHash("0x1277000000000000000000000000000000000000000000000000000000000000") // TestStorageWrongExtensionNode1: