Skip to content

Conversation

@cyberphysic4l
Copy link
Contributor

Description of change

  • Introduce a feature flag protocol_defined_base_fee and config parameter base_gas_price.
  • protocol_defined_base_fee enables the base fee defined by base_gas_price in the place of the reference gas price defined by the gas price survey in earlier protocol versions. This base_gas_price for each transaction is burned, and any additional gas price will be passed to the validators as a tip.
  • The advance_epoch function in the iota framework is updated to burn the base fee and pass additional fee to validators. The function now takes an additional call argument - computation_charge_burned - to allow the base fee component and tip to be distinguished.
  • Also in the iota framework, we introduce IotaSystemStateV2 and associated types to include a safe_mode_computation_charges_burned field. Some tests are updated to deal with this new system state version. Updates were carried out following the guide provided in crates/iota-framework/packages/iota-system/sources/iota_system.move
  • A ChangeEpochV2 transaction kind is introduced for the epoch change system transaction corresponding to the advance_epoch function changes mentioned above. The new feature flag, protocol_defined_base_fee is used to determined when the new ChangeEpochV2 transaction kind should be used and the additional call argument be passed to the advance_epoch function
  • We update to SystemEpochInfoEventV2 to include the tips_amount field specifying how much of user computation fees are passed to validators.

Links to any relevant issues

Fixes #3122

Should be merged along with iotaledger/iota-rust-sdk#22

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

Existing tests pass. Added move tests for tips in rewards_distribution_tests.move

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@cyberphysic4l cyberphysic4l requested review from a team as code owners February 7, 2025 12:30
@vercel
Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 9:11am
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 9:11am
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 9:11am
wallet-dashboard ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 9:11am

@cyberphysic4l cyberphysic4l changed the base branch from core-protocol/procotol-version-4 to protocol/pcr2-clean February 7, 2025 13:13
@cyberphysic4l cyberphysic4l changed the title PCR-2 base changes feat(protocol): PCR-2 base changes Feb 7, 2025
Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

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

Hey @cyberphysic4l , a few nitpicks and a proposal with more impact to discuss.

Copy link
Contributor

@valeriyr valeriyr left a comment

Choose a reason for hiding this comment

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

LGTM!

@cyberphysic4l cyberphysic4l merged commit f4d3b55 into protocol/pcr2-clean Feb 13, 2025
32 of 34 checks passed
@cyberphysic4l cyberphysic4l deleted the protocol/pcr2-base branch February 13, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants