Skip to content

Commit

Permalink
fix: rebroadcast validation for polkadot
Browse files Browse the repository at this point in the history
  • Loading branch information
dandanlen committed Oct 30, 2023
1 parent fb671b8 commit 732cbd4
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions state-chain/runtime/src/chainflip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,12 @@ impl TransactionBuilder<Polkadot, PolkadotApi<DotEnvironment>> for DotTransactio
fn is_valid_for_rebroadcast(
call: &PolkadotApi<DotEnvironment>,
payload: &<<Polkadot as Chain>::ChainCrypto as ChainCrypto>::Payload,
current_key: &<<Polkadot as Chain>::ChainCrypto as ChainCrypto>::AggKey,
signature: &<<Polkadot as Chain>::ChainCrypto as ChainCrypto>::ThresholdSignature,
_current_key: &<<Polkadot as Chain>::ChainCrypto as ChainCrypto>::AggKey,
_signature: &<<Polkadot as Chain>::ChainCrypto as ChainCrypto>::ThresholdSignature,
) -> bool {
// First check if the payload is still valid. If it is, check if the signature is still
// valid
(&call.threshold_signature_payload() == payload) &&
<<Polkadot as Chain>::ChainCrypto as ChainCrypto>::verify_threshold_signature(
current_key,
payload,
signature,
)
// Current key and signature are irrelevant. The only thing that can invalidate a polkadot
// transaction is if the payload changes due to a runtime version update.
&call.threshold_signature_payload() == payload
}
}

Expand Down

0 comments on commit 732cbd4

Please sign in to comment.