Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compute unit limit estimation to Solana TXM #14741

Merged
merged 7 commits into from
Oct 21, 2024
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
5 changes: 5 additions & 0 deletions .changeset/curly-baboons-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Added the compute unit limit estimation feature for the Solana TXM #added
1 change: 0 additions & 1 deletion core/chains/evm/config/toml/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,6 @@ func (t *HeadTracker) setFrom(f *HeadTracker) {
if v := f.PersistenceEnabled; v != nil {
t.PersistenceEnabled = v
}

}

func (t *HeadTracker) ValidateConfig() (err error) {
Expand Down
2 changes: 2 additions & 0 deletions core/config/docs/chains-solana.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ FeeBumpPeriod = '3s' # Default
BlockHistoryPollPeriod = '5s' # Default
# ComputeUnitLimitDefault is the compute units limit applied to transactions unless overriden during the txm enqueue
ComputeUnitLimitDefault = 200_000 # Default
# EstimateComputeUnitLimit enables or disables compute unit limit estimations per transaction. If estimations return 0 used compute, the ComputeUnitLimitDefault value is used, if set.
EstimateComputeUnitLimit = false # Default

[Solana.MultiNode]
# Enabled enables the multinode feature.
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ require (
github.com/smartcontractkit/chainlink-data-streams v0.1.0 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // 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 @@ -1084,8 +1084,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An
github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd h1:uF+MfvqZ7R3fVxln4lYdgTAeZwHoZKwsm3JXhZDU5RA=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd/go.mod h1:XDrfLscHNHXIrB8MJVEYRcCVxxxO4BflcS+S6rlcgU4=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 h1:R8F2tpyvN0peK0woG/Spx+IdukxlSSWDDLyFQNkLfUs=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042/go.mod h1:UndTf1YRDBt/4LDauMFou9+vt/M0q6o7u80a9J5Xu+0=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
Expand Down
36 changes: 19 additions & 17 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,23 +736,24 @@ func TestConfig_Marshal(t *testing.T) {
ChainID: ptr("mainnet"),
Enabled: ptr(false),
Chain: solcfg.Chain{
BalancePollPeriod: commoncfg.MustNewDuration(time.Minute),
ConfirmPollPeriod: commoncfg.MustNewDuration(time.Second),
OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute),
OCR2CacheTTL: commoncfg.MustNewDuration(time.Hour),
TxTimeout: commoncfg.MustNewDuration(time.Hour),
TxRetryTimeout: commoncfg.MustNewDuration(time.Minute),
TxConfirmTimeout: commoncfg.MustNewDuration(time.Second),
SkipPreflight: ptr(true),
Commitment: ptr("banana"),
MaxRetries: ptr[int64](7),
FeeEstimatorMode: ptr("fixed"),
ComputeUnitPriceMax: ptr[uint64](1000),
ComputeUnitPriceMin: ptr[uint64](10),
ComputeUnitPriceDefault: ptr[uint64](100),
FeeBumpPeriod: commoncfg.MustNewDuration(time.Minute),
BlockHistoryPollPeriod: commoncfg.MustNewDuration(time.Minute),
ComputeUnitLimitDefault: ptr[uint32](100_000),
BalancePollPeriod: commoncfg.MustNewDuration(time.Minute),
ConfirmPollPeriod: commoncfg.MustNewDuration(time.Second),
OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute),
OCR2CacheTTL: commoncfg.MustNewDuration(time.Hour),
TxTimeout: commoncfg.MustNewDuration(time.Hour),
TxRetryTimeout: commoncfg.MustNewDuration(time.Minute),
TxConfirmTimeout: commoncfg.MustNewDuration(time.Second),
SkipPreflight: ptr(true),
Commitment: ptr("banana"),
MaxRetries: ptr[int64](7),
FeeEstimatorMode: ptr("fixed"),
ComputeUnitPriceMax: ptr[uint64](1000),
ComputeUnitPriceMin: ptr[uint64](10),
ComputeUnitPriceDefault: ptr[uint64](100),
FeeBumpPeriod: commoncfg.MustNewDuration(time.Minute),
BlockHistoryPollPeriod: commoncfg.MustNewDuration(time.Minute),
ComputeUnitLimitDefault: ptr[uint32](100_000),
EstimateComputeUnitLimit: ptr(false),
},
MultiNode: solcfg.MultiNodeConfig{
MultiNode: solcfg.MultiNode{
Expand Down Expand Up @@ -1278,6 +1279,7 @@ ComputeUnitPriceDefault = 100
FeeBumpPeriod = '1m0s'
BlockHistoryPollPeriod = '1m0s'
ComputeUnitLimitDefault = 100000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ ComputeUnitPriceDefault = 100
FeeBumpPeriod = '1m0s'
BlockHistoryPollPeriod = '1m0s'
ComputeUnitLimitDefault = 100000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ ComputeUnitPriceDefault = 0
FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down Expand Up @@ -703,6 +704,7 @@ ComputeUnitPriceDefault = 0
FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down
1 change: 1 addition & 0 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ ComputeUnitPriceDefault = 0
FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ ComputeUnitPriceDefault = 0
FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down Expand Up @@ -703,6 +704,7 @@ ComputeUnitPriceDefault = 0
FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000
EstimateComputeUnitLimit = false

[Solana.MultiNode]
Enabled = false
Expand Down
1 change: 1 addition & 0 deletions core/web/solana_chains_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ComputeUnitPriceDefault = 0
FeeBumpPeriod = '3s'
BlockHistoryPollPeriod = '5s'
ComputeUnitLimitDefault = 200000
EstimateComputeUnitLimit = false
Nodes = []

[MultiNode]
Expand Down
7 changes: 7 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10086,6 +10086,7 @@ ComputeUnitPriceDefault = 0 # Default
FeeBumpPeriod = '3s' # Default
BlockHistoryPollPeriod = '5s' # Default
ComputeUnitLimitDefault = 200_000 # Default
EstimateComputeUnitLimit = false # Default
```


Expand Down Expand Up @@ -10204,6 +10205,12 @@ ComputeUnitLimitDefault = 200_000 # Default
```
ComputeUnitLimitDefault is the compute units limit applied to transactions unless overriden during the txm enqueue

### EstimateComputeUnitLimit
```toml
EstimateComputeUnitLimit = false # Default
```
EstimateComputeUnitLimit enables or disables compute unit limit estimations per transaction. If estimations return 0 used compute, the ComputeUnitLimitDefault value is used, if set.

## Solana.MultiNode
```toml
[Solana.MultiNode]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ require (
github.com/smartcontractkit/chainlink-data-streams v0.1.0
github.com/smartcontractkit/chainlink-feeds v0.1.1
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An
github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd h1:uF+MfvqZ7R3fVxln4lYdgTAeZwHoZKwsm3JXhZDU5RA=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd/go.mod h1:XDrfLscHNHXIrB8MJVEYRcCVxxxO4BflcS+S6rlcgU4=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 h1:R8F2tpyvN0peK0woG/Spx+IdukxlSSWDDLyFQNkLfUs=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042/go.mod h1:UndTf1YRDBt/4LDauMFou9+vt/M0q6o7u80a9J5Xu+0=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ require (
github.com/smartcontractkit/chainlink-data-streams v0.1.0 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1414,8 +1414,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An
github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd h1:uF+MfvqZ7R3fVxln4lYdgTAeZwHoZKwsm3JXhZDU5RA=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd/go.mod h1:XDrfLscHNHXIrB8MJVEYRcCVxxxO4BflcS+S6rlcgU4=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 h1:R8F2tpyvN0peK0woG/Spx+IdukxlSSWDDLyFQNkLfUs=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042/go.mod h1:UndTf1YRDBt/4LDauMFou9+vt/M0q6o7u80a9J5Xu+0=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o=
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 h1:mgjBQIEy+3V3G6K8e+6by3xndgsXdYYsdy+7kzQZwSk=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/load/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ require (
github.com/smartcontractkit/chainlink-data-streams v0.1.0 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd // indirect
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 // indirect
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An
github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd h1:uF+MfvqZ7R3fVxln4lYdgTAeZwHoZKwsm3JXhZDU5RA=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017134533-5459a1034ecd/go.mod h1:XDrfLscHNHXIrB8MJVEYRcCVxxxO4BflcS+S6rlcgU4=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042 h1:R8F2tpyvN0peK0woG/Spx+IdukxlSSWDDLyFQNkLfUs=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241017193838-6c937ac2d042/go.mod h1:UndTf1YRDBt/4LDauMFou9+vt/M0q6o7u80a9J5Xu+0=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o=
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0 h1:mgjBQIEy+3V3G6K8e+6by3xndgsXdYYsdy+7kzQZwSk=
Expand Down
Loading