Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d3f295f
wip: splitting solana worker and evm worker
ecPablo May 13, 2025
97f618e
wip: refactoring solana worker
ecPablo May 19, 2025
760b02a
Merge branch 'develop' into ecpablo/add-solana-worker-type
ecPablo May 21, 2025
b7d109e
feat: add log polling func and initial unit tests
ecPablo May 23, 2025
36f2d46
feat: added unit tests for log polling
ecPablo May 27, 2025
e72a61e
fix: comments
ecPablo May 27, 2025
06795b1
feat: added integration tests setup and initial log decoding logic.
ecPablo May 27, 2025
5dc365d
fix: add correct folder for compilation
ecPablo May 27, 2025
f4fd105
feat: add log polling and event handlers for sending to scheduler. ad…
ecPablo May 28, 2025
c024dff
fix: remove ptr int func
ecPablo May 28, 2025
26fb2df
Merge branch 'develop' into ecpablo/add-solana-log-polling
ecPablo May 29, 2025
84ef1f7
fix: merge conflicts, fix unit tests and linting
ecPablo May 29, 2025
13f24d4
fix: update CI with ctf config
ecPablo May 29, 2025
524ece3
fix: update CI with ctf config
ecPablo May 29, 2025
47e5abd
fix: dir ctf config
ecPablo May 29, 2025
55a7430
fix: dir ctf config
ecPablo May 29, 2025
36a0e78
fix: add program compilation CI
ecPablo May 29, 2025
c055262
fix: add program compilation CI
ecPablo May 29, 2025
798f4c1
fix: update perms compile programs
ecPablo May 29, 2025
f5c6453
fix: update perms compile programs
ecPablo May 29, 2025
859a8cf
fix: update compiling script
ecPablo May 29, 2025
d70594d
fix: paths for compiled programs
ecPablo May 29, 2025
20e8219
fix: paths for compiled programs
ecPablo May 29, 2025
cbec0cb
fix: unit tests
ecPablo May 29, 2025
fd28b96
fix: unit tests
ecPablo May 29, 2025
8979f90
fix: unit tests
ecPablo May 29, 2025
53e89ef
fix: move up cache calculation to improve workflow performance by ski…
ecPablo May 30, 2025
e0f608f
fix: gitignore
ecPablo May 30, 2025
dd3b7f0
Merge branch 'develop' into ecpablo/add-solana-log-polling
ecPablo May 30, 2025
89fd5b3
fix: replacer infof with infow in logs and fix event types after rebase
ecPablo May 30, 2025
46e76c4
fix: unit tests for get parsed transaction after develop rebase
ecPablo May 30, 2025
6df424e
fix: rename solana_utils
ecPablo May 30, 2025
8ee2819
fix: refactor mock solana rpc server
ecPablo May 30, 2025
88a7142
fix: refactor mock solana rpc server
ecPablo May 30, 2025
1389b05
fix: change interface{} to any
ecPablo May 30, 2025
8a719e4
fix: update comment
ecPablo May 30, 2025
1943312
fix: remove logpolling test file
ecPablo May 30, 2025
104f45c
fix: use s.T().Context()
ecPablo May 30, 2025
c36f0c8
feat: add scheduler calls, mocks and unit tests on solana worker
ecPablo May 31, 2025
7901beb
Update pkg/timelock/worker_solana.go
ecPablo May 31, 2025
d149089
feat: add better retry mechanisms for tx fetching.
ecPablo May 31, 2025
93d0a1f
fix: remove func call inside require.NoError to improve code readability
ecPablo May 31, 2025
964ccc2
Update pkg/timelock/worker_solana_test.go
ecPablo May 31, 2025
b056f31
fix: linting
ecPablo May 31, 2025
4f07ca9
fix: move tx assertions into helper function for better readability
ecPablo May 31, 2025
e917379
fix: use unit test context
ecPablo May 31, 2025
deb892c
fix: remove mock assert expectations
ecPablo May 31, 2025
391a679
fix: typo
ecPablo May 31, 2025
e89faed
fix: cleanup and add mocks
ecPablo May 31, 2025
4f18a4d
fix: use existing retry function
ecPablo Jun 3, 2025
00021bb
fix: rpcErrorOrDefault rename and remove timeout error
ecPablo Jun 3, 2025
39cc04d
fix: make startPolling private
ecPablo Jun 3, 2025
51d502c
fix: change interface{} to any
ecPablo Jun 3, 2025
34ecfb6
fix: add t.fatal when no signatures are found
ecPablo Jun 3, 2025
fdf219c
feat: expose commitment type as param
ecPablo Jun 3, 2025
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
38 changes: 37 additions & 1 deletion .github/workflows/pull-request-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,49 @@ jobs:
ci-test:
name: Tests
runs-on: ubuntu-latest
env:
CTF_CONFIGS: /home/runner/work/timelock-worker/timelock-worker/tests/integration/solana/artifacts
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Compute Solana programs cache key
id: solana-programs-cache-key
shell: bash
run: |
key="$(go list -m github.com/smartcontractkit/chainlink-ccip/chains/solana)"
echo "key=${key}" >> "$GITHUB_OUTPUT"

- name: Install Rust
if: steps.solana-programs-cache-key.outputs.cache-hit != 'true'
uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2

- name: Install Solana
if: steps.solana-programs-cache-key.outputs.cache-hit != 'true'
uses: metaplex-foundation/actions/install-solana@2389940047edc63a5781911f6a53fbdf784748d8 # v1.0.4
with:
version: 1.18.26

- name: Cache Solana programs
uses: actions/cache@v4
id: cache-solana-programs
with:
path: ./tests/integration/solana/artifacts
key: "${{ runner.os }}-mcms-contracts-${{ steps.solana-programs-cache-key.outputs.key }}"

- name: Build Solana programs
if: steps.solana-programs-cache-key.outputs.cache-hit != 'true'
shell: bash
run: |
./tests/integration/solana/compile-timelock-programs.sh

- name: Build and test
uses: smartcontractkit/.github/actions/ci-test-go@ci-test-go/0.3.5
with:
go-test-cmd: go test -short -coverprofile=coverage.out -covermode=atomic -race ./...
go-test-cmd: CTF_CONFIGS=./config.toml go test -short -coverprofile=coverage.out -covermode=atomic -race ./...
Comment thread
gustavogama-cll marked this conversation as resolved.
checkout-repo: false
use-go-cache: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ testdata/
.vscode/


tests/integration/solana/artifacts/
25 changes: 9 additions & 16 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# Mockery configuration file

# All interfaces in a package are generated by default. You can set this to false in the config of
# of each package to disable this behavior.
all: false
with-expecter: true
# The name of the mock file to be generated is the snake cased interface name.
filename: "{{.InterfaceName | snakecase | lower}}.go"
# Creates the mocks in a `mocks` dir inside the package containing the interfaces.
dir: "{{.InterfaceDir}}/mocks"
# The name of the mock struct is the interface name.
mockname: "{{.InterfaceName}}"
# Places the mock package in the same package as the interface.
outpkg: "mocks"

packages:
github.com/smartcontractkit/timelock-worker/pkg/timelock:
interfaces:
Scheduler:
config:
dir: "./pkg/timelock"
filename: "scheduler_mock.go"

github.com/ethereum/go-ethereum/accounts/abi/bind:
interfaces:
ContractBackend:
config:
# inpackage: false
filename: "{{.InterfaceName | snakecase}}.go"
# mockname: "{{.InterfaceName}}"
dir: "./pkg/timelock/mocks"
filename: "contract_backend.go"
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
golang 1.24.3
golangci-lint 1.64.8
task 3.40.0
mockery 2.50.0
mockery 3.3.2
18 changes: 17 additions & 1 deletion cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/ethereum/go-ethereum/common"
solana2 "github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
chain_selectors "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/mcms/sdk/solana"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -145,7 +146,22 @@ func startTimelock(cmd *cobra.Command) {
slog.Fatalf("error while starting timelock-worker: %s", err.Error())
}
} else if chainFamily == chain_selectors.FamilySolana {
slog.Infof("Solana chain family is not supported yet")
tWorker, err := timelock.NewTimelockWorkerSolana(nodeURL,
timelockAddress,
privateKey,
pollPeriod,
eventListenerPollPeriod,
int(eventListenerPollSize), // #nosec G115
dryRun,
rpc.CommitmentFinalized,
slog)
if err != nil {
slog.Fatalf("error creating the timelock-worker: %s", err.Error())
}

if err := tWorker.Listen(context.Background()); err != nil {
slog.Fatalf("error while starting timelock-worker: %s", err.Error())
}
} else {
slog.Fatalf("unsupported chain family: %s", chainFamily)
}
Expand Down
47 changes: 44 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ require (
github.com/gagliardetto/binary v0.8.0
Comment thread
ecPablo marked this conversation as resolved.
github.com/gagliardetto/solana-go v1.12.0
github.com/google/go-cmp v0.7.0
github.com/mr-tron/base58 v1.2.0
github.com/prometheus/client_golang v1.21.1
github.com/samber/lo v1.47.0
github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240917103524-56f1a8d2cd4b
github.com/smartcontractkit/chain-selectors v1.0.55
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250515132731-ad40fab9b75e
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7
github.com/smartcontractkit/mcms v0.20.1
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
Expand All @@ -31,12 +34,26 @@ require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2 v1.32.2 // indirect
github.com/aws/aws-sdk-go-v2/config v1.28.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.41 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 // indirect
github.com/aws/smithy-go v1.22.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.17.0 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/block-vision/sui-go-sdk v1.0.6 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/cp v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
Expand Down Expand Up @@ -72,12 +89,14 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.25.0 // indirect
github.com/go-resty/resty/v2 v2.15.3 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect
Expand Down Expand Up @@ -111,7 +130,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
Expand All @@ -131,14 +149,16 @@ require (
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250515132731-ad40fab9b75e // indirect
github.com/smartcontractkit/chainlink-common v0.6.1-0.20250329081313-84ec641e0758 // indirect
github.com/smartcontractkit/libocr v0.0.0-20250220133800-f3b940c4f298 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
Expand All @@ -148,6 +168,9 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/urfave/cli/v2 v2.27.5 // indirect
Expand All @@ -157,8 +180,23 @@ require (
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.11.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.35.0 // indirect
go.opentelemetry.io/otel/log v0.11.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
go.opentelemetry.io/otel/sdk/log v0.11.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/ratelimit v0.3.1 // indirect
golang.org/x/crypto v0.36.0 // indirect
Expand All @@ -170,6 +208,9 @@ require (
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.10.0 // indirect
golang.org/x/tools v0.31.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/grpc v1.71.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
Expand Down
Loading
Loading