Skip to content

FQ dest config in adapter#1803

Open
tt-cll wants to merge 6 commits intomainfrom
tt/fqd
Open

FQ dest config in adapter#1803
tt-cll wants to merge 6 commits intomainfrom
tt/fqd

Conversation

@tt-cll
Copy link
Collaborator

@tt-cll tt-cll commented Mar 6, 2026

No description provided.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Metric tt/fqd main
Coverage 70.0% 69.7%

@tt-cll tt-cll marked this pull request as ready for review March 9, 2026 13:09
@tt-cll tt-cll requested a review from a team as a code owner March 9, 2026 13:09
Copilot AI review requested due to automatic review settings March 9, 2026 13:09
@tt-cll tt-cll requested review from a team as code owners March 9, 2026 13:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves FeeQuoter destination-chain default configuration (and default destination gas price) out of user-supplied ChainDefinition literals and into chain-family adapters, with an optional override hook for per-lane tweaks.

Changes:

  • Extend LaneAdapter with GetFeeQuoterDestChainConfig() and GetDefaultGasPrice() and populate these programmatically during ConnectChains.
  • Replace ChainDefinition.FeeQuoterDestChainConfig input with FeeQuoterDestChainConfigOverrides (functional option) and populate FeeQuoterDestChainConfig internally.
  • Update integration tests / changeset tests and devenv helpers to rely on adapter defaults and optional overrides.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
integration-tests/deployment/update_to_FeeQuoter_2_0_test.go Stops manually setting FeeQuoter dest-chain config in test chain definitions.
integration-tests/deployment/lane_migrator_test.go Same as above for lane migrator test setup.
integration-tests/deployment/connect_chains_test.go Adds override helper and updates assertions to use adapter-derived defaults + overrides.
devenv/common/implcommon.go Removes manual default GasPrice/FQ config setup so ConnectChains can populate defaults.
deployment/utils/common.go Factors hex decoding into GetHexFromString helper used by adapters.
deployment/lanes/product.go Extends LaneAdapter interface with default config/gas price methods.
deployment/lanes/lane_update.go Updates ChainDefinition to accept overrides and stores populated FeeQuoter dest config.
deployment/lanes/connect_chains.go Populates defaults via adapter + applies overrides during address population.
chains/solana/deployment/v1_6_0/sequences/adapter.go Implements new adapter default config/gas price methods for Solana.
chains/evm/deployment/v1_6_0/sequences/adapter.go Implements new adapter default config/gas price methods for EVM.
chains/evm/deployment/v1_6_0/changesets/connect_chains_test.go Updates expected config assertions to use adapter defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 134 to +171
@@ -155,7 +164,11 @@ func checkBidirectionalLaneConnectivity(

feeQuoterDestConfig, err := feeQuoterOnDest.GetDestChainConfig(nil, solanaChain.Selector)
require.NoError(t, err, "must get dest chain config from feeQuoter")
expectedConfig := convertOpsConfigToGobinding(evmsequences.TranslateFQ(solanaChain.FeeQuoterDestChainConfig))
sa := solanasequences.SolanaAdapter{}
safq := sa.GetFeeQuoterDestChainConfig()
override := getFQOverrides()
override(&safq)
expectedConfig := convertOpsConfigToGobinding(evmsequences.TranslateFQ(safq))
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These assertions instantiate concrete adapter structs just to access the default FeeQuoterDestChainConfig. Since you already have solanaAdapter/evmAdapter as a lanesapi.LaneAdapter (and the interface now exposes GetFeeQuoterDestChainConfig), prefer calling the method on the passed-in adapter instead. This avoids depending on concrete types and keeps the expected config consistent with the registry-provided adapter implementation.

Copilot uses AI. Check for mistakes.
Comment on lines 146 to 150
feeQuoterDestConfig, err := feeQuoterOnSrc.GetDestChainConfig(nil, lane.Dest.Selector)
require.NoError(t, err, "must get dest chain config from feeQuoter")
expectedConfig := convertOpsConfigToGobinding(sequences.TranslateFQ(lane.Dest.FeeQuoterDestChainConfig))
a := &sequences.EVMAdapter{}
expectedConfig := convertOpsConfigToGobinding(sequences.TranslateFQ(a.GetFeeQuoterDestChainConfig()))
require.Equal(t, expectedConfig, feeQuoterDestConfig, "feeQuoter dest chain config must equal expected")
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test constructs a new sequences.EVMAdapter to get the default FeeQuoterDestChainConfig. Since srcAdapter/destAdapter are already lanesapi.LaneAdapter and now expose GetFeeQuoterDestChainConfig(), prefer using the adapter under test (e.g., lane.Dest adapter) to avoid drift if defaults ever become version/state dependent.

Copilot uses AI. Check for mistakes.
Comment on lines +77 to 81
func GetHexFromString(hexstr string) [4]byte {
b, _ := hex.DecodeString(hexstr)
var out [4]byte
copy(out[:], b)
return out
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetHexFromString ignores the DecodeString error and does not validate the decoded length. Because this helper is now exported and takes arbitrary input, invalid/odd-length strings will silently produce a zero-padded [4]byte, which can hide misconfiguration. Consider validating that decoding succeeds and that the decoded byte slice is exactly 4 bytes (panic or return an error).

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +22
// FeeQuoterDestChainConfigOverrides is a functional option that mutates a
// FeeQuoterDestChainConfig in place. Pass one or more overrides to selectively change default values.
FeeQuoterDestChainConfigOverrides *FeeQuoterDestChainConfigOverride
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FeeQuoterDestChainConfigOverrides doc comment suggests "one or more overrides", but the field type only allows a single override function (and it’s stored as a pointer). Either adjust the comment to reflect the actual API (single override) or change the type to support multiple overrides (e.g., slice / variadic application) if that’s the intent.

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +99
// FeeQuoterDestChainConfigOverride is a functional option that mutates a
// FeeQuoterDestChainConfig in place. Pass one or more overrides to
// DefaultFeeQuoterDestChainConfig to selectively change default values.
type FeeQuoterDestChainConfigOverride func(*FeeQuoterDestChainConfig)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment references DefaultFeeQuoterDestChainConfig, but that function no longer exists in this package after the refactor. Please update the comment to describe where defaults come from now (LaneAdapter.GetFeeQuoterDestChainConfig + optional overrides).

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +60
// to allow for type serialization, we apply fee quoter dest chain config overrides
// at the lane level and then set them to nil before passing to the adapters
chainA.FeeQuoterDestChainConfigOverrides = nil
chainB.FeeQuoterDestChainConfigOverrides = nil
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this loop, chainA/chainB are pointers to fields of the range variable lane (&lane.ChainA / &lane.ChainB). Those pointers are then embedded in UpdateLanesInput and may escape via ExecutionReports; if they’re retained beyond the iteration, subsequent loop iterations will overwrite the underlying lane storage and can corrupt report/input data. Prefer iterating by index (so you can take pointers to the slice elements) or copying ChainDefinitions into per-iteration variables before taking addresses.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants