Skip to content
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

Implement ACP-176 #815

Merged
merged 65 commits into from
Feb 28, 2025
Merged

Implement ACP-176 #815

merged 65 commits into from
Feb 28, 2025

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Feb 19, 2025

Why this should be merged

This PR implements ACP-176 with the exception of the allowance of empty blocks.

I will make a PR to update ACP-176 not to modify the validity condition of empty blocks with the reasoning that:

  1. The usage of BlockGasCost has introduced some assumptions on the amount of gas consumed in a block.
  2. While it is not unusual for the BlockGasCost to be 0, when it is non-zero the validator would still need to issue transactions with a sufficient fee to pay for the block gas cost.
  3. In practice, there are not long periods of inactivity on either the fuji or mainnet C-chains.

How this works

This PR adds FUpgrade checks to the following critical behaviors:

  1. The notion of GasCapacity is introduced. In verification and block building, GasCapacity replaces the prior usage of GasLimit. It is guaranteed for GasCapacity <= GasLimit.
  2. GasUsed verification. This verification now merges the GasUsed and ExtraDataGasUsed and enforces the sum to be within the available GasCapacity.
  3. The BaseFee, ExtraPrefix, and GasLimit functions were modified to include the ACP-176 definitions along with their corresponding verification functions.
  4. The PredicateBytesFromExtra was expanded to account for the different extraPrefix sizes (depending on if the windower or acp-176 state is encoded)
  5. The gas price bounds are modified to account for the lower allowed BaseFee.
  6. The C-chain now allows users to configure their own GasTarget. When proposing blocks, the block proposer will move the chain's GasTarget toward their own GasTarget.

How this was tested

This PR includes unit tests for all of the modifications and additions to the header package.

Need to be documented?

Yes, the new GasTarget config should be documented.

Need to update RELEASES.md?

Yes the config changes should be included in the release notes.

Base automatically changed from ap3-refactor to master February 19, 2025 20:02
@StephenButtolph StephenButtolph changed the base branch from master to group-upgrade-packages February 20, 2025 04:15
Base automatically changed from group-upgrade-packages to master February 20, 2025 15:34
@StephenButtolph StephenButtolph changed the base branch from master to unify-gas-limit-calc-and-checks February 20, 2025 20:26
@StephenButtolph StephenButtolph changed the base branch from unify-gas-limit-calc-and-checks to finalize-acp-176-base February 22, 2025 17:51
@StephenButtolph StephenButtolph changed the base branch from finalize-acp-176-base to move-predicate-header-parsing February 24, 2025 23:15
Base automatically changed from move-predicate-header-parsing to master February 25, 2025 05:13
@StephenButtolph StephenButtolph marked this pull request as ready for review February 26, 2025 23:50
@StephenButtolph StephenButtolph requested review from ceyonur and a team as code owners February 26, 2025 23:50
Base automatically changed from include-extra-data-gas to master February 27, 2025 14:24
Copy link
Contributor

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review as things are a bit chaotic for me today and I don't want to leave you hanging (sorry).

@StephenButtolph StephenButtolph changed the base branch from master to move-header-prefix-serialization February 28, 2025 02:15
Copy link
Contributor

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you think I should re-review any of your responses / changes before you merge. Sorry this took a bit longer than usual.

Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
Signed-off-by: Stephen Buttolph <stephen@avalabs.org>
Base automatically changed from move-header-prefix-serialization to master February 28, 2025 14:57
@StephenButtolph StephenButtolph merged commit b1e098c into master Feb 28, 2025
8 checks passed
@StephenButtolph StephenButtolph deleted the acp-176-spike branch February 28, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants