Skip to content

Commit 9c2b213

Browse files
fix: Handle OON during nonce bumping (#299)
## What ❔ If bumping the nonce during validation exhausts native resources, this should be handled as a validation error. Current implementation results in a panic. <!-- 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? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## 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. --------- Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
1 parent 8e8fdcd commit 9c2b213

File tree

7 files changed

+12
-0
lines changed

7 files changed

+12
-0
lines changed

basic_bootloader/src/bootloader/account_models/eoa.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ where
169169
InvalidTransaction::NonceOverflowInTransaction,
170170
))
171171
}
172+
Err(SubsystemError::LeafRuntime(runtime_error)) => match runtime_error {
173+
RuntimeError::FatalRuntimeError(_) => {
174+
return Err(TxError::oon_as_validation(
175+
out_of_native_resources!().into(),
176+
))
177+
}
178+
RuntimeError::OutOfErgs(_) => {
179+
return Err(TxError::Validation(
180+
InvalidTransaction::OutOfGasDuringValidation,
181+
))
182+
}
183+
},
172184
Err(e) => Err(wrap_error!(e)),
173185
}?;
174186

zksync_os/app.bin

224 Bytes
Binary file not shown.

zksync_os/evm_replay.bin

224 Bytes
Binary file not shown.

zksync_os/multiblock_batch.bin

192 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.

zksync_os/server_app.bin

224 Bytes
Binary file not shown.
224 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)