Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require (
github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260303141232-9cc3feb83863
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c
github.com/smartcontractkit/chainlink-protos/cre/go v1.0.0-beta
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0
github.com/smartcontractkit/chainlink-testing-framework/framework v0.14.1-0.20260212100725-fbd6b3bca4d1
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.20
Expand Down Expand Up @@ -477,7 +477,7 @@ require (
github.com/smartcontractkit/ccip-contract-examples/chains/evm v0.0.0-20260129135848-c86808ba5cb9 // indirect
github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect
github.com/smartcontractkit/chain-selectors v1.0.97 // indirect
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260303165416-81b2ac10f0ef // indirect
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260304104421-dd6ab4ea9452 // indirect
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260216170932-c8081efc1ae5 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 // indirect
Expand Down Expand Up @@ -574,7 +574,7 @@ require (
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0 // indirect
Expand All @@ -586,11 +586,11 @@ require (
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 // indirect
go.opentelemetry.io/otel/log v0.15.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/atomic v1.11.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,8 @@ github.com/smartcontractkit/ccip-owner-contracts v0.1.0 h1:GiBDtlx7539o7AKlDV+9L
github.com/smartcontractkit/ccip-owner-contracts v0.1.0/go.mod h1:NnT6w4Kj42OFFXhSx99LvJZWPpMjmo4+CpDEWfw61xY=
github.com/smartcontractkit/chain-selectors v1.0.97 h1:ECOin+SkJv2MUrfqTUu28J0kub04Epds5NPMHERfGjo=
github.com/smartcontractkit/chain-selectors v1.0.97/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w=
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260303165416-81b2ac10f0ef h1:zNpNSfNs0cxrcTYEvbe9gDkVZtxw7Ch/3OBwhlvS4NI=
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260303165416-81b2ac10f0ef/go.mod h1:D33vOn2jkHKuOmVnLopepz/ZgZKIR94jdpKjOVpNWIo=
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260304104421-dd6ab4ea9452 h1:8Txp5kpnQPYpeXioezwrJpsYxfnBK1ya0ND22RCTuaw=
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260304104421-dd6ab4ea9452/go.mod h1:CQGkKp3YDsUuxixxmmngmRKfh6yIcftGEZsQrsSIIM8=
github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU=
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260303102708-6caf8c4ea3b4 h1:z/44R1o+Kpc5ZDJxKV3oJYBxE7Ots73vZrrffAcf2UU=
Expand Down Expand Up @@ -1645,8 +1645,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g=
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ=
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ=
github.com/smartcontractkit/chainlink-protos/cre/go v1.0.0-beta h1:gwVxckLPTCPlzQS3aJBzYP21j6JZDI42odrzqzWIpJA=
github.com/smartcontractkit/chainlink-protos/cre/go v1.0.0-beta/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396 h1:03tbcwjyIEjvHba1IWOj1sfThwebm2XNzyFHSuZtlWc=
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260226130359-963f935e0396/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4=
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE=
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM=
Expand Down Expand Up @@ -1950,8 +1950,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:
go.opentelemetry.io/contrib/propagators/b3 v1.24.0 h1:n4xwCdTx3pZqZs2CjS/CUZAs03y3dZcGhC/FepKtEUY=
go.opentelemetry.io/contrib/propagators/b3 v1.24.0/go.mod h1:k5wRxKRU2uXx2F8uNJ4TaonuEO/V7/5xoz7kdsDACT8=
go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI=
go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms=
go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g=
go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c=
go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE=
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8=
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2/go.mod h1:DvPtKE63knkDVP88qpatBj81JxN+w1bqfVbsbCbj1WY=
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 h1:tPLwQlXbJ8NSOfZc4OkgU5h2A38M4c9kfHSVc4PFQGs=
Expand All @@ -1974,8 +1974,8 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0 h1:G8Xec/SgZQricwW
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.36.0/go.mod h1:PD57idA/AiFD5aqoxGxCvT/ILJPeHy3MjqU/NS7KogY=
go.opentelemetry.io/otel/log v0.15.0 h1:0VqVnc3MgyYd7QqNVIldC3dsLFKgazR6P3P3+ypkyDY=
go.opentelemetry.io/otel/log v0.15.0/go.mod h1:9c/G1zbyZfgu1HmQD7Qj84QMmwTp2QCQsZH1aeoWDE4=
go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g=
go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc=
go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ=
go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps=
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE=
go.opentelemetry.io/otel/sdk/log v0.15.0 h1:WgMEHOUt5gjJE93yqfqJOkRflApNif84kxoHWS9VVHE=
Expand All @@ -1985,8 +1985,8 @@ go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXf
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs=
go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw=
go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA=
go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0=
go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A=
go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4=
Expand Down
2 changes: 1 addition & 1 deletion core/services/ring/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func TestPlugin_RingStoreIntegration(t *testing.T) {

mappings, version := ringStore.GetWorkflowMappingsBatch(workflows)
require.Len(t, mappings, 3)
require.Equal(t, uint64(3), version)
require.Equal(t, uint64(1), version)
})

t.Run("workflow_transition_detected", func(t *testing.T) {
Expand Down
39 changes: 39 additions & 0 deletions core/services/ring/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,45 @@ func (s *Store) RegisterWorkflowsFromShard(shardID uint32, workflowIDs []string)
s.mappingVersion++
}

// SyncRoutes atomically replaces the routing map with the authoritative set
// from the OCR outcome, pruning any workflow IDs that are no longer present.
func (s *Store) SyncRoutes(routes map[string]uint32) {
s.mu.Lock()
defer s.mu.Unlock()

now := time.Now()
inTransition := !IsInSteadyState(s.currentState)

for wfID, shardID := range routes {
old := s.routingState[wfID]
s.routingState[wfID] = shardID
s.routingStateMeta[wfID] = &MappingMeta{
OldShardID: old,
NewShardID: shardID,
InTransition: inTransition,
UpdatedAt: now,
}
if waiters, ok := s.pendingAllocs[wfID]; ok {
for _, ch := range waiters {
select {
case ch <- shardID:
default:
}
}
delete(s.pendingAllocs, wfID)
}
}

for wfID := range s.routingState {
if _, keep := routes[wfID]; !keep {
delete(s.routingState, wfID)
delete(s.routingStateMeta, wfID)
}
}

s.mappingVersion++
}

func (s *Store) SubmitWorkflowsForAllocation(workflowIDs []string) (dropped int) {
s.mu.Lock()
defer s.mu.Unlock()
Expand Down
38 changes: 38 additions & 0 deletions core/services/ring/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,44 @@ func TestStore_GetWorkflowMappingsBatch(t *testing.T) {
require.Equal(t, uint64(2), version)
}

func TestStore_SyncRoutes_PrunesStaleEntries(t *testing.T) {
store := NewStore()
store.SetRoutingState(&ringpb.RoutingState{
State: &ringpb.RoutingState_RoutableShards{RoutableShards: 3},
})

store.SetShardForWorkflow("wf-1", 0)
store.SetShardForWorkflow("wf-2", 1)
store.SetShardForWorkflow("wf-3", 2)
require.Len(t, store.GetAllRoutingState(), 3)

store.SyncRoutes(map[string]uint32{"wf-1": 0, "wf-3": 1})

routes := store.GetAllRoutingState()
require.Len(t, routes, 2)
require.Equal(t, uint32(0), routes["wf-1"])
require.Equal(t, uint32(1), routes["wf-3"])
require.NotContains(t, routes, "wf-2")

meta, _ := store.GetWorkflowMappingsBatch([]string{"wf-2"})
require.Empty(t, meta)
}

func TestStore_SyncRoutes_EmptyPrunesAll(t *testing.T) {
store := NewStore()
store.SetRoutingState(&ringpb.RoutingState{
State: &ringpb.RoutingState_RoutableShards{RoutableShards: 2},
})

store.SetShardForWorkflow("wf-1", 0)
store.SetShardForWorkflow("wf-2", 1)
require.Len(t, store.GetAllRoutingState(), 2)

store.SyncRoutes(map[string]uint32{})

require.Empty(t, store.GetAllRoutingState())
}

func TestStore_SubmitWorkflowsForAllocation(t *testing.T) {
store := NewStore()

Expand Down
8 changes: 5 additions & 3 deletions core/services/ring/transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ func (t *Transmitter) Transmit(ctx context.Context, _ types.ConfigDigest, _ uint
}
}
if applyRoutes {
for workflowID, route := range outcome.Routes {
t.ringStore.SetShardForWorkflow(workflowID, route.Shard)
t.lggr.Debugw("Updated workflow shard mapping", "workflowID", workflowID, "shard", route.Shard)
flat := make(map[string]uint32, len(outcome.Routes))
for wfID, route := range outcome.Routes {
flat[wfID] = route.Shard
}
t.ringStore.SyncRoutes(flat)
t.lggr.Debugw("Synced workflow shard mappings", "count", len(flat))
} else {
t.lggr.Debugw("Skipping route updates while in transition", "state", outcome.State)
}
Expand Down
46 changes: 46 additions & 0 deletions core/services/ring/transmitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,52 @@ func TestTransmitter_Transmit_ArbiterError(t *testing.T) {
require.ErrorIs(t, err, context.DeadlineExceeded)
}

func TestTransmitter_Transmit_StaleEntriesPruned(t *testing.T) {
lggr := logger.Test(t)
store := NewStore()
mock := &mockArbiterScaler{}
tx := NewTransmitter(lggr, store, mock, "test-account")

outcome1 := &ringpb.Outcome{
State: &ringpb.RoutingState{
Id: 1,
State: &ringpb.RoutingState_RoutableShards{RoutableShards: 3},
},
Routes: map[string]*ringpb.WorkflowRoute{
"wf-1": {Shard: 0},
"wf-2": {Shard: 1},
"wf-3": {Shard: 2},
},
}
outcomeBytes, err := proto.Marshal(outcome1)
require.NoError(t, err)

err = tx.Transmit(t.Context(), types.ConfigDigest{}, 0, ocr3types.ReportWithInfo[[]byte]{Report: outcomeBytes}, nil)
require.NoError(t, err)
require.Len(t, store.GetAllRoutingState(), 3)

outcome2 := &ringpb.Outcome{
State: &ringpb.RoutingState{
Id: 2,
State: &ringpb.RoutingState_RoutableShards{RoutableShards: 3},
},
Routes: map[string]*ringpb.WorkflowRoute{
"wf-1": {Shard: 0},
},
}
outcomeBytes, err = proto.Marshal(outcome2)
require.NoError(t, err)

err = tx.Transmit(t.Context(), types.ConfigDigest{}, 0, ocr3types.ReportWithInfo[[]byte]{Report: outcomeBytes}, nil)
require.NoError(t, err)

routes := store.GetAllRoutingState()
require.Len(t, routes, 1)
require.Equal(t, uint32(0), routes["wf-1"])
require.NotContains(t, routes, "wf-2")
require.NotContains(t, routes, "wf-3")
}

func TestTransmitter_Transmit_NilState(t *testing.T) {
lggr := logger.Test(t)
store := NewStore()
Expand Down
33 changes: 33 additions & 0 deletions deployment/ccip/operation/aptos/rmn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ func (s *stubRMNRemote) GetReportDigestHeader(*bind.CallOpts) ([]byte, error) {
func (s *stubRMNRemote) GetCursedSubjects(*bind.CallOpts) ([][]byte, error) { return nil, nil }
func (s *stubRMNRemote) IsCursedGlobal(*bind.CallOpts) (bool, error) { return false, nil }
func (s *stubRMNRemote) IsCursedU128(*bind.CallOpts, *big.Int) (bool, error) { return false, nil }
func (s *stubRMNRemote) IsAllowedCurser(*bind.CallOpts, aptos.AccountAddress) (bool, error) {
return false, nil
}
func (s *stubRMNRemote) GetAllowedCursers(*bind.CallOpts) ([]aptos.AccountAddress, error) {
return nil, nil
}
func (s *stubRMNRemote) Initialize(*bind.TransactOpts, uint64) (*api.PendingTransaction, error) {
return nil, nil
}
Expand All @@ -195,6 +201,15 @@ func (s *stubRMNRemote) CurseMultiple(*bind.TransactOpts, [][]byte) (*api.Pendin
func (s *stubRMNRemote) Uncurse(*bind.TransactOpts, []byte) (*api.PendingTransaction, error) {
return nil, nil
}
func (s *stubRMNRemote) InitializeAllowedCursersV2(*bind.TransactOpts, []aptos.AccountAddress) (*api.PendingTransaction, error) {
return nil, nil
}
func (s *stubRMNRemote) AddAllowedCursers(*bind.TransactOpts, []aptos.AccountAddress) (*api.PendingTransaction, error) {
return nil, nil
}
func (s *stubRMNRemote) RemoveAllowedCursers(*bind.TransactOpts, []aptos.AccountAddress) (*api.PendingTransaction, error) {
return nil, nil
}
func (s *stubRMNRemote) UncurseMultiple(*bind.TransactOpts, [][]byte) (*api.PendingTransaction, error) {
return nil, nil
}
Expand Down Expand Up @@ -267,3 +282,21 @@ func (s *stubEncoder) MCMSEntrypoint(aptos.AccountAddress) (bind.ModuleInformati
func (s *stubEncoder) RegisterMCMSEntrypoint() (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
func (s *stubEncoder) IsAllowedCurser(aptos.AccountAddress) (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
func (s *stubEncoder) GetAllowedCursers() (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
func (s *stubEncoder) InitializeAllowedCursersV2([]aptos.AccountAddress) (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
func (s *stubEncoder) AddAllowedCursers([]aptos.AccountAddress) (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
func (s *stubEncoder) RemoveAllowedCursers([]aptos.AccountAddress) (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
func (s *stubEncoder) AssertOwnerOrAllowedCurser(aptos.AccountAddress) (bind.ModuleInformation, string, []aptos.TypeTag, [][]byte, error) {
return bind.ModuleInformation{}, "", nil, nil, nil
}
9 changes: 9 additions & 0 deletions deployment/cre/jobs/pkg/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ func GetCapRegAddressRefKey(chainSel uint64, qualifier string, version string) d
qualifier,
)
}

func GetShardConfigAddressRefKey(chainSel uint64, qualifier string) datastore.AddressRefKey {
return datastore.NewAddressRefKey(
chainSel,
"ShardConfig",
semver.MustParse("1.0.0"),
qualifier,
)
}
12 changes: 11 additions & 1 deletion deployment/cre/jobs/propose_job_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,16 @@ func (u ProposeJobSpec) Apply(e cldf.Environment, input ProposeJobSpecInput) (cl
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get Ring contract address for chain selector %d and qualifier %s: %w", jobInput.ChainSelectorEVM, jobInput.ContractQualifier, err)
}

shardConfigAddr := jobInput.ShardConfigAddr
if shardConfigAddr == "" {
scRefKey := pkg.GetShardConfigAddressRefKey(uint64(jobInput.ChainSelectorEVM), "")
scAddrRef, scErr := e.DataStore.Addresses().Get(scRefKey)
if scErr != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get ShardConfig address from datastore for chain selector %d: %w", jobInput.ChainSelectorEVM, scErr)
}
shardConfigAddr = scAddrRef.Address
}

r, rErr := operations.ExecuteSequence(
e.OperationsBundle,
job_ops.ProposeRingJob,
Expand All @@ -299,7 +309,7 @@ func (u ProposeJobSpec) Apply(e cldf.Environment, input ProposeJobSpecInput) (cl
JobName: input.JobName,
ContractAddress: contractAddrRef.Address,
ChainSelectorEVM: uint64(jobInput.ChainSelectorEVM),
ShardConfigAddr: jobInput.ShardConfigAddr,
ShardConfigAddr: shardConfigAddr,
BootstrapperUrls: jobInput.BootstrapperRingUrls,
DONFilters: input.DONFilters,
ExtraLabels: input.ExtraLabels,
Expand Down
Loading
Loading