Skip to content

feat: Add FeeParameters to BlockHeader#1652

Merged
PhilippGackstatter merged 17 commits intonextfrom
pgackst-fee-header
Aug 1, 2025
Merged

feat: Add FeeParameters to BlockHeader#1652
PhilippGackstatter merged 17 commits intonextfrom
pgackst-fee-header

Conversation

@PhilippGackstatter
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter commented Jul 29, 2025

Add FeeParameters to BlockHeader.

Changes

  • Adds a new FeeParameters struct defining the native asset of the chain (in which fees are accepted) and a single base fee to keep it simple - to be extended in later work.
  • Updates the sub commitment of the block header to commit to these params. Accordingly, the transaction kernel must be updated as well since it computes the same commitment. Note that the sub commitment now includes an empty word. This is so that the sub commitment consists of an even number of words for use with adv_pipe in the kernel. Later additions to the fee params will occupy these zero values anyway.

These additions to the tx kernel are currently not tested, which is not ideal. However, it's not easily possible to create a custom block header and pass it into a transaction using the existing tools (mock chain, tx context). Most likely it would be good to extend the tx context builder to allow for something like this, but I'll need to think about it a bit more in the larger context of testing. Similar errors like ERR_PROLOGUE_GLOBAL_INPUTS_PROVIDED_DO_NOT_MATCH_BLOCK_NUMBER_COMMITMENT are also not tested, so maybe we should come up with a strategy for this.

closes #1612

@PhilippGackstatter PhilippGackstatter requested review from bobbinth and mmagician and removed request for bobbinth and mmagician July 29, 2025 09:55
@PhilippGackstatter
Copy link
Contributor Author

Just realized I forgot to validate the native asset ID in the prologue - will add and re-request reviews then.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a few small comments inline - but nothing blocking.

Copy link
Collaborator

@mmagician mmagician left a comment

Choose a reason for hiding this comment

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

Thanks for the express handling of comments!

@PhilippGackstatter PhilippGackstatter merged commit ba54b12 into next Aug 1, 2025
18 checks passed
@PhilippGackstatter PhilippGackstatter deleted the pgackst-fee-header branch August 1, 2025 13:49
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.

Add fee parameters to the BlockHeader

3 participants