Skip to content

Commit

Permalink
Merge branch 'develop' into tt_1862_remove_logstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Dec 6, 2024
2 parents ecf9792 + f8a221f commit a04767f
Show file tree
Hide file tree
Showing 45 changed files with 940 additions and 694 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ core/scripts/gateway @smartcontractkit/dev-services

# Tests
/integration-tests/ @smartcontractkit/test-tooling-team @smartcontractkit/core
/integration-tests/ccip-tests @smartcontractkit/ccip-offchain @smartcontractkit/core
/integration-tests/ccip-tests @smartcontractkit/ccip-offchain @smartcontractkit/core @smartcontractkit/ccip
/integration-tests/**/*keeper* @smartcontractkit/dev-services @smartcontractkit/core
/integration-tests/**/*automation* @smartcontractkit/dev-services @smartcontractkit/core
/integration-tests/**/*ccip* @smartcontractkit/ccip-offchain @smartcontractkit/core
/integration-tests/**/*ccip* @smartcontractkit/ccip-offchain @smartcontractkit/core @smartcontractkit/ccip

# Deployment tooling
/deployment @smartcontractkit/ccip @smartcontractkit/keystone @smartcontractkit/core @smartcontractkit/deployment-automation
Expand Down
13 changes: 0 additions & 13 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -948,19 +948,6 @@ runner-test-matrix:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0

- id: smoke/ccip/ccip_batching_test.go:*
path: integration-tests/smoke/ccip/ccip_batching_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/ && go test smoke/ccip/ccip_batching_test.go -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2,SIMULATED_3
E2E_JD_VERSION: 0.6.0

- id: smoke/ccip/ccip_token_transfer_test.go:*
path: integration-tests/smoke/ccip/ccip_token_transfer_test.go
test_env_type: docker
Expand Down
8 changes: 8 additions & 0 deletions .github/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ runner-test-matrix:
triggers:
- PR Integration CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_fee_boosting_test.go -timeout 12m -test.parallel=2 -count=1 -json

- id: smoke/ccip/ccip_batching_test.go:*
path: integration-tests/smoke/ccip/ccip_batching_test.go
test_env_type: in-memory
runs_on: ubuntu-latest
triggers:
- PR Integration CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_batching_test.go -timeout 12m -test.parallel=2 -count=1 -json

- id: contracts/ccipreader_test.go:*
path: integration-tests/contracts/ccipreader_test.go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
- added|modified: 'contracts/.changeset/*.md'
- name: Setup node
uses: ./.github/actions/setup-node
uses: ./.github/actions/setup-nodejs
if: ${{ steps.files-changed.outputs.contracts-changeset == 'true' }}

- name: Validate changeset files
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/v0.8/ccip/capability/CCIPHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts
/// │ Active │ revokeCandidate │ Candidate │◄───────────┐
/// │ [1,0] │◄───────────────────┤ [1,1] │────────────┘
/// │ ├───────────────────►│ │
/// └─────────────┘ setSecondary └─────────────┘
/// └─────────────┘ setCandidate └─────────────┘
///
contract CCIPHome is Ownable2StepMsgSender, ITypeAndVersion, ICapabilityConfiguration, IERC165 {
using EnumerableSet for EnumerableSet.UintSet;
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/v0.8/ccip/rmn/RMNHome.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {Ownable2StepMsgSender} from "../../shared/access/Ownable2StepMsgSender.s
/// │ Active │ revokeCandidate │ Candidate │◄───────────┐
/// │ [1,0] │◄───────────────────┤ [1,1] │────────────┘
/// │ ├───────────────────►│ │
/// └─────────────┘ setSecondary └─────────────┘
/// └─────────────┘ setCandidate └─────────────┘
///
contract RMNHome is Ownable2StepMsgSender, ITypeAndVersion {
event ConfigSet(bytes32 indexed configDigest, uint32 version, StaticConfig staticConfig, DynamicConfig dynamicConfig);
Expand Down
5 changes: 5 additions & 0 deletions core/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/cache"
"github.com/smartcontractkit/chainlink/v2/core/services/versioning"
"github.com/smartcontractkit/chainlink/v2/core/services/webhook"
"github.com/smartcontractkit/chainlink/v2/core/services/workflows"
"github.com/smartcontractkit/chainlink/v2/core/sessions"
"github.com/smartcontractkit/chainlink/v2/core/static"
"github.com/smartcontractkit/chainlink/v2/core/store/migrate"
Expand Down Expand Up @@ -111,6 +112,10 @@ func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, cfgTeleme
AuthPublicKeyHex: csaPubKeyHex,
AuthHeaders: beholderAuthHeaders,
}
// note: due to the OTEL specification, all histogram buckets
// must be defined when the beholder client is created
clientCfg.MetricViews = append(clientCfg.MetricViews, workflows.MetricViews()...)

if tracingCfg.Enabled {
clientCfg.TraceSpanExporter, err = tracingCfg.NewSpanExporter()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/prometheus/client_golang v1.20.5
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241204184525-29871ced7b4d
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241206011233-b6684ee6508f
github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000
github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241204015713-8956bb614e9e h1:GnM6ZWV6vlk2+n6c6o+v/R1LtXzBGVVx7r37nt/h6Uc=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241204015713-8956bb614e9e/go.mod h1:80vGBbOfertJig0xFKsRfm+i17FkjdKkk1dAaGE45Os=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241204184525-29871ced7b4d h1:5XKarlliHXVVAhpCeOAx/TRU7eWsJ3tkqRI3I6Cc0SU=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241204184525-29871ced7b4d/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241206011233-b6684ee6508f h1:hH+cAG2zt+WK4I2m572LXAnAJg3wtGEAwzBKR8FiXo8=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241206011233-b6684ee6508f/go.mod h1:bQktEJf7sJ0U3SmIcXvbGUox7SmXcnSEZ4kUbT8R5Nk=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241202141438-a90db35252db h1:N1RH1hSr2ACzOFc9hkCcjE8pRBTdcU3p8nsTJByaLes=
Expand Down
32 changes: 32 additions & 0 deletions core/services/workflows/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"go.opentelemetry.io/otel/metric"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"

"github.com/smartcontractkit/chainlink-common/pkg/beholder"
"github.com/smartcontractkit/chainlink-common/pkg/metrics"
Expand Down Expand Up @@ -135,6 +136,37 @@ func initMonitoringResources() (em *engineMetrics, err error) {
return em, nil
}

// Note: due to the OTEL specification, all histogram buckets
// Must be defined when the beholder client is created
func MetricViews() []sdkmetric.View {
return []sdkmetric.View{
sdkmetric.NewView(
sdkmetric.Instrument{Name: "platform_engine_workflow_earlyexit_time_seconds"},
sdkmetric.Stream{Aggregation: sdkmetric.AggregationExplicitBucketHistogram{
Boundaries: []float64{0, 1, 10, 100},
}},
),
sdkmetric.NewView(
sdkmetric.Instrument{Name: "platform_engine_workflow_completed_time_seconds"},
sdkmetric.Stream{Aggregation: sdkmetric.AggregationExplicitBucketHistogram{
Boundaries: []float64{0, 100, 1000, 10_000, 50_000, 100_0000, 500_000},
}},
),
sdkmetric.NewView(
sdkmetric.Instrument{Name: "platform_engine_workflow_error_time_seconds"},
sdkmetric.Stream{Aggregation: sdkmetric.AggregationExplicitBucketHistogram{
Boundaries: []float64{0, 20, 60, 120, 240},
}},
),
sdkmetric.NewView(
sdkmetric.Instrument{Name: "platform_engine_workflow_step_time_seconds"},
sdkmetric.Stream{Aggregation: sdkmetric.AggregationExplicitBucketHistogram{
Boundaries: []float64{0, 20, 60, 120, 240},
}},
),
}
}

// workflowsMetricLabeler wraps monitoring.MetricsLabeler to provide workflow specific utilities
// for monitoring resources
type workflowsMetricLabeler struct {
Expand Down
1 change: 1 addition & 0 deletions deployment/ccip/changeset/cs_add_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func TestAddChainInbound(t *testing.T) {

// verify if the configs are updated
require.NoError(t, ValidateCCIPHomeConfigSetUp(
e.Env.Logger,
state.Chains[e.HomeChainSel].CapabilityRegistry,
state.Chains[e.HomeChainSel].CCIPHome,
newChain,
Expand Down
69 changes: 31 additions & 38 deletions deployment/ccip/changeset/cs_deploy_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,31 +182,31 @@ func deployChainContracts(
}
chainState, chainExists := state.Chains[chain.Selector]
if !chainExists {
return fmt.Errorf("chain %d not found in existing state, deploy the prerequisites first", chain.Selector)
return fmt.Errorf("chain %s not found in existing state, deploy the prerequisites first", chain.String())
}
if chainState.Weth9 == nil {
return fmt.Errorf("weth9 not found for chain %d, deploy the prerequisites first", chain.Selector)
return fmt.Errorf("weth9 not found for chain %s, deploy the prerequisites first", chain.String())
}
if chainState.Timelock == nil {
return fmt.Errorf("timelock not found for chain %d, deploy the mcms contracts first", chain.Selector)
return fmt.Errorf("timelock not found for chain %s, deploy the mcms contracts first", chain.String())
}
weth9Contract := chainState.Weth9
if chainState.LinkToken == nil {
return fmt.Errorf("link token not found for chain %d, deploy the prerequisites first", chain.Selector)
return fmt.Errorf("link token not found for chain %s, deploy the prerequisites first", chain.String())
}
linkTokenContract := chainState.LinkToken
if chainState.TokenAdminRegistry == nil {
return fmt.Errorf("token admin registry not found for chain %d, deploy the prerequisites first", chain.Selector)
return fmt.Errorf("token admin registry not found for chain %s, deploy the prerequisites first", chain.String())
}
tokenAdminReg := chainState.TokenAdminRegistry
if chainState.RegistryModule == nil {
return fmt.Errorf("registry module not found for chain %d, deploy the prerequisites first", chain.Selector)
return fmt.Errorf("registry module not found for chain %s, deploy the prerequisites first", chain.String())
}
if chainState.Router == nil {
return fmt.Errorf("router not found for chain %d, deploy the prerequisites first", chain.Selector)
return fmt.Errorf("router not found for chain %s, deploy the prerequisites first", chain.String())
}
if chainState.Receiver == nil {
ccipReceiver, err := deployment.DeployContract(e.Logger, chain, ab,
_, err := deployment.DeployContract(e.Logger, chain, ab,
func(chain deployment.Chain) deployment.ContractDeploy[*maybe_revert_message_receiver.MaybeRevertMessageReceiver] {
receiverAddr, tx, receiver, err2 := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(
chain.DeployerKey,
Expand All @@ -221,9 +221,8 @@ func deployChainContracts(
e.Logger.Errorw("Failed to deploy receiver", "err", err)
return err
}
e.Logger.Infow("deployed receiver", "addr", ccipReceiver.Address)
} else {
e.Logger.Infow("receiver already deployed", "addr", chainState.Receiver.Address)
e.Logger.Infow("receiver already deployed", "addr", chainState.Receiver.Address, "chain", chain.String())
}
rmnRemoteContract := chainState.RMNRemote
if chainState.RMNRemote == nil {
Expand All @@ -242,20 +241,19 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy RMNRemote", "err", err)
e.Logger.Errorw("Failed to deploy RMNRemote", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("deployed RMNRemote", "addr", rmnRemote.Address)
rmnRemoteContract = rmnRemote.Contract
} else {
e.Logger.Infow("rmn remote already deployed", "addr", chainState.RMNRemote.Address)
e.Logger.Infow("rmn remote already deployed", "chain", chain.String(), "addr", chainState.RMNRemote.Address)
}
activeDigest, err := rmnHome.GetActiveDigest(&bind.CallOpts{})
if err != nil {
e.Logger.Errorw("Failed to get active digest", "err", err)
e.Logger.Errorw("Failed to get active digest", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("setting active home digest to rmn remote", "digest", activeDigest)
e.Logger.Infow("setting active home digest to rmn remote", "chain", chain.String(), "digest", activeDigest)

tx, err := rmnRemoteContract.SetConfig(chain.DeployerKey, rmn_remote.RMNRemoteConfig{
RmnHomeContractConfigDigest: activeDigest,
Expand All @@ -265,7 +263,7 @@ func deployChainContracts(
F: 0, // TODO: update when we have signers
})
if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil {
e.Logger.Errorw("Failed to confirm RMNRemote config", "err", err)
e.Logger.Errorw("Failed to confirm RMNRemote config", "chain", chain.String(), "err", err)
return err
}

Expand All @@ -286,16 +284,15 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy RMNProxyNew", "err", err)
e.Logger.Errorw("Failed to deploy RMNProxyNew", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("deployed new RMNProxyNew", "addr", rmnProxy.Address)
rmnProxyContract = rmnProxy.Contract
} else {
e.Logger.Infow("rmn proxy already deployed", "addr", chainState.RMNProxyNew.Address)
e.Logger.Infow("rmn proxy already deployed", "chain", chain.String(), "addr", chainState.RMNProxyNew.Address)
}
if chainState.TestRouter == nil {
testRouterContract, err := deployment.DeployContract(e.Logger, chain, ab,
_, err := deployment.DeployContract(e.Logger, chain, ab,
func(chain deployment.Chain) deployment.ContractDeploy[*router.Router] {
routerAddr, tx2, routerC, err2 := router.DeployRouter(
chain.DeployerKey,
Expand All @@ -308,12 +305,11 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy test router", "err", err)
e.Logger.Errorw("Failed to deploy test router", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("deployed test router", "addr", testRouterContract.Address)
} else {
e.Logger.Infow("test router already deployed", "addr", chainState.TestRouter.Address)
e.Logger.Infow("test router already deployed", "chain", chain.String(), "addr", chainState.TestRouter.Address)
}

nmContract := chainState.NonceManager
Expand All @@ -330,13 +326,12 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy nonce manager", "err", err)
e.Logger.Errorw("Failed to deploy nonce manager", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("Deployed nonce manager", "addr", nonceManager.Address)
nmContract = nonceManager.Contract
} else {
e.Logger.Infow("nonce manager already deployed", "addr", chainState.NonceManager.Address)
e.Logger.Infow("nonce manager already deployed", "chain", chain.String(), "addr", chainState.NonceManager.Address)
}
feeQuoterContract := chainState.FeeQuoter
if chainState.FeeQuoter == nil {
Expand Down Expand Up @@ -371,13 +366,12 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy fee quoter", "err", err)
e.Logger.Errorw("Failed to deploy fee quoter", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("Deployed fee quoter", "addr", feeQuoter.Address)
feeQuoterContract = feeQuoter.Contract
} else {
e.Logger.Infow("fee quoter already deployed", "addr", chainState.FeeQuoter.Address)
e.Logger.Infow("fee quoter already deployed", "chain", chain.String(), "addr", chainState.FeeQuoter.Address)
}
onRampContract := chainState.OnRamp
if onRampContract == nil {
Expand All @@ -403,13 +397,12 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy onramp", "err", err)
e.Logger.Errorw("Failed to deploy onramp", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("Deployed onramp", "addr", onRamp.Address)
onRampContract = onRamp.Contract
} else {
e.Logger.Infow("onramp already deployed", "addr", chainState.OnRamp.Address)
e.Logger.Infow("onramp already deployed", "chain", chain.String(), "addr", chainState.OnRamp.Address)
}
offRampContract := chainState.OffRamp
if offRampContract == nil {
Expand All @@ -436,13 +429,12 @@ func deployChainContracts(
}
})
if err != nil {
e.Logger.Errorw("Failed to deploy offramp", "err", err)
e.Logger.Errorw("Failed to deploy offramp", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("Deployed offramp", "addr", offRamp.Address)
offRampContract = offRamp.Contract
} else {
e.Logger.Infow("offramp already deployed", "addr", chainState.OffRamp.Address)
e.Logger.Infow("offramp already deployed", "chain", chain.String(), "addr", chainState.OffRamp.Address)
}
// Basic wiring is always needed.
tx, err = feeQuoterContract.ApplyAuthorizedCallerUpdates(chain.DeployerKey, fee_quoter.AuthorizedCallersAuthorizedCallerArgs{
Expand All @@ -451,16 +443,17 @@ func deployChainContracts(
AddedCallers: []common.Address{offRampContract.Address(), chain.DeployerKey.From},
})
if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil {
e.Logger.Errorw("Failed to confirm fee quoter authorized caller update", "err", err)
e.Logger.Errorw("Failed to confirm fee quoter authorized caller update", "chain", chain.String(), "err", err)
return err
}

e.Logger.Infow("Added fee quoter authorized callers", "chain", chain.String(), "callers", []common.Address{offRampContract.Address(), chain.DeployerKey.From})
tx, err = nmContract.ApplyAuthorizedCallerUpdates(chain.DeployerKey, nonce_manager.AuthorizedCallersAuthorizedCallerArgs{
AddedCallers: []common.Address{offRampContract.Address(), onRampContract.Address()},
})
if _, err := deployment.ConfirmIfNoError(chain, tx, err); err != nil {
e.Logger.Errorw("Failed to update nonce manager with ramps", "err", err)
e.Logger.Errorw("Failed to update nonce manager with ramps", "chain", chain.String(), "err", err)
return err
}
e.Logger.Infow("Added nonce manager authorized callers", "chain", chain.String(), "callers", []common.Address{offRampContract.Address(), onRampContract.Address()})
return nil
}
Loading

0 comments on commit a04767f

Please sign in to comment.