Skip to content

Commit

Permalink
Added compute unit limit estimation to Solana TXM
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-momin committed Oct 11, 2024
1 parent 87c7a4e commit d104df2
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 1 deletion.
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
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: 2 additions & 0 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ func TestConfig_Marshal(t *testing.T) {
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
2 changes: 2 additions & 0 deletions core/web/resolver/testdata/config-multi-chain-effective.toml
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 @@ -9958,6 +9958,7 @@ ComputeUnitPriceDefault = 0 # Default
FeeBumpPeriod = '3s' # Default
BlockHistoryPollPeriod = '5s' # Default
ComputeUnitLimitDefault = 200_000 # Default
EstimateComputeUnitLimit = false # Default
```


Expand Down Expand Up @@ -10076,6 +10077,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 @@ -80,7 +80,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.5.1
github.com/smartcontractkit/chainlink-data-streams v0.1.0
github.com/smartcontractkit/chainlink-feeds v0.1.1
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241010140936-4e1d0ae8315a
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241011160257-b387468e20e6
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.0
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +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-solana v1.1.1-0.20241010140936-4e1d0ae8315a h1:WdteRQ8p+4m9VPA5ibwheQBeBd1ndy1YlE6y0K/qeVE=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241010140936-4e1d0ae8315a/go.mod h1:XDrfLscHNHXIrB8MJVEYRcCVxxxO4BflcS+S6rlcgU4=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241011160257-b387468e20e6 h1:mA9p0VDJpuEQcZezk8uFDsslwF/vDcWcm7G73K03/8M=
github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241011160257-b387468e20e6/go.mod h1:XDrfLscHNHXIrB8MJVEYRcCVxxxO4BflcS+S6rlcgU4=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.0 h1:C00zDQ6AQdR9JFrHnOBEhC2TlYVzVSsC7k5AZ7hXwHI=
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.0/go.mod h1:K6cKpFDW2hX4D4F5aq86l13AMJ3jyEz/AjZyGjYlS90=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
Expand Down

0 comments on commit d104df2

Please sign in to comment.