MaxGasPrice reads from TOML config; allow disabling price reporting on a lane#591
MaxGasPrice reads from TOML config; allow disabling price reporting on a lane#591matYang merged 17 commits intoccip-developfrom
Conversation
| unregisterFuncs := []func() error{ | ||
| func() error { | ||
| return factory.CloseCommitStoreReader(lggr, versionFinder, params.commitStoreAddress, params.destChain.Client(), params.destChain.LogPoller(), params.sourceChain.GasEstimator(), qopts...) | ||
| return factory.CloseCommitStoreReader(lggr, versionFinder, params.commitStoreAddress, params.destChain.Client(), params.destChain.LogPoller(), params.sourceChain.GasEstimator(), params.sourceChain.Config().EVM().GasEstimator().PriceMax().ToInt(), qopts...) |
There was a problem hiding this comment.
confirmed with BIX that we can get PriceMax this way, and not worry about PriceMaxKey, closed core PR that exposes this in estimator interface: https://github.com/smartcontractkit/chainlink/pull/12272/files
|
|
||
| for _, tc := range testCases { | ||
| t.Run(tc.name, func(t *testing.T) { | ||
| obs, err := validateObservations(ctx, logger.TestLogger(t), destTokens, tc.f, tc.commitObservations) |
There was a problem hiding this comment.
nit: can avoid this if you keep the function pure and just pass in the bool
| return nil, err | ||
| } | ||
|
|
||
| lggr.Infow("Initializing CommitStore Reader", "version", version.String(), "masGasPrice", maxGasPrice.String()) |
There was a problem hiding this comment.
huh why doesn't maxGasPrice.String panic in the tests when nil?
There was a problem hiding this comment.
Afaik it's by Golang's design, it has a nil check in func (x *Int) Text(base int) string
https://stackoverflow.com/questions/42238624/calling-a-method-on-a-nil-struct-pointer-doesnt-panic-why-not
| return nil, err | ||
| } | ||
|
|
||
| lggr.Infow("Initializing CommitStore Reader", "version", version.String(), "masGasPrice", maxGasPrice.String()) |
docs/CHANGELOG_CCIP.md
Outdated
|
|
||
| ### Changed | ||
| - `CommitStore` offchain config format changed: | ||
| - Removed `MaxGasPrice` and `SourceMaxGasPrice` fields. MaxGasPrice will be read from PriceMax in chain TOML. |
There was a problem hiding this comment.
Maybe for further clarification - the fields MaxGasPrice/SourceMaxGasPrice will be ignored if specified but won't error (non-breaking change)
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
|
|
||
| ## 1.5.0 - Unreleased |
There was a problem hiding this comment.
Could potentially be released in 1.4.X right?
There was a problem hiding this comment.
Last time Da mentioned 1.5 is slated for April, it's probably more realistic to target that. Given we are already at 1.4.5, cutting this in 1.5 makes sense too.
|
|
||
| func NewCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, pgOpts ...pg.QOpt) (ccipdata.CommitStoreReader, error) { | ||
| return initOrCloseCommitStoreReader(lggr, versionFinder, address, ec, lp, estimator, false, pgOpts...) | ||
| func NewCommitStoreReader(lggr logger.Logger, versionFinder VersionFinder, address cciptypes.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, maxGasPrice *big.Int, pgOpts ...pg.QOpt) (ccipdata.CommitStoreReader, error) { |
There was a problem hiding this comment.
lets be super clear this is sourceMaxGasPrice
|
|
||
| func NewOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, registerFilters bool, pgOpts ...pg.QOpt) (ccipdata.OffRampReader, error) { | ||
| return initOrCloseOffRampReader(lggr, versionFinder, addr, destClient, lp, estimator, false, registerFilters, pgOpts...) | ||
| func NewOffRampReader(lggr logger.Logger, versionFinder VersionFinder, addr cciptypes.Address, destClient client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, maxGasPrice *big.Int, registerFilters bool, pgOpts ...pg.QOpt) (ccipdata.OffRampReader, error) { |
There was a problem hiding this comment.
ditto here - let's be very clear this is destMaxGasPrice
| } | ||
|
|
||
| func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator) (*OffRamp, error) { | ||
| func NewOffRamp(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, maxGasPrice *big.Int) (*OffRamp, error) { |
There was a problem hiding this comment.
paranoid - can we name this param destMaxGasPrice too, ditto for 1.2 etc
| } | ||
|
|
||
| func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator) (*CommitStore, error) { | ||
| func NewCommitStore(lggr logger.Logger, addr common.Address, ec client.Client, lp logpoller.LogPoller, estimator gas.EvmFeeEstimator, maxGasPrice *big.Int) (*CommitStore, error) { |
There was a problem hiding this comment.
can we name this sourceMaxGasPrice too
…n a lane (#591) ## Motivation Step 1 of Batch Gas Price reporting, allows for option of disabling gas and token price reporting on a lane, and make `MaxGasPrice` same per chain, as opposed to having it potentially different per lane.
Motivation
Step 1 of Batch Gas Price reporting, allows for option of disabling gas and token price reporting on a lane, and make
MaxGasPricesame per chain, as opposed to having it potentially different per lane.