From d0ca08aca9237dcf3853de551ff5713c71debdfb Mon Sep 17 00:00:00 2001 From: Dmitry S <11892559+swift1337@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:52:49 +0100 Subject: [PATCH 1/2] Disable EIP-1559 --- e2e/e2etests/test_eth_withdraw.go | 5 ++- zetaclient/chains/evm/observer/observer.go | 6 ++- zetaclient/chains/evm/signer/gas.go | 2 + zetaclient/chains/evm/signer/sign_test.go | 1 + zetaclient/chains/evm/signer/signer.go | 43 +++++++++++----------- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/e2e/e2etests/test_eth_withdraw.go b/e2e/e2etests/test_eth_withdraw.go index 0ba15299e1..ebae83e2f2 100644 --- a/e2e/e2etests/test_eth_withdraw.go +++ b/e2e/e2etests/test_eth_withdraw.go @@ -39,8 +39,9 @@ func TestEtherWithdraw(r *runner.E2ERunner, args []string) { utils.RequireCCTXStatus(r, cctx, crosschaintypes.CctxStatus_OutboundMined) - withdrawalReceipt := mustFetchEthReceipt(r, cctx) - require.Equal(r, uint8(ethtypes.DynamicFeeTxType), withdrawalReceipt.Type, "receipt type mismatch") + //Skipped due to https://github.com/zeta-chain/node/issues/3221 + //withdrawalReceipt := mustFetchEthReceipt(r, cctx) + //require.Equal(r, uint8(ethtypes.DynamicFeeTxType), withdrawalReceipt.Type, "receipt type mismatch") r.Logger.Info("TestEtherWithdraw completed") } diff --git a/zetaclient/chains/evm/observer/observer.go b/zetaclient/chains/evm/observer/observer.go index 8823b13c47..eb866da253 100644 --- a/zetaclient/chains/evm/observer/observer.go +++ b/zetaclient/chains/evm/observer/observer.go @@ -53,7 +53,11 @@ type Observer struct { // priorityFeeConfig is the configuration for priority fee type priorityFeeConfig struct { - checked bool + // checked indicates whether the observer checked + // this EVM chain for EIP-1559 (further checks are cached) + checked bool + + // supported indicates whether this EVM chain supports EIP-1559 supported bool } diff --git a/zetaclient/chains/evm/signer/gas.go b/zetaclient/chains/evm/signer/gas.go index 6727758edd..586863a009 100644 --- a/zetaclient/chains/evm/signer/gas.go +++ b/zetaclient/chains/evm/signer/gas.go @@ -57,6 +57,8 @@ func (g Gas) validate() error { // or DynamicFeeTx{} (post EIP-1559). // // Returns true if priority fee is <= 0. +// +//nolint:unused // https://github.com/zeta-chain/node/issues/3221 func (g Gas) isLegacy() bool { return g.PriorityFee.Sign() < 1 } diff --git a/zetaclient/chains/evm/signer/sign_test.go b/zetaclient/chains/evm/signer/sign_test.go index c3d64ebabc..bad6c99354 100644 --- a/zetaclient/chains/evm/signer/sign_test.go +++ b/zetaclient/chains/evm/signer/sign_test.go @@ -60,6 +60,7 @@ func TestSigner_SignConnectorOnReceive(t *testing.T) { }) t.Run("SignOutbound - should successfully sign DynamicFeeTx", func(t *testing.T) { + t.Skip("Skipped due to https://github.com/zeta-chain/node/issues/3221") // ARRANGE const ( gwei = 1_000_000_000 diff --git a/zetaclient/chains/evm/signer/signer.go b/zetaclient/chains/evm/signer/signer.go index 5cebb323c1..fc471ad7c9 100644 --- a/zetaclient/chains/evm/signer/signer.go +++ b/zetaclient/chains/evm/signer/signer.go @@ -219,7 +219,7 @@ func (signer *Signer) Sign( } func newTx( - chainID *big.Int, + _ *big.Int, data []byte, to ethcommon.Address, amount *big.Int, @@ -230,27 +230,28 @@ func newTx( return nil, errors.Wrap(err, "invalid gas parameters") } - if gas.isLegacy() { - return ethtypes.NewTx(ðtypes.LegacyTx{ - To: &to, - Value: amount, - Data: data, - GasPrice: gas.Price, - Gas: gas.Limit, - Nonce: nonce, - }), nil - } - - return ethtypes.NewTx(ðtypes.DynamicFeeTx{ - ChainID: chainID, - To: &to, - Value: amount, - Data: data, - GasFeeCap: gas.Price, - GasTipCap: gas.PriorityFee, - Gas: gas.Limit, - Nonce: nonce, + // https://github.com/zeta-chain/node/issues/3221 + //if gas.isLegacy() { + return ethtypes.NewTx(ðtypes.LegacyTx{ + To: &to, + Value: amount, + Data: data, + GasPrice: gas.Price, + Gas: gas.Limit, + Nonce: nonce, }), nil + //} + // + //return ethtypes.NewTx(ðtypes.DynamicFeeTx{ + // ChainID: chainID, + // To: &to, + // Value: amount, + // Data: data, + // GasFeeCap: gas.Price, + // GasTipCap: gas.PriorityFee, + // Gas: gas.Limit, + // Nonce: nonce, + //}), nil } func (signer *Signer) broadcast(ctx context.Context, tx *ethtypes.Transaction) error { From 415f9b6deb55fbf49cef4c91d53fa25bc526a7b9 Mon Sep 17 00:00:00 2001 From: Dmitry S <11892559+swift1337@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:17:11 +0100 Subject: [PATCH 2/2] Fix linter --- e2e/e2etests/test_eth_withdraw.go | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/e2etests/test_eth_withdraw.go b/e2e/e2etests/test_eth_withdraw.go index ebae83e2f2..22686141a9 100644 --- a/e2e/e2etests/test_eth_withdraw.go +++ b/e2e/e2etests/test_eth_withdraw.go @@ -46,6 +46,7 @@ func TestEtherWithdraw(r *runner.E2ERunner, args []string) { r.Logger.Info("TestEtherWithdraw completed") } +// nolint:unused // https://github.com/zeta-chain/node/issues/3221 func mustFetchEthReceipt(r *runner.E2ERunner, cctx *crosschaintypes.CrossChainTx) *ethtypes.Receipt { hash := cctx.GetCurrentOutboundParam().Hash require.NotEmpty(r, hash, "outbound hash is empty")