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

feat(sequencer)!: implement FeeChangeAction for the authority component #1037

Merged
merged 15 commits into from
May 15, 2024

Conversation

noot
Copy link
Collaborator

@noot noot commented May 2, 2024

Summary

implement FeeChangeAction for the authority component, which allows fees to be configured at chain runtime.

Background

we want to allow for fees to be configured at chain runtime.

Changes

  • implement the FeeChangeAction type

Testing

unit tests

Breaking Changelist

  • app state can be changed by sending a FeeChangeAction.

Related Issues

closes #1003

@github-actions github-actions bot added proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate labels May 2, 2024
@noot noot marked this pull request as ready for review May 2, 2024 20:11
@noot noot requested review from a team as code owners May 2, 2024 20:11
@noot noot requested a review from SuperFluffy May 2, 2024 20:11
// this to accomodate both `base_fee` and `byte_cost_multiplier` for each action.
oneof value {
// core protocol fees are defined on 1-20
bytes transfer_base_fee = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Should these by bytes or typed as u128 or uint64?

It might be cleaner to have them all be uint128 and then because it's a message they are optional. could get rid of the oneof, can update as many as you want at once anything not set stays the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated to make each oneof value type uint128 - i think it's better to leave it as a oneof for now, as changing multiple fees in one action can get more complex than just bundling a tx with multiple FeeChangeActions in it.

// for all actions in the transaction.
//
// allow too many lines because of the number of actions and the need to check each one.
#[allow(clippy::too_many_lines)]
Copy link
Member

@SuperFluffy SuperFluffy May 15, 2024

Choose a reason for hiding this comment

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

IMO this is a strong hint to have a bunch of free-standing functions for each of the actions, and delegate the checks there. I.e:

match action {
    Action::Transfer(act) => process_transfer_action(act, fees_by_asset), // or some better name obviously
    ...
}

This would also make it possible to unit-testing these individually.

sequence::state_ext::StateWriteExt as _,
};

match self.fee_change {
Copy link
Member

Choose a reason for hiding this comment

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

do ever get events for this? I wonder if it might be warranted to emit warn! level events for each one of these changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, Jordan and I discussed this, it might be useful to emit ABCI events for certain things occurring for easier indexing in general. this would be one of those spots. will probably look over all of sequencer at some point to decide what to add

@noot noot enabled auto-merge May 15, 2024 21:29
@noot noot added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit 3daf46d May 15, 2024
36 checks passed
@noot noot deleted the noot/fee-change-action branch May 15, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sequencer: make fees configurable via a transaction
4 participants