Skip to content

Commit 6a21d07

Browse files
committed
Executor fixes
1 parent d8dd30f commit 6a21d07

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

ccv/chains/evm/deployment/v1_7_0/adapters/chain_family_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func makeChainConfig(chainSelector uint64, remoteChainSelector uint64) v1_7_0_ch
8383
},
8484
},
8585
DefaultExecutor: datastore.AddressRef{
86-
Type: datastore.ContractType(executor.ContractType),
86+
Type: datastore.ContractType(executor.ProxyType),
8787
Version: semver.MustParse("1.7.0"),
8888
Qualifier: "default",
8989
},

ccv/chains/evm/deployment/v1_7_0/operations/proxy/proxy.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,14 @@ var AcceptOwnership = contract.NewWrite(contract.WriteParams[AcceptOwnershipArgs
4545
return proxy.AcceptOwnership(opts)
4646
},
4747
})
48+
49+
var GetTarget = contract.NewRead(contract.ReadParams[any, common.Address, *proxy.Proxy]{
50+
Name: "proxy:get-target",
51+
Version: semver.MustParse("1.7.0"),
52+
Description: "Gets the target address on the proxy",
53+
ContractType: ContractType,
54+
NewContract: proxy.NewProxy,
55+
CallContract: func(proxy *proxy.Proxy, opts *bind.CallOpts, args any) (common.Address, error) {
56+
return proxy.GetTarget(opts)
57+
},
58+
})

ccv/chains/evm/deployment/v1_7_0/sequences/configure_chain_for_lanes.go

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/fee_quoter"
1010
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/offramp"
1111
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/onramp"
12+
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/proxy"
1213
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
1314
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
1415
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
@@ -74,7 +75,7 @@ var ConfigureChainForLanes = cldf_ops.NewSequence(
7475
BaseExecutionGasCost: remoteConfig.BaseExecutionGasCost,
7576
DefaultCCVs: defaultOutboundCCVs,
7677
LaneMandatedCCVs: laneMandatedOutboundCCVs,
77-
DefaultExecutor: common.HexToAddress(remoteConfig.DefaultExecutor),
78+
DefaultExecutor: common.HexToAddress(remoteConfig.DefaultExecutor), // The proxy address
7879
OffRamp: remoteConfig.OffRamp,
7980
})
8081
feeQuoterArgs = append(feeQuoterArgs, fee_quoter.DestChainConfigArgs{
@@ -94,10 +95,17 @@ var ConfigureChainForLanes = cldf_ops.NewSequence(
9495
OffRamp: common.HexToAddress(input.OffRamp),
9596
})
9697
defaultExecutor := common.HexToAddress(remoteConfig.DefaultExecutor)
97-
if destChainSelectorsPerExecutor[defaultExecutor] == nil {
98-
destChainSelectorsPerExecutor[defaultExecutor] = []executor.RemoteChainConfigArgs{}
98+
getTargetReport, err := cldf_ops.ExecuteOperation(b, proxy.GetTarget, chain, contract.FunctionInput[any]{
99+
ChainSelector: chain.Selector,
100+
Address: defaultExecutor,
101+
})
102+
if err != nil {
103+
return sequences.OnChainOutput{}, fmt.Errorf("failed to get target address of Executor(%s) on chain %s: %w", defaultExecutor, chain, err)
104+
}
105+
if destChainSelectorsPerExecutor[getTargetReport.Output] == nil {
106+
destChainSelectorsPerExecutor[getTargetReport.Output] = []executor.RemoteChainConfigArgs{}
99107
}
100-
destChainSelectorsPerExecutor[defaultExecutor] = append(destChainSelectorsPerExecutor[defaultExecutor], executor.RemoteChainConfigArgs{
108+
destChainSelectorsPerExecutor[getTargetReport.Output] = append(destChainSelectorsPerExecutor[getTargetReport.Output], executor.RemoteChainConfigArgs{
101109
DestChainSelector: remoteSelector,
102110
Config: remoteConfig.ExecutorDestChainConfig,
103111
})
@@ -126,18 +134,18 @@ var ConfigureChainForLanes = cldf_ops.NewSequence(
126134
writes = append(writes, onRampReport.Output)
127135

128136
// ApplyDestChainUpdates on each Executor
129-
for ExecutorAddr, destChainSelectorsToAdd := range destChainSelectorsPerExecutor {
130-
ExecutorReport, err := cldf_ops.ExecuteOperation(b, executor.ApplyDestChainUpdates, chain, contract.FunctionInput[executor.ApplyDestChainUpdatesArgs]{
137+
for executorAddr, destChainSelectorsToAdd := range destChainSelectorsPerExecutor {
138+
executorReport, err := cldf_ops.ExecuteOperation(b, executor.ApplyDestChainUpdates, chain, contract.FunctionInput[executor.ApplyDestChainUpdatesArgs]{
131139
ChainSelector: chain.Selector,
132-
Address: ExecutorAddr,
140+
Address: executorAddr,
133141
Args: executor.ApplyDestChainUpdatesArgs{
134142
DestChainSelectorsToAdd: destChainSelectorsToAdd,
135143
},
136144
})
137145
if err != nil {
138-
return sequences.OnChainOutput{}, fmt.Errorf("failed to apply dest chain config updates to Executor(%s) on chain %s: %w", ExecutorAddr, chain, err)
146+
return sequences.OnChainOutput{}, fmt.Errorf("failed to apply dest chain config updates to Executor(%s) on chain %s: %w", executorAddr, chain, err)
139147
}
140-
writes = append(writes, ExecutorReport.Output)
148+
writes = append(writes, executorReport.Output)
141149
}
142150

143151
// ApplyDestChainConfigUpdates on FeeQuoter

ccv/chains/evm/deployment/v1_7_0/sequences/configure_chain_for_lanes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestConfigureChainForLanes(t *testing.T) {
7373
offRamp = addr.Address
7474
case datastore.ContractType(committee_verifier.ContractType):
7575
committeeVerifier = addr.Address
76-
case datastore.ContractType(executor.ContractType):
76+
case datastore.ContractType(executor.ProxyType):
7777
executorAddress = addr.Address
7878
case datastore.ContractType(committee_verifier.ResolverType):
7979
committeeVerifierResolver = addr.Address

0 commit comments

Comments
 (0)