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, core): Add fee reporting #1305

Merged
merged 11 commits into from
Jul 30, 2024
Merged

Conversation

ethanoroshiba
Copy link
Contributor

Summary

Added event recording for fees on Transfer and Sequence actions.

Background

Fees were previously not reported, and since Astria doesn't fill out gas wanted/used on ExecTxResult, there was no outside way of viewing a block or transaction's associated fees.

Changes

  • Added get_action_type() methods to TransferAction and SequencerAction to facilitate passing the kind of action to get_and_increase_block_fees().
  • Added construction and recording of ABCI events having kind tx.fees and attributes asset, feeAmount, and actionType.

Testing

Added unit test to ensure tx.fees event is recorded correctly in the transaction state events.

Related Issues

closes #1293

@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Jul 26, 2024
@ethanoroshiba ethanoroshiba changed the title feat(sequencer): Add fee reporting feat(sequencer, core): Add fee reporting Jul 26, 2024
@ethanoroshiba ethanoroshiba marked this pull request as ready for review July 26, 2024 21:01
@ethanoroshiba ethanoroshiba requested a review from a team as a code owner July 26, 2024 21:01
Copy link
Contributor

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

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

Generally looks good, but I made a few nitpicky suggestions :)

@github-actions github-actions bot added the composer pertaining to composer label Jul 29, 2024
@ethanoroshiba ethanoroshiba added the core pertaining to the astria-core crate label Jul 29, 2024
@ethanoroshiba ethanoroshiba added this pull request to the merge queue Jul 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 30, 2024
## Summary
Added event recording for fees on `Transfer` and `Sequence` actions.

## Background
Fees were previously not reported, and since Astria doesn't fill out gas
wanted/used on `ExecTxResult`, there was no outside way of viewing a
block or transaction's associated fees.

## Changes
- Added `get_action_type()` methods to `TransferAction` and
`SequencerAction` to facilitate passing the kind of action to
`get_and_increase_block_fees()`.
- Added construction and recording of ABCI events having kind `tx.fees`
and attributes `asset`, `feeAmount`, and `actionType`.

## Testing
Added unit test to ensure `tx.fees` event is recorded correctly in the
transaction state events.

## Related Issues
closes #1293

---------

Co-authored-by: Fraser Hutchison <[email protected]>
@ethanoroshiba ethanoroshiba removed this pull request from the merge queue due to a manual request Jul 30, 2024
@ethanoroshiba ethanoroshiba added this pull request to the merge queue Jul 30, 2024
Merged via the queue into main with commit 7953133 Jul 30, 2024
42 checks passed
@ethanoroshiba ethanoroshiba deleted the eoroshiba/report_fees branch July 30, 2024 21:29
steezeburger added a commit that referenced this pull request Aug 2, 2024
* main:
  chore(core): Implement Protobuf trait for tx actions (#1320)
  refactor(sequencer): remove global state (#1317)
  refactor(sequencer): move asset state methods to asset module (#1313)
  feat(sequencer, core): Add fee reporting (#1305)
  chore(bridge-withdrawer): cleanup nonce handling (#1292)
  fix(charts, bridge): fix ci test (#1310)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composer pertaining to composer core pertaining to the astria-core crate sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

report paid fees from sequencer
3 participants