Skip to content

Commit

Permalink
Overrides vp result if invalid signature
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco committed Nov 7, 2023
1 parent 65a6499 commit a826c41
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion shared/src/vm/wasm/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,19 @@ where
gas_meter,
) {
Ok(accept) => {
if !accept && sentinel.is_invalid_signature() {
if sentinel.is_invalid_signature() {
if accept {
// This is unexpected, if the signature is invalid the vp
// should have rejected the tx. Something must be wrong with
// the VP logic and we take the signature verification
// result as the reference. In this case we override the vp
// result and log the issue
tracing::warn!(
"VP of {address} accepted the transaction but \
signaled that the signature was invalid. Overriding \
the vp result to reject the transaction..."
);
}
Err(Error::InvalidTxSignature)
} else {
Ok(accept)
Expand Down

0 comments on commit a826c41

Please sign in to comment.