fix(wallet): handle BlobTxType transaction.

Update go-ethereum version

Closes #4636
This commit is contained in:
Ivan Belyakov 2024-01-30 20:50:46 +01:00 committed by IvanBelyakoff
parent 0c2a935578
commit e4745d01b4
7 changed files with 42 additions and 4 deletions

2
go.mod
View File

@ -2,7 +2,7 @@ module github.com/status-im/status-go
go 1.19 go 1.19
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.11 replace github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.13
replace github.com/rjeczalik/notify => github.com/status-im/notify v1.0.2-status replace github.com/rjeczalik/notify => github.com/status-im/notify v1.0.2-status

4
go.sum
View File

@ -1986,8 +1986,8 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/status-im/doubleratchet v3.0.0+incompatible h1:aJ1ejcSERpSzmWZBgtfYtiU2nF0Q8ZkGyuEPYETXkCY= github.com/status-im/doubleratchet v3.0.0+incompatible h1:aJ1ejcSERpSzmWZBgtfYtiU2nF0Q8ZkGyuEPYETXkCY=
github.com/status-im/doubleratchet v3.0.0+incompatible/go.mod h1:1sqR0+yhiM/bd+wrdX79AOt2csZuJOni0nUDzKNuqOU= github.com/status-im/doubleratchet v3.0.0+incompatible/go.mod h1:1sqR0+yhiM/bd+wrdX79AOt2csZuJOni0nUDzKNuqOU=
github.com/status-im/go-ethereum v1.10.25-status.11 h1:casDsgnrkXzyO9SQVyFsT+63XuInyFXzfEHRW/9eEVY= github.com/status-im/go-ethereum v1.10.25-status.13 h1:BIQB1MEY5m/D0pd4zXF1psKgyHMmnC+HZ+liJfB4tmY=
github.com/status-im/go-ethereum v1.10.25-status.11/go.mod h1:Dt4K5JYMhJRdtXJwBEyGZLZn9iz/chSOZyjVmt5ZhwQ= github.com/status-im/go-ethereum v1.10.25-status.13/go.mod h1:Dt4K5JYMhJRdtXJwBEyGZLZn9iz/chSOZyjVmt5ZhwQ=
github.com/status-im/go-multiaddr-ethv4 v1.2.5 h1:pN+ey6wYKbvNNu5/xq9+VL0N8Yq0pZUTbZp0URg+Yn4= github.com/status-im/go-multiaddr-ethv4 v1.2.5 h1:pN+ey6wYKbvNNu5/xq9+VL0N8Yq0pZUTbZp0URg+Yn4=
github.com/status-im/go-multiaddr-ethv4 v1.2.5/go.mod h1:Fhe/18yWU5QwlAYiOO3Bb1BLe0bn5YobcNBHsjRr4kk= github.com/status-im/go-multiaddr-ethv4 v1.2.5/go.mod h1:Fhe/18yWU5QwlAYiOO3Bb1BLe0bn5YobcNBHsjRr4kk=
github.com/status-im/go-sqlcipher/v4 v4.5.4-status.2 h1:Oi9JTAI2DZEe5UKlpUcvKBCCSn3ULsLIrix7jPnEoPE= github.com/status-im/go-sqlcipher/v4 v4.5.4-status.2 h1:Oi9JTAI2DZEe5UKlpUcvKBCCSn3ULsLIrix7jPnEoPE=

View File

@ -225,6 +225,10 @@ func (d *ETHDownloader) getTransfersInBlock(ctx context.Context, blk *types.Bloc
} }
for _, tx := range blk.Transactions() { for _, tx := range blk.Transactions() {
// Skip dummy blob transactions, as they are not supported by us
if tx.Type() == types.BlobTxType {
continue
}
if tx.ChainId().Cmp(big.NewInt(0)) != 0 && tx.ChainId().Cmp(d.chainClient.ToBigInt()) != 0 { if tx.ChainId().Cmp(big.NewInt(0)) != 0 && tx.ChainId().Cmp(d.chainClient.ToBigInt()) != 0 {
log.Info("chain id mismatch", "tx hash", tx.Hash(), "tx chain id", tx.ChainId(), "expected chain id", d.chainClient.NetworkID()) log.Info("chain id mismatch", "tx hash", tx.Hash(), "tx chain id", tx.ChainId(), "expected chain id", d.chainClient.NetworkID())
continue continue

View File

@ -0,0 +1,28 @@
package types
import (
"math/big"
"github.com/ethereum/go-ethereum/common"
)
type DummyBlobTx struct {
}
// accessors for innerTx.
func (tx *DummyBlobTx) txType() byte { return BlobTxType }
func (tx *DummyBlobTx) chainID() *big.Int { return nil }
func (tx *DummyBlobTx) accessList() AccessList { return AccessList{} }
func (tx *DummyBlobTx) data() []byte { return nil }
func (tx *DummyBlobTx) gas() uint64 { return 0 }
func (tx *DummyBlobTx) gasFeeCap() *big.Int { return nil }
func (tx *DummyBlobTx) gasTipCap() *big.Int { return nil }
func (tx *DummyBlobTx) gasPrice() *big.Int { return nil }
func (tx *DummyBlobTx) value() *big.Int { return nil }
func (tx *DummyBlobTx) nonce() uint64 { return 0 }
func (tx *DummyBlobTx) to() *common.Address { return nil }
func (tx *DummyBlobTx) isSystemTx() bool { return false }
func (tx *DummyBlobTx) copy() TxData { return nil }
func (tx *DummyBlobTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int { return nil }
func (tx *DummyBlobTx) isFake() bool { return true }
func (tx *DummyBlobTx) rawSignatureValues() (v, r, s *big.Int) { return nil, nil, nil }
func (tx *DummyBlobTx) setSignatureValues(chainID, v, r, s *big.Int) {}

View File

@ -46,6 +46,7 @@ const (
LegacyTxType = iota LegacyTxType = iota
AccessListTxType AccessListTxType
DynamicFeeTxType DynamicFeeTxType
BlobTxType = 0x3
ArbitrumDepositTxType = 100 ArbitrumDepositTxType = 100
ArbitrumUnsignedTxType = 101 ArbitrumUnsignedTxType = 101
ArbitrumContractTxType = 102 ArbitrumContractTxType = 102
@ -257,6 +258,9 @@ func (tx *Transaction) decodeTyped(b []byte, l2Parsing bool) (TxData, error) {
var inner DynamicFeeTx var inner DynamicFeeTx
err := rlp.DecodeBytes(b[1:], &inner) err := rlp.DecodeBytes(b[1:], &inner)
return &inner, err return &inner, err
case BlobTxType:
var inner DummyBlobTx
return &inner, nil
default: default:
return nil, ErrTxTypeNotSupported return nil, ErrTxTypeNotSupported
} }

View File

@ -692,6 +692,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
if dec.Nonce != nil { if dec.Nonce != nil {
inner = &optimismDepositTxWithNonce{OptimismDepositTx: itx, EffectiveNonce: uint64(*dec.Nonce)} inner = &optimismDepositTxWithNonce{OptimismDepositTx: itx, EffectiveNonce: uint64(*dec.Nonce)}
} }
case BlobTxType:
inner = &DummyBlobTx{}
default: default:
return ErrTxTypeNotSupported return ErrTxTypeNotSupported
} }

2
vendor/modules.txt vendored
View File

@ -211,7 +211,7 @@ github.com/edsrzf/mmap-go
## explicit; go 1.14 ## explicit; go 1.14
github.com/elastic/gosigar github.com/elastic/gosigar
github.com/elastic/gosigar/sys/windows github.com/elastic/gosigar/sys/windows
# github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.11 # github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.13
## explicit; go 1.17 ## explicit; go 1.17
github.com/ethereum/go-ethereum github.com/ethereum/go-ethereum
github.com/ethereum/go-ethereum/accounts github.com/ethereum/go-ethereum/accounts