Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zetaclient): disable EIP-1559 #3222

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions e2e/e2etests/test_eth_withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ 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")
}

// 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")
Expand Down
6 changes: 5 additions & 1 deletion zetaclient/chains/evm/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions zetaclient/chains/evm/signer/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions zetaclient/chains/evm/signer/sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
swift1337 marked this conversation as resolved.
Show resolved Hide resolved
// ARRANGE
const (
gwei = 1_000_000_000
Expand Down
43 changes: 22 additions & 21 deletions zetaclient/chains/evm/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (signer *Signer) Sign(
}

func newTx(
chainID *big.Int,
_ *big.Int,
data []byte,
to ethcommon.Address,
amount *big.Int,
Expand All @@ -230,27 +230,28 @@ func newTx(
return nil, errors.Wrap(err, "invalid gas parameters")
}

if gas.isLegacy() {
return ethtypes.NewTx(&ethtypes.LegacyTx{
To: &to,
Value: amount,
Data: data,
GasPrice: gas.Price,
Gas: gas.Limit,
Nonce: nonce,
}), nil
}

return ethtypes.NewTx(&ethtypes.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(&ethtypes.LegacyTx{
To: &to,
Value: amount,
Data: data,
GasPrice: gas.Price,
Gas: gas.Limit,
Nonce: nonce,
}), nil
//}
//
//return ethtypes.NewTx(&ethtypes.DynamicFeeTx{
// ChainID: chainID,
// To: &to,
// Value: amount,
// Data: data,
// GasFeeCap: gas.Price,
// GasTipCap: gas.PriorityFee,
// Gas: gas.Limit,
// Nonce: nonce,
//}), nil
swift1337 marked this conversation as resolved.
Show resolved Hide resolved
}

func (signer *Signer) broadcast(ctx context.Context, tx *ethtypes.Transaction) error {
Expand Down
Loading