-
Notifications
You must be signed in to change notification settings - Fork 160
feat(plugin/evm): ACP-226 - set expected block gas cost to 0 in Granite #1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
alarso16
approved these changes
Sep 9, 2025
4db3450 to
b10f41d
Compare
… simplify assertions
- Remove Granite cases from VerifyBlockFee tests (Granite doesn’t use VerifyBlockFee).
- Re-add minimal unit to assert BlockGasCost(...) returns 0 under Granite.
- Flatten assertion logic (sentinel first via ErrorIs, optional ErrorContains, without nested returns).
- Add consensus/dummy/consensus_test.go:
- Add TestGraniteEnforcesZeroBlockGasCost as table-driven test (zero block gas cost is ok, non-zero errors).
- Use lightweight ChainHeaderReader stub and set required header fields (BaseFee, ExtDataGasUsed).
…alid-cost case - Remove overrideBlockGasCost usage and compute requiredBlockGasCost via BlockGasCost. - Drop table entry for "invalid required block gas cost". - Add standalone TestVerifyBlockFee_InvalidRequiredBlockGasCost (> max uint64) asserting errInvalidRequiredBlockGasCostApricotPhase4. - Keep Granite verification in consensus tests only.
07f93b0 to
a5a4399
Compare
… and document tip floor - Guard VerifyBlockFee in Finalize and FinalizeAndAssemble to run only on AP4. - Remove early return under ModeSkipBlockFee in FinalizeAndAssemble to always assemble a block, avoiding nil block dereferences downstream. - Add inline comments explaining SuggestTipCap inputs:
…o prove the new explanation
- Switch AP4 block-fee tests in core/blockchain_ext_test.go to TestFortunaChainConfig to reflect latest pre‑Granite behavior.
…of txs from 200 to 80 and optionally reduce numBlocks for speed
StephenButtolph
approved these changes
Sep 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Why this should be merged
This PR intends to remove the block gas cost by setting and expecting a
0value.Related ACP: https://github.com/avalanche-foundation/ACPs/tree/main/ACPs/226-dynamic-minimum-block-times
How this works
Applies with
Granite:BlockGasCostheader field to 0EstimateRequiredTipto be 0BlockGasCostto be 0wrapped_blockHow this was tested
Added vm test and UT in consensus tests
Need to be documented?
yes, as a part of granite doc (dunno if we have one)
Need to update RELEASES.md?
Maybe?