Skip to content

Commit

Permalink
Bump chainlink-solana (#14575)
Browse files Browse the repository at this point in the history
* Bump chainlink-solana

* Add Solana SendOnly config

* Add Solana SendOnly config

* Bump Solana

* Update Solana Multinode config

* go mod tidy

* Fix finality tag

* Fix tests

* bump solana

* Update chains-solana.toml

* make config docs

* Set FinalityTagEnabled

* Set SendOnly

* Changeset

* Bump Solana

* undo config changes
  • Loading branch information
DylanTinianov authored Oct 7, 2024
1 parent 816b25c commit 1b41e69
Show file tree
Hide file tree
Showing 19 changed files with 425 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-foxes-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Bump chainlink-solana and fix tests #internal
32 changes: 32 additions & 0 deletions core/config/docs/chains-solana.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,38 @@ BlockHistoryPollPeriod = '5s' # Default
# ComputeUnitLimitDefault is the compute units limit applied to transactions unless overriden during the txm enqueue
ComputeUnitLimitDefault = 200_000 # Default

[Solana.MultiNode]
# Enabled enables the multinode feature.
Enabled = false # Default
# PollFailureThreshold is the number of consecutive poll failures before a node is considered unhealthy.
PollFailureThreshold = 5 # Default
# PollInterval is the rate to poll for node health.
PollInterval = '10s' # Default
# SelectionMode is the method used to select the next best node to use.
SelectionMode = 'PriorityLevel' # Default
# SyncThreshold is the number of blocks behind the best node that a node can be before it is considered out of sync.
SyncThreshold = 5 # Default
# NodeIsSyncingEnabled enables the feature to avoid sending transactions to nodes that are syncing. Not relavant for Solana.
NodeIsSyncingEnabled = false # Default
# LeaseDuration is the max duration a node can be leased for.
LeaseDuration = '1m0s' # Default
# FinalizedBlockPollInterval is the rate to poll for the finalized block.
FinalizedBlockPollInterval = '10s' # Default
# EnforceRepeatableRead enforces the repeatable read guarantee for multinode.
EnforceRepeatableRead = true # Default
# DeathDeclarationDelay is the duration to wait before declaring a node dead.
DeathDeclarationDelay = '10s' # Default
# NodeNoNewHeadsThreshold is the duration to wait before declaring a node unhealthy due to no new heads.
NodeNoNewHeadsThreshold = '10s' # Default
# NoNewFinalizedHeadsThreshold is the duration to wait before declaring a node unhealthy due to no new finalized heads.
NoNewFinalizedHeadsThreshold = '10s' # Default
# FinalityDepth is not used when finality tags are enabled.
FinalityDepth = 0 # Default
# FinalityTagEnabled enables the use of finality tags.
FinalityTagEnabled = true # Default
# FinalizedBlockOffset is the offset from the finalized block to use for finality tags.
FinalizedBlockOffset = 0 # Default

[[Solana.Nodes]]
# Name is a unique (per-chain) identifier for this node.
Name = 'primary' # Example
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241004161234-3f52bbcae72c // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae // indirect
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-4339141
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2/go.mod h1:rNhNSrrRMvkgAm5SA6bNTdh2340bTQQZdUVNtZ2o2bk=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f h1:p4p3jBT91EQyLuAMvHD+zNJsuAYI/QjJbzuGUJ7wIgg=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f/go.mod h1:FLlWBt2hwiMVgt9AcSo6wBJYIRd/nsc8ENbV1Wir1bw=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff h1:piMugtrRlbVdcC6xZF37me686eS1YwpLQ0kN2v2b9YE=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20240927143737-7e527aa85bff/go.mod h1:5jD47oCERRQ4eGi0iNdk9ZV5HMEdolfQwHpUX1+Ix4s=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241004161234-3f52bbcae72c h1:9JU37oQZd/IYyozhzz5MjYFKzLe6K2LrTyI51N6kMPo=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241004161234-3f52bbcae72c/go.mod h1:7v0DnxHb6UQUSHTcLcs2juJcyOjHQV+5oJc3jobqqM0=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae h1:d+B8y2Nd/PrnPMNoaSPn3eDgUgxcVcIqAxGrvYu/gGw=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240911194142-506bc469d8ae/go.mod h1:ec/a20UZ7YRK4oxJcnTBFzp1+DBcJcwqEaerUMsktMs=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
Expand Down
78 changes: 78 additions & 0 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ var (
//go:embed testdata/config-multi-chain.toml
multiChainTOML string

second = *commoncfg.MustNewDuration(time.Second)
minute = *commoncfg.MustNewDuration(time.Minute)
selectionMode = client.NodeSelectionModeHighestHead

multiChain = Config{
Core: toml.Core{
RootDir: ptr("my/root/dir"),
Expand Down Expand Up @@ -167,6 +171,25 @@ var (
Chain: solcfg.Chain{
MaxRetries: ptr[int64](12),
},
MultiNode: solcfg.MultiNodeConfig{
MultiNode: solcfg.MultiNode{
Enabled: ptr(false),
PollFailureThreshold: ptr[uint32](5),
PollInterval: &second,
SelectionMode: &selectionMode,
SyncThreshold: ptr[uint32](5),
NodeIsSyncingEnabled: ptr(false),
LeaseDuration: &minute,
FinalizedBlockPollInterval: &second,
EnforceRepeatableRead: ptr(true),
DeathDeclarationDelay: &minute,
NodeNoNewHeadsThreshold: &minute,
NoNewFinalizedHeadsThreshold: &minute,
FinalityDepth: ptr[uint32](0),
FinalityTagEnabled: ptr(true),
FinalizedBlockOffset: ptr[uint32](0),
},
},
Nodes: []*solcfg.Node{
{Name: ptr("primary"), URL: commoncfg.MustParseURL("http://mainnet.solana.com")},
},
Expand All @@ -176,6 +199,25 @@ var (
Chain: solcfg.Chain{
OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute),
},
MultiNode: solcfg.MultiNodeConfig{
MultiNode: solcfg.MultiNode{
Enabled: ptr(false),
PollFailureThreshold: ptr[uint32](5),
PollInterval: &second,
SelectionMode: &selectionMode,
SyncThreshold: ptr[uint32](5),
NodeIsSyncingEnabled: ptr(false),
LeaseDuration: &minute,
FinalizedBlockPollInterval: &second,
EnforceRepeatableRead: ptr(true),
DeathDeclarationDelay: &minute,
NodeNoNewHeadsThreshold: &minute,
NoNewFinalizedHeadsThreshold: &minute,
FinalityDepth: ptr[uint32](0),
FinalityTagEnabled: ptr(true),
FinalizedBlockOffset: ptr[uint32](0),
},
},
Nodes: []*solcfg.Node{
{Name: ptr("secondary"), URL: commoncfg.MustParseURL("http://testnet.solana.com")},
},
Expand Down Expand Up @@ -712,6 +754,25 @@ func TestConfig_Marshal(t *testing.T) {
BlockHistoryPollPeriod: commoncfg.MustNewDuration(time.Minute),
ComputeUnitLimitDefault: ptr[uint32](100_000),
},
MultiNode: solcfg.MultiNodeConfig{
MultiNode: solcfg.MultiNode{
Enabled: ptr(false),
PollFailureThreshold: ptr[uint32](5),
PollInterval: &second,
SelectionMode: &selectionMode,
SyncThreshold: ptr[uint32](5),
NodeIsSyncingEnabled: ptr(false),
LeaseDuration: &minute,
FinalizedBlockPollInterval: &second,
EnforceRepeatableRead: ptr(true),
DeathDeclarationDelay: &minute,
NodeNoNewHeadsThreshold: &minute,
NoNewFinalizedHeadsThreshold: &minute,
FinalityDepth: ptr[uint32](0),
FinalityTagEnabled: ptr(true),
FinalizedBlockOffset: ptr[uint32](0),
},
},
Nodes: []*solcfg.Node{
{Name: ptr("primary"), URL: commoncfg.MustParseURL("http://solana.web")},
{Name: ptr("foo"), URL: commoncfg.MustParseURL("http://solana.foo"), SendOnly: true},
Expand Down Expand Up @@ -1218,6 +1279,23 @@ FeeBumpPeriod = '1m0s'
BlockHistoryPollPeriod = '1m0s'
ComputeUnitLimitDefault = 100000
[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0
[[Solana.Nodes]]
Name = 'primary'
URL = 'http://solana.web'
Expand Down
17 changes: 17 additions & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,23 @@ FeeBumpPeriod = '1m0s'
BlockHistoryPollPeriod = '1m0s'
ComputeUnitLimitDefault = 100000

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'primary'
URL = 'http://solana.web'
Expand Down
34 changes: 34 additions & 0 deletions core/services/chainlink/testdata/config-multi-chain-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,23 @@ FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'primary'
URL = 'http://mainnet.solana.com'
Expand All @@ -687,6 +704,23 @@ FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'secondary'
URL = 'http://testnet.solana.com'
Expand Down
34 changes: 34 additions & 0 deletions core/services/chainlink/testdata/config-multi-chain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ TendermintURL = 'http://bombay.cosmos.com'
ChainID = 'mainnet'
MaxRetries = 12

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'primary'
URL = 'http://mainnet.solana.com'
Expand All @@ -99,6 +116,23 @@ SendOnly = false
ChainID = 'testnet'
OCR2CachePollPeriod = '1m0s'

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'secondary'
URL = 'http://testnet.solana.com'
Expand Down
17 changes: 17 additions & 0 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,23 @@ FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'primary'
URL = 'http://solana.web'
Expand Down
34 changes: 34 additions & 0 deletions core/web/resolver/testdata/config-multi-chain-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,23 @@ FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'primary'
URL = 'http://mainnet.solana.com'
Expand All @@ -687,6 +704,23 @@ FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000

[Solana.MultiNode]
Enabled = false
PollFailureThreshold = 5
PollInterval = '1s'
SelectionMode = 'HighestHead'
SyncThreshold = 5
NodeIsSyncingEnabled = false
LeaseDuration = '1m0s'
FinalizedBlockPollInterval = '1s'
EnforceRepeatableRead = true
DeathDeclarationDelay = '1m0s'
NodeNoNewHeadsThreshold = '1m0s'
NoNewFinalizedHeadsThreshold = '1m0s'
FinalityDepth = 0
FinalityTagEnabled = true
FinalizedBlockOffset = 0

[[Solana.Nodes]]
Name = 'secondary'
URL = 'http://testnet.solana.com'
Expand Down
Loading

0 comments on commit 1b41e69

Please sign in to comment.