diff --git a/l2geth/internal/ethapi/api.go b/l2geth/internal/ethapi/api.go index 7b765cbe30bc7..a2a1853c4bc20 100644 --- a/l2geth/internal/ethapi/api.go +++ b/l2geth/internal/ethapi/api.go @@ -1740,33 +1740,6 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod return SubmitTransaction(ctx, s.b, tx) } -// SendRawEthSignTransaction will add the signed transaction to the mempool. -// The signature hash was computed with `eth_sign`, meaning that the -// `abi.encodedPacked` transaction was prefixed with the string -// "Ethereum Signed Message". -func (s *PublicTransactionPoolAPI) SendRawEthSignTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error) { - if s.b.IsVerifier() { - return common.Hash{}, errors.New("Cannot send raw ethsign transaction in verifier mode") - } - - if s.b.IsSyncing() { - return common.Hash{}, errors.New("Cannot send raw transaction while syncing") - } - - tx := new(types.Transaction) - if err := rlp.DecodeBytes(encodedTx, tx); err != nil { - return common.Hash{}, err - } - - if new(big.Int).Mod(tx.GasPrice(), big.NewInt(1000000)).Cmp(big.NewInt(0)) != 0 { - return common.Hash{}, errors.New("Gas price must be a multiple of 1,000,000 wei") - } - // L1Timestamp and L1BlockNumber will be set by the miner - txMeta := types.NewTransactionMeta(nil, 0, nil, types.SighashEthSign, types.QueueOriginSequencer, nil, nil, nil) - tx.SetTransactionMeta(txMeta) - return SubmitTransaction(ctx, s.b, tx) -} - // Sign calculates an ECDSA signature for: // keccack256("\x19Ethereum Signed Message:\n" + len(message) + message). // diff --git a/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts b/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts index 5ecf06fdc0cf9..c185520562a73 100644 --- a/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts +++ b/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts @@ -243,6 +243,31 @@ const maybeDecodeSequencerBatchTransaction = ( let decoded = null let type = null + try { + // Try to decode as RLP first. This function will throw if the transaction can't be properly + // decoded as RLP and we'll get bumped down to the next set of possible decodings. + const decodedTx = ethers.utils.parseTransaction(transaction) + + return { + type: 'EIP155', + decoded: { + nonce: BigNumber.from(decodedTx.nonce).toNumber(), + gasPrice: BigNumber.from(decodedTx.gasPrice).toNumber(), + gasLimit: BigNumber.from(decodedTx.gasLimit).toNumber(), + target: toHexString(decodedTx.to), // Maybe null this out for creations? + data: toHexString(decodedTx.data), + sig: { + v: BigNumber.from(decodedTx.v).toNumber(), + r: toHexString(decodedTx.r), + s: toHexString(decodedTx.s), + }, + type: 0, // EIP155 legacy holdover. + }, + } + } catch (err) { + // Do nothing, fall back to legacy decode. + } + try { const txType = transaction.slice(0, 1).readUInt8() if (txType === TxType.EIP155) {