Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions crates/subprotocols/admin/subprotocol/src/subprotocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,14 @@ impl Subprotocol for AdministrationSubprotocol {
// Phase 1: Execute any pending updates that have reached their activation height
handle_pending_updates(state, relayer, current_height);

// Phase 2: Process incoming administration transactions
// Phase 2: Process incoming administration transactions. Unparseable txs are
// logged and skipped inside `parse_tx` to maintain system resilience.
for tx in txs {
match parse_tx(tx) {
Ok(signed_payload) => {
if let Err(e) = handle_action(state, signed_payload, current_height, relayer) {
warn!(tx_id = %tx.tx().compute_txid(), error = %e, "Failed to handle admin action");
}
}
// Parsing failures are skipped to maintain system resilience, but warned so a
// malformed governance tx isn't completely invisible. Admin txs are rare and
// security-sensitive, so a malformed one is worth surfacing.
Err(e) => {
warn!(tx_id = %tx.tx().compute_txid(), error = %e, "Skipping unparseable admin tx");
}
let Some(signed_payload) = parse_tx(tx) else {
continue;
};
if let Err(e) = handle_action(state, signed_payload, current_height, relayer) {
warn!(tx_id = %tx.tx().compute_txid(), error = %e, "Failed to handle admin action");
}
}
}
Expand Down
60 changes: 60 additions & 0 deletions crates/subprotocols/admin/txs/src/actions/updates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,30 @@ impl RenderSigningMessage for UpdateAction {
}
}

impl From<StrataAdminMultisigUpdate> for UpdateAction {
fn from(update: StrataAdminMultisigUpdate) -> Self {
UpdateAction::StrataAdminMultisig(update)
}
}

impl From<StrataSeqManagerMultisigUpdate> for UpdateAction {
fn from(update: StrataSeqManagerMultisigUpdate) -> Self {
UpdateAction::StrataSeqManagerMultisig(update)
}
}

impl From<AlpenAdminMultisigUpdate> for UpdateAction {
fn from(update: AlpenAdminMultisigUpdate) -> Self {
UpdateAction::AlpenAdminMultisig(update)
}
}

impl From<StrataSecurityCouncilMultisigUpdate> for UpdateAction {
fn from(update: StrataSecurityCouncilMultisigUpdate) -> Self {
UpdateAction::StrataSecurityCouncilMultisig(update)
}
}

impl From<OperatorSetUpdate> for UpdateAction {
fn from(update: OperatorSetUpdate) -> Self {
UpdateAction::OperatorSet(update)
Expand All @@ -129,3 +153,39 @@ impl From<SequencerUpdate> for UpdateAction {
UpdateAction::Sequencer(update)
}
}

impl From<OlStfVkUpdate> for UpdateAction {
fn from(update: OlStfVkUpdate) -> Self {
UpdateAction::OlStfVk(update)
}
}

impl From<AsmStfVkUpdate> for UpdateAction {
fn from(update: AsmStfVkUpdate) -> Self {
UpdateAction::AsmStfVk(update)
}
}

impl From<EeStfVkUpdate> for UpdateAction {
fn from(update: EeStfVkUpdate) -> Self {
UpdateAction::EeStfVk(update)
}
}

impl From<Defcon1Update> for UpdateAction {
fn from(update: Defcon1Update) -> Self {
UpdateAction::Defcon1(update)
}
}

impl From<Defcon3Update> for UpdateAction {
fn from(update: Defcon3Update) -> Self {
UpdateAction::Defcon3(update)
}
}

impl From<SafeHarbourAddressUpdate> for UpdateAction {
fn from(update: SafeHarbourAddressUpdate) -> Self {
UpdateAction::SafeHarbourAddress(update)
}
}
4 changes: 0 additions & 4 deletions crates/subprotocols/admin/txs/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ pub enum AdministrationTxParseError {
/// Failed to parse the transaction envelope.
#[error("failed to parse transaction envelope: {0}")]
MalformedEnvelope(#[from] EnvelopeParseError),

/// Failed to deserialize the transaction payload for the given transaction type.
#[error("tx type is not defined")]
UnknownTxType,
}
Loading
Loading