From 391549bff245a735c7c9ac4fbbe52597b31354f5 Mon Sep 17 00:00:00 2001 From: Piers Powlesland Date: Tue, 4 Jun 2024 14:42:16 +0100 Subject: [PATCH 1/2] Fix rlp serailisation of cip66 tx to match cip definition https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0066.md --- core/types/celo_denominated_tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/types/celo_denominated_tx.go b/core/types/celo_denominated_tx.go index 140e7b8b65..c4896f4ba5 100644 --- a/core/types/celo_denominated_tx.go +++ b/core/types/celo_denominated_tx.go @@ -17,11 +17,11 @@ type CeloDenominatedTx struct { GasTipCap *big.Int GasFeeCap *big.Int Gas uint64 - FeeCurrency *common.Address `rlp:"nil"` // nil means native currency To *common.Address `rlp:"nil"` // nil means contract creation Value *big.Int Data []byte AccessList AccessList + FeeCurrency *common.Address `rlp:"nil"` // nil means native currency MaxFeeInFeeCurrency *big.Int // Signature values From 5edfcc8a3fab2c16089257d51db9e2d124bfe51a Mon Sep 17 00:00:00 2001 From: Piers Powlesland Date: Tue, 4 Jun 2024 17:12:13 +0100 Subject: [PATCH 2/2] Ensure cip66 tx MaxFeeInFeeCurrency is copied The field was not being copied by the copy method. --- core/types/celo_denominated_tx.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/types/celo_denominated_tx.go b/core/types/celo_denominated_tx.go index c4896f4ba5..7e805bbfb4 100644 --- a/core/types/celo_denominated_tx.go +++ b/core/types/celo_denominated_tx.go @@ -39,14 +39,15 @@ func (tx *CeloDenominatedTx) copy() TxData { Gas: tx.Gas, FeeCurrency: copyAddressPtr(tx.FeeCurrency), // These are copied below. - AccessList: make(AccessList, len(tx.AccessList)), - Value: new(big.Int), - ChainID: new(big.Int), - GasTipCap: new(big.Int), - GasFeeCap: new(big.Int), - V: new(big.Int), - R: new(big.Int), - S: new(big.Int), + AccessList: make(AccessList, len(tx.AccessList)), + Value: new(big.Int), + ChainID: new(big.Int), + GasTipCap: new(big.Int), + GasFeeCap: new(big.Int), + MaxFeeInFeeCurrency: new(big.Int), + V: new(big.Int), + R: new(big.Int), + S: new(big.Int), } copy(cpy.AccessList, tx.AccessList) if tx.Value != nil { @@ -61,6 +62,9 @@ func (tx *CeloDenominatedTx) copy() TxData { if tx.GasFeeCap != nil { cpy.GasFeeCap.Set(tx.GasFeeCap) } + if tx.MaxFeeInFeeCurrency != nil { + cpy.MaxFeeInFeeCurrency.Set(tx.MaxFeeInFeeCurrency) + } if tx.V != nil { cpy.V.Set(tx.V) }