Skip to content

Conversation

@ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Aug 18, 2025

Why this should be merged

This PR intends to remove the block gas cost by setting and expecting a 0 value.

Related ACP: https://github.com/avalanche-foundation/ACPs/tree/main/ACPs/226-dynamic-minimum-block-times

How this works

Applies with Granite:

  • Sets BlockGasCost header field to 0
  • Sets EstimateRequiredTip to be 0
  • Skips block fee verification and expect BlockGasCost to be 0
  • Adds verification to wrapped_block

How 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?

@ceyonur ceyonur changed the base branch from master to acp-226 August 18, 2025 18:47
@ceyonur ceyonur self-assigned this Aug 27, 2025
@ceyonur ceyonur linked an issue Aug 27, 2025 that may be closed by this pull request
@ceyonur ceyonur added this to the Granite milestone Aug 27, 2025
@ceyonur ceyonur changed the base branch from acp-226 to master August 27, 2025 11:31
@danielgruesso danielgruesso added the granite Items related to the granite release. label Aug 27, 2025
@ceyonur ceyonur marked this pull request as ready for review August 27, 2025 14:00
@ceyonur ceyonur requested a review from a team as a code owner August 27, 2025 14:00
@ceyonur ceyonur changed the title set expected block gas cost to 0 in granite ACp-226: set expected block gas cost to 0 in granite Aug 28, 2025
@ceyonur ceyonur changed the title ACp-226: set expected block gas cost to 0 in granite ACP-226: set expected block gas cost to 0 in granite Aug 28, 2025
@powerslider powerslider self-assigned this Sep 9, 2025
… 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.
powerslider and others added 6 commits September 10, 2025 19:07
… 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:
@powerslider powerslider changed the title feat(plugin/evm, consensus): ACP-226 - set expected block gas cost to 0 in Granite feat(plugin/evm): ACP-226 - set expected block gas cost to 0 in Granite Sep 11, 2025
@ava-labs ava-labs deleted a comment from StephenButtolph Sep 11, 2025
- 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 StephenButtolph added this pull request to the merge queue Sep 12, 2025
Merged via the queue into master with commit 74e8218 Sep 12, 2025
9 checks passed
@StephenButtolph StephenButtolph deleted the acp-226-blockgascost branch September 12, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acp-226 granite Items related to the granite release. requires-subnet-evm-port

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP-226: Remove block gas cost requirement

7 participants