fix(vara.eth): reject post-quarantine-delay above 1000 - #5648
Open
neelsatyavolu wants to merge 1 commit into
Open
neelsatyavolu wants to merge 1 commit into
neelsatyavolu wants to merge 1 commit into
Conversation
`post_quarantine_delay` was accepted at any `u32` value. The producer walks `canonical_quarantine + post_quarantine_delay` parents through the database on every `wait_for_proposable_content` call, so a typo such as `u32::MAX` turned each call into millions of RocksDB reads. Add `MalachiteServiceConfig::MAX_POST_QUARANTINE_DELAY` (1000) and make `NodeParams::into_config` fail with a clear error above it. Closes gear-tech#5478
neelsatyavolu
marked this pull request as ready for review
September 25, 2026 22:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5478
Summary
Root cause:
post_quarantine_delaywas accepted at anyu32value. The producer walkscanonical_quarantine + post_quarantine_delayparents through the database on everywait_for_proposable_contentcall. A typo such as--post-quarantine-delay 4294967295therefore turned each call into millions of RocksDB reads, and nothing told the operator.Fix: follows the plan in the issue.
MalachiteServiceConfig::MAX_POST_QUARANTINE_DELAY = 1000and drop theTODO: #5478comment it replaces.NodeParams::into_confignow fails with`post-quarantine-delay` must be at most 1000, got N. The check runs on the effective value, so it covers both the CLI flag and the TOML key.--post-quarantine-delayhelp text now mentions the maximum.How to test
cargo test -p ethexe-cli --lib params::node::testspost_quarantine_delay_above_max_is_rejectedchecks that 1001 is rejected with an error naming the option. I wrote it before the fix and confirmed it failed onmaster:into_config()returned aNodeConfigwithpost_quarantine_delay: 4294967295.post_quarantine_delay_at_max_is_acceptedchecks that 1000 is still accepted.Also ran locally on macOS (arm64):
cargo test -p ethexe-cli -p ethexe-malachite: all pass.cargo clippy -p ethexe-cli -p ethexe-malachite --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.Notes
make typoslocally becausetypos-cliisn't installed here.sha1-asm 0.5.3(pulled in throughgear-workspace-hack) fails to build. The Xcode clang crashes on its#:lo12:relocation syntax inaarch64_apple.S. To run the checks above I passed a local[patch]throughcargo --config. That workaround is not part of this PR.ai-generatedlabel, but I can't set labels on this repository.Checklist
type(scope): description)