diff --git a/CHANGELOG.md b/CHANGELOG.md index be172e06..b3b699fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -137,3 +137,9 @@ Move the encrypted wallet passphrase to the new location: ### Removed - Icon redunant polling code + +# [1.2.3] - 2024-05-14 + +### Added + +- Gas adjustment from config diff --git a/relayer/chains/evm/provider.go b/relayer/chains/evm/provider.go index b398cd28..4639d07b 100644 --- a/relayer/chains/evm/provider.go +++ b/relayer/chains/evm/provider.go @@ -53,7 +53,7 @@ type Config struct { Concurrency uint64 `json:"concurrency" yaml:"concurrency"` FinalityBlock uint64 `json:"finality-block" yaml:"finality-block"` NID string `json:"nid" yaml:"nid"` - GasBuffer uint64 `json:"gas-buffer" yaml:"gas-buffer"` + GasAdjustment uint64 `json:"gas-adjustment" yaml:"gas-adjustment"` HomeDir string `json:"-" yaml:"-"` } @@ -129,8 +129,8 @@ func (p *Config) Validate() error { } func (p *Config) sanitize() error { - if p.GasBuffer == 0 { - p.GasBuffer = 10 + if p.GasAdjustment == 0 { + p.GasAdjustment = 10 } return nil } diff --git a/relayer/chains/evm/route.go b/relayer/chains/evm/route.go index f3c530d9..24114350 100644 --- a/relayer/chains/evm/route.go +++ b/relayer/chains/evm/route.go @@ -61,7 +61,7 @@ func (p *Provider) SendTransaction(ctx context.Context, opts *bind.TransactOpts, return nil, fmt.Errorf("gas price less than minimum: %d", gasLimit) } - opts.GasLimit = gasLimit + gasLimit*p.cfg.GasBuffer/100 + opts.GasLimit = gasLimit + gasLimit*p.cfg.GasAdjustment/100 switch message.EventType { // check estimated gas and gas price diff --git a/relayer/chains/icon/provider.go b/relayer/chains/icon/provider.go index d235d805..1bf017a2 100644 --- a/relayer/chains/icon/provider.go +++ b/relayer/chains/icon/provider.go @@ -15,18 +15,18 @@ import ( ) type Config struct { - ChainName string `json:"-" yaml:"-"` - RPCUrl string `json:"rpc-url" yaml:"rpc-url"` - Address string `json:"address" yaml:"address"` - StartHeight uint64 `json:"start-height" yaml:"start-height"` // would be of highest priority - Contracts relayerTypes.ContractConfigMap `json:"contracts" yaml:"contracts"` - NetworkID int64 `json:"network-id" yaml:"network-id"` - FinalityBlock uint64 `json:"finality-block" yaml:"finality-block"` - NID string `json:"nid" yaml:"nid"` - StepMin int64 `json:"step-min" yaml:"step-min"` - StepLimit int64 `json:"step-limit" yaml:"step-limit"` - StepBuffer int `json:"step-buffer" yaml:"step-buffer"` - HomeDir string `json:"-" yaml:"-"` + ChainName string `json:"-" yaml:"-"` + RPCUrl string `json:"rpc-url" yaml:"rpc-url"` + Address string `json:"address" yaml:"address"` + StartHeight uint64 `json:"start-height" yaml:"start-height"` // would be of highest priority + Contracts relayerTypes.ContractConfigMap `json:"contracts" yaml:"contracts"` + NetworkID int64 `json:"network-id" yaml:"network-id"` + FinalityBlock uint64 `json:"finality-block" yaml:"finality-block"` + NID string `json:"nid" yaml:"nid"` + StepMin int64 `json:"step-min" yaml:"step-min"` + StepLimit int64 `json:"step-limit" yaml:"step-limit"` + StepAdjustment int `json:"step-adjustment" yaml:"step-adjustment"` + HomeDir string `json:"-" yaml:"-"` } // NewProvider returns new Icon provider @@ -66,8 +66,8 @@ func (c *Config) Validate() error { } func (c *Config) sanitize() error { - if c.StepBuffer == 0 { - c.StepBuffer = 10 + if c.StepAdjustment == 0 { + c.StepAdjustment = 10 } return nil } diff --git a/relayer/chains/icon/route.go b/relayer/chains/icon/route.go index 756dc904..6874b659 100644 --- a/relayer/chains/icon/route.go +++ b/relayer/chains/icon/route.go @@ -94,7 +94,7 @@ func (p *Provider) SendTransaction(ctx context.Context, msg *IconMessage) ([]byt } // increase step limit by step buffer - steps := int64(stepVal + stepVal*p.cfg.StepBuffer/100) + steps := int64(stepVal + stepVal*p.cfg.StepAdjustment/100) if steps > p.cfg.StepLimit { return nil, fmt.Errorf("step limit is too high: %d", steps)