Skip to content

Commit

Permalink
Merge #2335
Browse files Browse the repository at this point in the history
2335: Fix decoding root hash from hex r=Deniallugo a=Deniallugo



Co-authored-by: Danil <[email protected]>
  • Loading branch information
bors-matterlabs-dev[bot] and Deniallugo authored Mar 3, 2023
2 parents c6fb286 + 43e631f commit beda466
Show file tree
Hide file tree
Showing 32 changed files with 189 additions and 110 deletions.
122 changes: 90 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/bin/data_restore/src/inmemory_storage_interactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl InMemoryStorageInteractor {

let verify_op = Operation {
action: Action::Verify {
proof: Box::new(Default::default()),
proof: Box::default(),
},
block: block.clone(),
id: None,
Expand Down
2 changes: 1 addition & 1 deletion core/bin/key_generator/src/sample_proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ pub fn make_sample_proofs(config: ChainConfig) -> anyhow::Result<()> {
};

let serialized = serde_json::to_vec_pretty(&precomputed_proofs)?;
std::fs::write(get_precomputed_proofs_path(), &serialized)?;
std::fs::write(get_precomputed_proofs_path(), serialized)?;
Ok(())
}
3 changes: 3 additions & 0 deletions core/bin/zksync_api/src/fee_ticker/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ fn test_ticker_subsidy() {
);

let config = get_test_ticker_config();
#[allow(clippy::box_default)]
let mut ticker = FeeTicker::new(Box::new(MockTickerInfo::default()), config, validator);

// Only CREATE2 is subsidized
Expand Down Expand Up @@ -456,6 +457,7 @@ fn test_ticker_formula() {
);

let config = get_test_ticker_config();
#[allow(clippy::box_default)]
let mut ticker = FeeTicker::new(Box::new(MockTickerInfo::default()), config, validator);

let get_relative_diff = |a: &Ratio<BigUint>, b: &Ratio<BigUint>| -> BigDecimal {
Expand Down Expand Up @@ -690,6 +692,7 @@ fn test_zero_price_token_fee() {
);

let config = get_test_ticker_config();
#[allow(clippy::box_default)]
let ticker = FeeTicker::new(Box::new(MockTickerInfo::default()), config, validator);

let token = TestToken::zero_price();
Expand Down
19 changes: 7 additions & 12 deletions core/lib/circuit/src/exit_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,28 +250,23 @@ pub fn create_exit_circuit_with_public_input(
let serial_id_fe = Fr::from_str(&nft_serial_id.to_string()).unwrap();
let root_hash = account_tree.root_hash();
let (account_witness, _, balance, _) =
apply_leaf_operation(account_tree, *account_id, *token_id as u32, |_| {}, |_| {});
let (audit_path, audit_balance_path) = get_audits(account_tree, *account_id, *token_id as u32);
apply_leaf_operation(account_tree, *account_id, *token_id, |_| {}, |_| {});
let (audit_path, audit_balance_path) = get_audits(account_tree, *account_id, *token_id);

let (special_account_witness, _, special_account_balance, _) = apply_leaf_operation(
account_tree,
NFT_STORAGE_ACCOUNT_ID.0,
*token_id as u32,
*token_id,
|_| {},
|_| {},
);
let (special_account_audit_path, special_account_audit_balance_path) =
get_audits(account_tree, NFT_STORAGE_ACCOUNT_ID.0, *token_id as u32);
get_audits(account_tree, NFT_STORAGE_ACCOUNT_ID.0, *token_id);

let (creator_account_witness, _, creator_account_balance, _) = apply_leaf_operation(
account_tree,
*nft_creator_id,
*token_id as u32,
|_| {},
|_| {},
);
let (creator_account_witness, _, creator_account_balance, _) =
apply_leaf_operation(account_tree, *nft_creator_id, *token_id, |_| {}, |_| {});
let (creator_account_audit_path, creator_account_audit_balance_path) =
get_audits(account_tree, *nft_creator_id, *token_id as u32);
get_audits(account_tree, *nft_creator_id, *token_id);

let mut pubdata_commitment = Vec::new();
append_be_fixed_width(
Expand Down
2 changes: 1 addition & 1 deletion core/lib/circuit/src/witness/change_pubkey_offchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Witness for ChangePubkeyOffChainWitness<Bn256> {
account_id: *change_pubkey_offchain.account_id,
address: eth_address_to_fr(&change_pubkey_offchain.tx.account),
new_pubkey_hash: change_pubkey_offchain.tx.new_pk_hash.as_fr(),
fee_token: *change_pubkey_offchain.tx.fee_token as u32,
fee_token: *change_pubkey_offchain.tx.fee_token,
fee: change_pubkey_offchain.tx.fee.to_u128().unwrap(),
nonce: fr_from(change_pubkey_offchain.tx.nonce),
valid_from,
Expand Down
Loading

0 comments on commit beda466

Please sign in to comment.