Skip to content

Commit

Permalink
Disable EIP-1559
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Dec 2, 2024
1 parent c0b954e commit 72de540
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
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 @@ -59,6 +59,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
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
}

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

0 comments on commit 72de540

Please sign in to comment.