Skip to content

Commit

Permalink
Merge branch 'txmv2' into txmv2_enablement
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Nov 27, 2024
2 parents 15ff37a + 78e0690 commit 2c551f6
Show file tree
Hide file tree
Showing 15 changed files with 125 additions and 37 deletions.
16 changes: 8 additions & 8 deletions core/config/docs/chains-evm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ LogBroadcasterEnabled = true # Default
# Set to zero to disable.
NoNewFinalizedHeadsThreshold = '0' # Default

[EVM.TxmV2]
# Enabled enables TxmV2.
Enabled = false # Default
# BlockTime controls the frequency of the backfill loop of TxmV2.
BlockTime = '10s' # Example
# CustomURL configures the base url of a custom endpoint used by the ChainDualBroadcast chain type.
CustomURL = 'https://example.api.io' # Example

[EVM.Transactions]
# ForwardersEnabled enables or disables sending transactions through forwarder contracts.
ForwardersEnabled = false # Default
Expand All @@ -129,14 +137,6 @@ ReaperThreshold = '168h' # Default
# ResendAfterThreshold controls how long to wait before re-broadcasting a transaction that has not yet been confirmed.
ResendAfterThreshold = '1m' # Default

[EVM.TxmV2]
# Enabled enables TxmV2.
Enabled = false # Default
# BlockTime controls the frequency of the backfill loop of TxmV2.
BlockTime = '10s' # Example
# CustomURL configures the base url of a custom endpoint used by the ChainDualBroadcast chain type.
CustomURL = 'https://example.api.io' # Example

[EVM.Transactions.AutoPurge]
# Enabled enables or disables automatically purging transactions that have been idenitified as terminally stuck (will never be included on-chain). This feature is only expected to be used by ZK chains.
Enabled = false # Default
Expand Down
4 changes: 4 additions & 0 deletions core/config/docs/docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func TestDoc(t *testing.T) {
docDefaults.Workflow.GasLimitDefault = &gasLimitDefault
docDefaults.NodePool.Errors = evmcfg.ClientErrors{}

// TxmV2 configs are only set if the feature is enabled
docDefaults.TxmV2.BlockTime = nil
docDefaults.TxmV2.CustomURL = nil

// Transactions.AutoPurge configs are only set if the feature is enabled
docDefaults.Transactions.AutoPurge.DetectionApiUrl = nil
docDefaults.Transactions.AutoPurge.Threshold = nil
Expand Down
16 changes: 14 additions & 2 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@ func TestConfig_Marshal(t *testing.T) {
RPCBlockQueryDelay: ptr[uint16](10),
NoNewFinalizedHeadsThreshold: &hour,

TxmV2: evmcfg.TxmV2{
Enabled: ptr(false),
},
Transactions: evmcfg.Transactions{
MaxInFlight: ptr[uint32](19),
MaxQueued: ptr[uint32](99),
Expand Down Expand Up @@ -1117,6 +1120,9 @@ RPCBlockQueryDelay = 10
FinalizedBlockOffset = 16
NoNewFinalizedHeadsThreshold = '1h0m0s'
[EVM.TxmV2]
Enabled = false
[EVM.Transactions]
ForwardersEnabled = true
MaxInFlight = 19
Expand Down Expand Up @@ -1402,6 +1408,12 @@ func TestConfig_full(t *testing.T) {
got.EVM[c].Nodes[n].Order = ptr(int32(100))
}
}
if got.EVM[c].TxmV2.BlockTime == nil {
got.EVM[c].TxmV2.BlockTime = new(commoncfg.Duration)
}
if got.EVM[c].TxmV2.CustomURL == nil {
got.EVM[c].TxmV2.CustomURL = new(commoncfg.URL)
}
if got.EVM[c].Transactions.AutoPurge.Threshold == nil {
got.EVM[c].Transactions.AutoPurge.Threshold = ptr(uint32(0))
}
Expand Down Expand Up @@ -1468,7 +1480,7 @@ func TestConfig_Validate(t *testing.T) {
- 1: 10 errors:
- ChainType: invalid value (Foo): must not be set with this chain id
- Nodes: missing: must have at least one node
- ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit or omitted
- ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit, dualBroadcast or omitted
- HeadTracker.HistoryDepth: invalid value (30): must be greater than or equal to FinalizedBlockOffset
- GasEstimator.BumpThreshold: invalid value (0): cannot be 0 if auto-purge feature is enabled for Foo
- Transactions.AutoPurge.Threshold: missing: needs to be set if auto-purge feature is enabled for Foo
Expand All @@ -1481,7 +1493,7 @@ func TestConfig_Validate(t *testing.T) {
- 2: 5 errors:
- ChainType: invalid value (Arbitrum): only "optimismBedrock" can be used with this chain id
- Nodes: missing: must have at least one node
- ChainType: invalid value (Arbitrum): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit or omitted
- ChainType: invalid value (Arbitrum): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit, dualBroadcast or omitted
- FinalityDepth: invalid value (0): must be greater than or equal to 1
- MinIncomingConfirmations: invalid value (0): must be greater than or equal to 1
- 3: 3 errors:
Expand Down
3 changes: 3 additions & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ RPCBlockQueryDelay = 10
FinalizedBlockOffset = 16
NoNewFinalizedHeadsThreshold = '1h0m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = true
MaxInFlight = 19
Expand Down
6 changes: 6 additions & 0 deletions core/services/chainlink/testdata/config-invalid.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ ChainType = 'Foo'
FinalityDepth = 32
FinalizedBlockOffset = 64

[EVM.TxmV2]
Enabled = true

[EVM.Transactions.AutoPurge]
Enabled = true

Expand Down Expand Up @@ -108,6 +111,9 @@ WSURL = 'ws://dupe.com'
ChainID = '534352'
ChainType = 'scroll'

[EVM.TxmV2]
Enabled = true

[EVM.Transactions.AutoPurge]
Enabled = true
DetectionApiUrl = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 12
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -429,6 +432,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -533,6 +539,9 @@ RPCBlockQueryDelay = 10
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '6m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
3 changes: 3 additions & 0 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ RPCBlockQueryDelay = 10
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '15m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = true
MaxInFlight = 19
Expand Down
9 changes: 9 additions & 0 deletions core/web/resolver/testdata/config-multi-chain-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -429,6 +432,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -533,6 +539,9 @@ RPCBlockQueryDelay = 10
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '6m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
78 changes: 51 additions & 27 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3859,6 +3859,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1h10m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -4841,6 +4844,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1h30m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -5591,6 +5597,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1h10m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -5699,6 +5708,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '45m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -6351,6 +6363,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1h30m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -8201,6 +8216,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1h50m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -8521,6 +8539,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '5m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -9403,6 +9424,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '1h50m0s'

[TxmV2]
Enabled = false

[Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down Expand Up @@ -10122,6 +10146,33 @@ out-of-sync. Only applicable if `FinalityTagEnabled=true`

Set to zero to disable.

## EVM.TxmV2
```toml
[EVM.TxmV2]
Enabled = false # Default
BlockTime = '10s' # Example
CustomURL = 'https://example.api.io' # Example
```


### Enabled
```toml
Enabled = false # Default
```
Enabled enables TxmV2.

### BlockTime
```toml
BlockTime = '10s' # Example
```
BlockTime controls the frequency of the backfill loop of TxmV2.

### CustomURL
```toml
CustomURL = 'https://example.api.io' # Example
```
CustomURL configures the base url of a custom endpoint used by the ChainDualBroadcast chain type.

## EVM.Transactions
```toml
[EVM.Transactions]
Expand Down Expand Up @@ -10180,33 +10231,6 @@ ResendAfterThreshold = '1m' # Default
```
ResendAfterThreshold controls how long to wait before re-broadcasting a transaction that has not yet been confirmed.

## EVM.TxmV2
```toml
[EVM.TxmV2]
Enabled = false # Default
BlockTime = '10s' # Example
CustomURL = 'https://example.api.io' # Example
```


### Enabled
```toml
Enabled = false # Default
```
Enabled enables TxmV2.

### BlockTime
```toml
BlockTime = '10s' # Example
```
BlockTime controls the frequency of the backfill loop of TxmV2.

### CustomURL
```toml
CustomURL = 'https://example.api.io' # Example
```
CustomURL configures the base url of a custom endpoint used by the ChainDualBroadcast chain type.

## EVM.Transactions.AutoPurge
```toml
[EVM.Transactions.AutoPurge]
Expand Down
3 changes: 3 additions & 0 deletions testdata/scripts/node/validate/defaults-override.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
3 changes: 3 additions & 0 deletions testdata/scripts/node/validate/disk-based-logging.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
3 changes: 3 additions & 0 deletions testdata/scripts/node/validate/invalid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down
3 changes: 3 additions & 0 deletions testdata/scripts/node/validate/valid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ RPCBlockQueryDelay = 1
FinalizedBlockOffset = 0
NoNewFinalizedHeadsThreshold = '9m0s'

[EVM.TxmV2]
Enabled = false

[EVM.Transactions]
ForwardersEnabled = false
MaxInFlight = 16
Expand Down

0 comments on commit 2c551f6

Please sign in to comment.