diff --git a/pallets/rolldown/src/lib.rs b/pallets/rolldown/src/lib.rs index 8144e0f1d..007851dd9 100644 --- a/pallets/rolldown/src/lib.rs +++ b/pallets/rolldown/src/lib.rs @@ -859,7 +859,7 @@ impl Pallet { pub fn validate_l1_update(l1: L1, update: &messages::L1Update) -> DispatchResult { ensure!( !update.pendingDeposits.is_empty() || - !update.pendingCancelResultions.is_empty() || + !update.pendingCancelResolutions.is_empty() || !update.pendingL2UpdatesToRemove.is_empty(), Error::::EmptyUpdate ); @@ -874,7 +874,7 @@ impl Pallet { ); ensure!( update - .pendingCancelResultions + .pendingCancelResolutions .iter() .map(|v| v.requestId.origin) .all(|v| v == Origin::L1), @@ -903,7 +903,7 @@ impl Pallet { ensure!( update - .pendingCancelResultions + .pendingCancelResolutions .iter() .map(|v| v.requestId.id) .into_iter() @@ -936,7 +936,7 @@ impl Pallet { let lowest_id = [ update.pendingDeposits.first().map(|v| v.requestId.id), - update.pendingCancelResultions.first().map(|v| v.requestId.id), + update.pendingCancelResolutions.first().map(|v| v.requestId.id), update.pendingWithdrawalResolutions.first().map(|v| v.requestId.id), update.pendingL2UpdatesToRemove.first().map(|v| v.requestId.id), ] @@ -956,14 +956,14 @@ impl Pallet { let last_id = lowest_id + (update.pendingDeposits.len() as u128) + (update.pendingWithdrawalResolutions.len() as u128) + - (update.pendingCancelResultions.len() as u128) + + (update.pendingCancelResolutions.len() as u128) + (update.pendingL2UpdatesToRemove.len() as u128); ensure!(last_id > last_processed_request_on_l2::::get(l1), Error::::WrongRequestId); let mut deposit_it = update.pendingDeposits.iter(); let mut withdrawal_it = update.pendingWithdrawalResolutions.iter(); - let mut cancel_it = update.pendingCancelResultions.iter(); + let mut cancel_it = update.pendingCancelResolutions.iter(); let mut updates_it = update.pendingL2UpdatesToRemove.iter(); let mut withdrawal = withdrawal_it.next(); diff --git a/pallets/rolldown/src/messages.rs b/pallets/rolldown/src/messages.rs index 57d78d7ef..0769948bf 100644 --- a/pallets/rolldown/src/messages.rs +++ b/pallets/rolldown/src/messages.rs @@ -179,7 +179,7 @@ impl Into for WithdrawalResolution { #[derive(Eq, PartialEq, RuntimeDebug, Clone, Encode, Decode, TypeInfo, Default, Serialize)] pub struct L1Update { pub pendingDeposits: Vec, - pub pendingCancelResultions: Vec, + pub pendingCancelResolutions: Vec, pub pendingWithdrawalResolutions: Vec, pub pendingL2UpdatesToRemove: Vec, } @@ -226,7 +226,7 @@ impl L1Update { pub fn range(&self) -> Option { let first = [ self.pendingDeposits.first().map(|v| v.requestId.id), - self.pendingCancelResultions.first().map(|v| v.requestId.id), + self.pendingCancelResolutions.first().map(|v| v.requestId.id), self.pendingL2UpdatesToRemove.first().map(|v| v.requestId.id), self.pendingWithdrawalResolutions.first().map(|v| v.requestId.id), ] @@ -237,7 +237,7 @@ impl L1Update { let last = [ self.pendingDeposits.last().map(|v| v.requestId.id), - self.pendingCancelResultions.last().map(|v| v.requestId.id), + self.pendingCancelResolutions.last().map(|v| v.requestId.id), self.pendingL2UpdatesToRemove.last().map(|v| v.requestId.id), self.pendingWithdrawalResolutions.last().map(|v| v.requestId.id), ] @@ -257,13 +257,13 @@ impl L1Update { let L1Update { pendingDeposits, - pendingCancelResultions, + pendingCancelResolutions, pendingL2UpdatesToRemove, pendingWithdrawalResolutions, } = self; let mut deposits_it = pendingDeposits.into_iter().peekable(); - let mut cancel_it = pendingCancelResultions.into_iter().peekable(); + let mut cancel_it = pendingCancelResolutions.into_iter().peekable(); let mut remove_it = pendingL2UpdatesToRemove.into_iter().peekable(); let mut withdrawal_it = pendingWithdrawalResolutions.into_iter().peekable(); @@ -330,8 +330,8 @@ impl Into for L1Update { fn into(self) -> eth_abi::L1Update { eth_abi::L1Update { pendingDeposits: self.pendingDeposits.into_iter().map(Into::into).collect::>(), - pendingCancelResultions: self - .pendingCancelResultions + pendingCancelResolutions: self + .pendingCancelResolutions .into_iter() .map(Into::into) .collect::>(), @@ -398,7 +398,7 @@ impl TryFrom for L1Update { let pending_deposits: Result, _> = update.pendingDeposits.into_iter().map(|d| d.try_into()).collect(); let pending_cancel_resultions: Result, _> = - update.pendingCancelResultions.into_iter().map(|c| c.try_into()).collect(); + update.pendingCancelResolutions.into_iter().map(|c| c.try_into()).collect(); let pending_l2_updates_to_remove: Result, _> = update.pendingL2UpdatesToRemove.into_iter().map(|u| u.try_into()).collect(); let pending_withdrawal_resolutions: Result, _> = @@ -407,8 +407,8 @@ impl TryFrom for L1Update { Ok(Self { pendingDeposits: pending_deposits .map_err(|e| format!("Error converting pendingDeposits: {}", e))?, - pendingCancelResultions: pending_cancel_resultions - .map_err(|e| format!("Error converting pendingCancelResultions: {}", e))?, + pendingCancelResolutions: pending_cancel_resultions + .map_err(|e| format!("Error converting pendingCancelResolutions: {}", e))?, pendingL2UpdatesToRemove: pending_l2_updates_to_remove .map_err(|e| format!("Error converting pendingL2UpdatesToRemove: {}", e))?, pendingWithdrawalResolutions: pending_withdrawal_resolutions @@ -536,7 +536,7 @@ pub mod eth_abi { #[derive(Debug)] struct L1Update { Deposit[] pendingDeposits; - CancelResolution[] pendingCancelResultions; + CancelResolution[] pendingCancelResolutions; WithdrawalResolution[] pendingWithdrawalResolutions; L2UpdatesToRemove[] pendingL2UpdatesToRemove; } diff --git a/pallets/rolldown/src/tests.rs b/pallets/rolldown/src/tests.rs index d0c66d763..1faca84a1 100644 --- a/pallets/rolldown/src/tests.rs +++ b/pallets/rolldown/src/tests.rs @@ -50,7 +50,7 @@ impl L1UpdateBuilder { }, L1UpdateRequest::CancelResolution(mut c) => { c.requestId.id = rid; - update.pendingCancelResultions.push(c); + update.pendingCancelResolutions.push(c); }, L1UpdateRequest::Remove(mut r) => { r.requestId.id = rid; diff --git a/pallets/sequencer-staking/src/lib.rs b/pallets/sequencer-staking/src/lib.rs index 57e30b807..dbdc96bfa 100644 --- a/pallets/sequencer-staking/src/lib.rs +++ b/pallets/sequencer-staking/src/lib.rs @@ -106,6 +106,10 @@ pub mod pallet { // add +1 cancel right to all other sequencers (non active are deleted from sequencer_rights @ rolldown) assert!(T::Currency::reserve(&sender, *stake_amount).is_ok()); } + + if let Some(seq) = ActiveSequencers::::get().get(0) { + SelectedSequencer::::put(seq.clone()); + } } }