Skip to content

Commit

Permalink
fix(sequencer)!: fix block fees (#1343)
Browse files Browse the repository at this point in the history
## Summary
Corrected block fee reporting so that proposer is paid the correct fees.

## Background
Previously, only `TransferAction` and `SequenceAction` called
`get_and_increase_block_fees()`, the method for increasing the running
fees for the block. In `end_block`, this was used for calculating how
much to increase the proposer's balance meaning that they were only paid
the fees for `Transfer` and `Sequence` actions.

## Changes
- Implemented `get_and_increase_block_fees()` in all actions which
charge fees.

## Testing
Added unit tests for each action, with the exception of
`Ics20Withdrawal`. This test should be implemented, but will require a
more in-depth configuration.

## Breaking Changelist
- App hash changed, snapshot has been regenerated.

## Related Issues
closes #1333

---------

Co-authored-by: Richard Janis Goldschmidt <[email protected]>
Co-authored-by: Fraser Hutchison <[email protected]>
Co-authored-by: noot <[email protected]>
  • Loading branch information
4 people authored Aug 21, 2024
1 parent 1f4a359 commit 781c4c5
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 89 deletions.
2 changes: 1 addition & 1 deletion crates/astria-sequencer/src/accounts/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use anyhow::{
};
use astria_core::{
protocol::transaction::v1alpha1::action::TransferAction,
Protobuf,
Protobuf as _,
};
use cnidarium::{
StateRead,
Expand Down
2 changes: 2 additions & 0 deletions crates/astria-sequencer/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub(crate) mod test_utils;
#[cfg(test)]
mod tests_app;
#[cfg(test)]
mod tests_block_fees;
#[cfg(test)]
mod tests_breaking_changes;
#[cfg(test)]
mod tests_execute_transaction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ source: crates/astria-sequencer/src/app/tests_breaking_changes.rs
expression: app.app_hash.as_bytes()
---
[
72,
87,
29,
138,
91,
221,
71,
36,
66,
219,
212,
171,
126,
223,
176,
198,
154,
10,
234,
253,
99,
213,
78,
92,
228,
89,
204,
197,
30,
16,
122,
103,
62,
67,
145,
180,
247,
139,
229,
200,
86,
193,
90,
57,
205,
2
28,
71,
235,
32,
134,
143,
239,
229,
8,
86,
190,
164,
81,
230,
24,
149
]
Loading

0 comments on commit 781c4c5

Please sign in to comment.