Skip to content

Commit 238061d

Browse files
authored
PLEX-250 - WriteReport initial implementation (#111)
* PLEX-250 - WriteReport initial implementation * reverting keystone forwarder change * fixing compilation issue * fixing test cases and docs * adding PR feedback updating go mods * updating old variables to confirmationTimeout updaing docs fix * updating depedency * updating go mod * updating go mod * updating go mods * updating go mods
1 parent 153411b commit 238061d

File tree

20 files changed

+2116
-13
lines changed

20 files changed

+2116
-13
lines changed

CONFIG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ Set to zero to disable.
270270
## Transactions
271271
```toml
272272
[Transactions]
273+
ConfirmationTimeout = '60s' # Default
273274
Enabled = true # Default
274275
ForwardersEnabled = false # Default
275276
MaxInFlight = 16 # Default
@@ -280,6 +281,12 @@ ResendAfterThreshold = '1m' # Default
280281
```
281282

282283

284+
### ConfirmationTimeout
285+
```toml
286+
ConfirmationTimeout = '60s' # Default
287+
```
288+
ConfirmationTimeout time to wait for a TX to get into a block in the blockchain. This is used for the EVMService.SubmitTransaction operation.
289+
283290
### Enabled
284291
```toml
285292
Enabled = true # Default
@@ -1233,6 +1240,9 @@ GasLimit controls the gas limit for transmit transactions from ocr2automation jo
12331240
FromAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
12341241
ForwarderAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
12351242
GasLimitDefault = 400_000 # Default
1243+
TxAcceptanceState = 2 # Default
1244+
PollPeriod = '2s' # Default
1245+
AcceptanceTimeout = '30s' # Default
12361246
```
12371247

12381248

@@ -1254,3 +1264,21 @@ GasLimitDefault = 400_000 # Default
12541264
```
12551265
GasLimitDefault is the default gas limit for workflow transactions.
12561266

1267+
### TxAcceptanceState
1268+
```toml
1269+
TxAcceptanceState = 2 # Default
1270+
```
1271+
TxAcceptanceState is the default acceptance state for writer DON tranmissions.
1272+
1273+
### PollPeriod
1274+
```toml
1275+
PollPeriod = '2s' # Default
1276+
```
1277+
PollPeriod is the default poll period for checking transmission state
1278+
1279+
### AcceptanceTimeout
1280+
```toml
1281+
AcceptanceTimeout = '30s' # Default
1282+
```
1283+
AcceptanceTimeout is the default timeout for a tranmission to be accepted on chain
1284+

gethwrappers/zksync/go_generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ package gethwrappers
88
//go:generate go run ../generation/zksync/wrap.go shared WETH9ZKSync weth9_zksync
99
//go:generate go run ../generation/zksync/wrap.go shared MockV3Aggregator mock_v3_aggregator_contract
1010

11-
//go:generate go run ../generation/zksync/wrap.go automation MockETHUSDAggregator mock_ethusd_aggregator_wrapper
11+
//go:generate go run ../generation/zksync/wrap.go automation MockETHUSDAggregator mock_ethusd_aggregator_wrapper

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ require (
2121
github.com/prometheus/client_model v0.6.1
2222
github.com/prometheus/common v0.63.0
2323
github.com/shopspring/decimal v1.4.0
24-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250618162808-a5a42ee8701b
24+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250627002929-2cbb7418aaa5
2525
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250618164021-9b34289a9502
26-
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250616180023-87b70c08d7c0
26+
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250627121608-e7b52913fae2
2727
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250618135814-7e3f79ab707e
2828
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250522110034-65c54665034a
2929
github.com/smartcontractkit/chainlink-protos/svr v1.1.0
@@ -92,7 +92,7 @@ require (
9292
github.com/go-playground/locales v0.14.1 // indirect
9393
github.com/go-playground/universal-translator v0.18.1 // indirect
9494
github.com/go-playground/validator/v10 v10.25.0 // indirect
95-
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
95+
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
9696
github.com/goccy/go-json v0.10.5 // indirect
9797
github.com/gofrs/flock v0.8.1 // indirect
9898
github.com/gogo/protobuf v1.3.2 // indirect
@@ -155,6 +155,7 @@ require (
155155
github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect
156156
github.com/scylladb/go-reflectx v1.0.1 // indirect
157157
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
158+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d // indirect
158159
github.com/smartcontractkit/freeport v0.1.1 // indirect
159160
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
160161
github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect

go.sum

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8Wd
231231
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
232232
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
233233
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
234-
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
235-
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
234+
github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk=
235+
github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
236236
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
237237
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
238238
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -636,12 +636,14 @@ github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJV
636636
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
637637
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
638638
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
639-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250618162808-a5a42ee8701b h1:nS5njF5W9lY1LnTITt3V2M35dT19JPpuVg6//vlzFiU=
640-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250618162808-a5a42ee8701b/go.mod h1:1ntZ0rtQpPx6h+xlcOJp0ccqHFaxTzW2Z62FJG358q0=
639+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250627002929-2cbb7418aaa5 h1:ZadFXdmkBFJz3GYPAF20IvtNSHbcRFoLrhCU/LKS9oQ=
640+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250627002929-2cbb7418aaa5/go.mod h1:mRKPMPyJhg1RBjxtRTL2gHvRhTcZ+nk2Upu/u97Y16M=
641+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d h1:86gp4tIXRb6ccSrjcm4gV8iA5wJN6er3rJY9f2UxRLU=
642+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d/go.mod h1:QUEPHdSkH19Or+E1iMGG+rDQ6jpCTIbm//9Osa6MXDE=
641643
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250618164021-9b34289a9502 h1:WLgEB8/lIfA1vI+7O4RE/PYitO57TRkKUqVllDIgJD4=
642644
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250618164021-9b34289a9502/go.mod h1:Kb8f+wt2YmBdD0PfbsC9bDhdUG/Y8sqUkzAvC2Dn8/M=
643-
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250616180023-87b70c08d7c0 h1:OpFlG2f+LXsDp3cejSQju2rmoNsxBlhgrwXMIsk72IA=
644-
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250616180023-87b70c08d7c0/go.mod h1:X+a4k2a+2G2/yeAaRQMCTLmlhNdQYAeN6v+ZpLzRZww=
645+
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250627121608-e7b52913fae2 h1:WRwVcv2IW59subaJDNl6B+N4OkZiAO7U2e9001XSw7c=
646+
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250627121608-e7b52913fae2/go.mod h1:+pRGfDej1r7cHMs1dYmuyPuOZzYB9Q+PKu0FvZOYlmw=
645647
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250618135814-7e3f79ab707e h1:LRT+PltY99+hxZAJn+4nyTfqGVNEM1S6FJ675B9BtJo=
646648
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20250618135814-7e3f79ab707e/go.mod h1:jo+cUqNcHwN8IF7SInQNXDZ8qzBsyMpnLdYbDswviFc=
647649
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250522110034-65c54665034a h1:O28vgyHM7QF1YLg1BwkQSIbOYA+t0RiH9+b+k90GPG8=

pkg/.mockery.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ packages:
2121
interfaces:
2222
GasEstimator:
2323
ChainScopedConfig:
24+
EVM:
25+
Workflow:
2426
github.com/smartcontractkit/chainlink-evm/pkg/gas:
2527
interfaces:
2628
Config:

pkg/chains/legacyevm/evm_txm.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package legacyevm
22

33
import (
44
"fmt"
5+
"time"
56

67
"github.com/smartcontractkit/chainlink-common/pkg/logger"
78
"github.com/smartcontractkit/chainlink-common/pkg/sqlutil"
@@ -40,6 +41,11 @@ func newEvmTxm(
4041
"limitDefault", cfg.GasEstimator().LimitDefault(),
4142
)
4243

44+
err = validateConfirmationTimeout(cfg)
45+
if err != nil {
46+
return nil, err
47+
}
48+
4349
if opts.GenTxManager == nil {
4450
var txmv2 txmgr.TxManager
4551
if cfg.Transactions().TransactionManagerV2().Enabled() {
@@ -80,6 +86,15 @@ func newEvmTxm(
8086
return
8187
}
8288

89+
const maximumConfirmationTimeout = time.Second * 600
90+
91+
func validateConfirmationTimeout(cfg evmconfig.EVM) error {
92+
if cfg.ConfirmationTimeout() > maximumConfirmationTimeout {
93+
return fmt.Errorf("ConfirmationTimeout cannot be greater than 10 minutes, got %s", cfg.ConfirmationTimeout())
94+
}
95+
return nil
96+
}
97+
8398
func newGasEstimator(
8499
cfg evmconfig.EVM,
85100
client evmclient.Client,

pkg/client/config_builder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func NewClientConfigs(
4444
noNewFinalizedHeadsThreshold time.Duration,
4545
finalizedBlockPollInterval time.Duration,
4646
newHeadsPollInterval time.Duration,
47+
confirmationTimeout time.Duration,
4748
) (multinode.ChainConfig, evmconfig.NodePool, []*toml.Node, error) {
4849
nodes, err := parseNodeConfigs(nodeCfgs)
4950
if err != nil {

pkg/client/config_builder_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestClientConfigBuilder(t *testing.T) {
2727
enforceRepeatableRead := ptr(true)
2828
deathDeclarationDelay := time.Second * 3
2929
noNewFinalizedBlocksThreshold := time.Second
30+
confirmationTimeout := time.Second * 60
3031
nodeConfigs := []client.NodeConfig{
3132
{
3233
Name: ptr("foo"),
@@ -41,7 +42,7 @@ func TestClientConfigBuilder(t *testing.T) {
4142
chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs,
4243
pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth,
4344
finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold,
44-
pollInterval, newHeadsPollInterval)
45+
pollInterval, newHeadsPollInterval, confirmationTimeout)
4546
require.NoError(t, err)
4647

4748
// Validate node pool configs

pkg/client/evm_client_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func TestNewEvmClient(t *testing.T) {
3939
noNewFinalizedBlocksThreshold := time.Second * 5
4040
finalizedBlockPollInterval := time.Second * 4
4141
newHeadsPollInterval := time.Second * 4
42+
confirmationTimeout := time.Second * 60
4243
nodeConfigs := []client.NodeConfig{
4344
{
4445
Name: ptr("foo"),
@@ -51,7 +52,7 @@ func TestNewEvmClient(t *testing.T) {
5152
chainCfg, nodePool, nodes, err := client.NewClientConfigs(selectionMode, leaseDuration, chainTypeStr, nodeConfigs,
5253
pollFailureThreshold, pollInterval, syncThreshold, nodeIsSyncingEnabled, noNewHeadsThreshold, finalityDepth,
5354
finalityTagEnabled, finalizedBlockOffset, enforceRepeatableRead, deathDeclarationDelay, noNewFinalizedBlocksThreshold,
54-
finalizedBlockPollInterval, newHeadsPollInterval)
55+
finalizedBlockPollInterval, newHeadsPollInterval, confirmationTimeout)
5556
require.NoError(t, err)
5657

5758
client, err := client.NewEvmClient(nodePool, chainCfg, nil, logger.Test(t), testutils.FixtureChainID, nodes, chaintype.ChainType(chainTypeStr))
@@ -77,7 +78,7 @@ func TestChainClientMetrics(t *testing.T) {
7778
}
7879
chainCfg, nodePool, nodes, err := client.NewClientConfigs(ptr("HighestHead"), time.Duration(0), "", nodeConfigs,
7980
ptr[uint32](5), 10*time.Second, ptr[uint32](5), ptr(false), time.Minute, ptr[uint32](5), ptr(false),
80-
ptr[uint32](5), ptr(false), 10*time.Second, 10*time.Second, 10*time.Second, 10*time.Second)
81+
ptr[uint32](5), ptr(false), 10*time.Second, 10*time.Second, 10*time.Second, 10*time.Second, 60*time.Second)
8182
require.NoError(t, err)
8283

8384
chainID := big.NewInt(68472)

pkg/config/chain_scoped.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ type EVMConfig struct {
3535
C *toml.EVMConfig
3636
}
3737

38+
func (e *EVMConfig) ConfirmationTimeout() time.Duration {
39+
return e.C.ConfirmationTimeout()
40+
}
41+
3842
func (e *EVMConfig) IsEnabled() bool {
3943
return e.C.IsEnabled()
4044
}

0 commit comments

Comments
 (0)