Skip to content

Commit

Permalink
fix: Weaker assert for protocol version for operations (#1800)
Browse files Browse the repository at this point in the history
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
StanislavBreadless authored Apr 25, 2024
1 parent 31db44f commit 11898c2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/lib/zksync_core/src/eth_sender/eth_tx_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,11 @@ impl EthTxAggregator {
contracts_are_pre_shared_bridge: bool,
) -> TxData {
let operation_is_pre_shared_bridge = op.protocol_version().is_pre_shared_bridge();
assert_eq!(
contracts_are_pre_shared_bridge,
operation_is_pre_shared_bridge
);

// The post shared bridge contracts support pre-shared bridge operations, but vice versa is not true.
if contracts_are_pre_shared_bridge {
assert!(operation_is_pre_shared_bridge);
}

let mut args = vec![Token::Uint(self.rollup_chain_id.as_u64().into())];

Expand Down

0 comments on commit 11898c2

Please sign in to comment.