From c08751ef285d907f6389fc46301d6bf17242e359 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Wed, 7 Aug 2024 14:27:48 -0400 Subject: [PATCH] Removed CoWasm signature extraction when creating corresponding EVM transaction This wasn't validated so in doubt, it's preferable to avoid setting it in the block. Same thing for `input`, didn't got the time to complete this. --- x/evm/tracers/firehose.go | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/x/evm/tracers/firehose.go b/x/evm/tracers/firehose.go index 838efbeac..9855429f7 100644 --- a/x/evm/tracers/firehose.go +++ b/x/evm/tracers/firehose.go @@ -21,7 +21,6 @@ import ( "sync/atomic" "time" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" @@ -855,26 +854,21 @@ func (f *Firehose) onPostTxCosmosEventsCoWasmTx(event seitracing.SeiPostTxCosmos To: to.Bytes(), } - if isFirehoseInfoEnabled { - // Logging to check if we could bridge CoWasm to EVM input - for _, msg := range event.Tx.GetMsgs() { - if v, ok := msg.(*wasmtypes.MsgExecuteContract); ok { - firehoseInfo("input from CoWasm transaction (input=%s)", string(v.Msg)) - break - } - } - } - - if sigTx, ok := event.Tx.(authsigning.SigVerifiableTx); ok && len(sigTx.GetSigners()) > 0 { - if r, s, v, data, err := extractCoWasmTxFirstSignature(sigTx); err != nil { - firehoseInfo("signature from CoWasm transaction (error=%s)", err) - } else { - firehoseInfo("signature from CoWasm transaction (r=%s, s=%s, v=%d, cowasm{signature=%s, sign_mode=%d))", byteView(r), byteView(s), byteView(v), byteView(data.Signature), data.SignMode) - f.transaction.R = normalizeSignaturePoint(r) - f.transaction.S = normalizeSignaturePoint(s) - f.transaction.V = emptyBytesToNil(v) - } - } + _ = extractCoWasmTxFirstSignature + // We haven't got the time to get this validated by Sei team if it was to correct way to extract + // R, S and V from the CoWasm transaction, so we are commenting it out for now. The R and S seems + // correct but the way to extract V is not clear, current logic in 'extractCoWasmTxFirstSignature' + // seems broken. + // if sigTx, ok := event.Tx.(authsigning.SigVerifiableTx); ok && len(sigTx.GetSigners()) > 0 { + // if r, s, v, data, err := extractCoWasmTxFirstSignature(sigTx); err != nil { + // firehoseInfo("signature from CoWasm transaction (error=%s)", err) + // } else { + // firehoseInfo("signature from CoWasm transaction (r=%s, s=%s, v=%d, cowasm{signature=%s, sign_mode=%d))", byteView(r), byteView(s), byteView(v), byteView(data.Signature), data.SignMode) + // f.transaction.R = normalizeSignaturePoint(r) + // f.transaction.S = normalizeSignaturePoint(s) + // f.transaction.V = emptyBytesToNil(v) + // } + // } f.OnCallEnter(0, 0, from, to, f.transaction.Input, f.transaction.GasLimit, nil) for _, addedLog := range event.AddedLogs {