Skip to content

Commit

Permalink
Remove sequencer from RuntimeTxHook
Browse files Browse the repository at this point in the history
  • Loading branch information
jfldde committed Feb 6, 2025
1 parent 2f370e5 commit d469b63
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions crates/citrea-stf/src/hooks_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ use crate::runtime::Runtime;

impl<C: Context, Da: DaSpec> TxHooks for Runtime<C, Da> {
type Context = C;
type PreArg = RuntimeTxHook<C>;
type PreArg = RuntimeTxHook;
type PreResult = C;

#[cfg_attr(feature = "native", instrument(level = "trace", skip_all, err))]
fn pre_dispatch_tx_hook(
&self,
tx: &Transaction<Self::Context>,
working_set: &mut WorkingSet<C::Storage>,
arg: &RuntimeTxHook<C>,
arg: &RuntimeTxHook,
) -> Result<C, SoftConfirmationHookError> {
let RuntimeTxHook {
height,
current_spec,
l1_fee_rate,
..
} = arg;
let AccountsTxHook { sender } =
self.accounts.pre_dispatch_tx_hook(tx, working_set, &None)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ mod stf_blueprint;
pub use stf_blueprint::StfBlueprint;

/// The tx hook for a blueprint runtime
pub struct RuntimeTxHook<C: Context> {
pub struct RuntimeTxHook {
/// Height to initialize the context
pub height: u64,
/// Sequencer public key
pub sequencer: C::PublicKey,
/// Current spec
pub current_spec: SpecId,
/// L1 fee rate
Expand All @@ -50,7 +48,7 @@ pub struct RuntimeTxHook<C: Context> {
pub trait Runtime<C: Context, Da: DaSpec>:
DispatchCall<Context = C>
+ Genesis<Context = C, Config = Self::GenesisConfig>
+ TxHooks<Context = C, PreArg = RuntimeTxHook<C>, PreResult = C>
+ TxHooks<Context = C, PreArg = RuntimeTxHook, PreResult = C>
+ SlotHooks<Da, Context = C>
+ FinalizeHook<Da, Context = C>
+ ApplySoftConfirmationHooks<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ where
// Pre dispatch hook
let hook = RuntimeTxHook {
height: soft_confirmation_info.l2_height(),
sequencer: tx.pub_key().clone(),
current_spec: soft_confirmation_info.current_spec(),
l1_fee_rate: soft_confirmation_info.l1_fee_rate(),
};
Expand Down

0 comments on commit d469b63

Please sign in to comment.