Skip to content

Commit

Permalink
internal: adjust awaiting timeout for setup transactions
Browse files Browse the repository at this point in the history
Fix the following error on short-blocks setup:
```
2024-04-23 12:54:47 2024/04/23 10:54:47 Used [go-node:20331] rpc addresses
2024-04-23 12:54:47 2024/04/23 10:54:47 Run benchmark for Go4x1_Block_100 :: NEO-GO
2024-04-23 12:54:57 2024/04/23 10:54:57 Read 3000000 txs from /dump.txs
2024-04-23 12:55:06 2024/04/23 10:55:06 CPU: 4.959%, Mem: 243.746MB
2024-04-23 12:55:13 2024/04/23 10:55:13 Done 16.094694633s
2024-04-23 12:55:13 2024/04/23 10:55:13 Init 10 workers / 5m0s time limit (3000000 txs will try to send)
2024-04-23 12:55:13 2024/04/23 10:55:13 Prepare chain for benchmark
2024-04-23 12:55:13 2024/04/23 10:55:13 Determined validators count: 4
2024-04-23 12:55:13 2024/04/23 10:55:13 Sending NEO and GAS transfer tx
2024-04-23 12:55:13 2024/04/23 10:55:13 could not create blocks: timeout while waiting for prepare tx to persist
```

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Apr 25, 2024
1 parent 7c95068 commit 17c8317
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/internal/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,18 @@ func newNEP5Transfer(validatorCount int, sc util.Uint160, from, to util.Uint160,
}

func fillChain(ctx context.Context, c *rpcclient.Client, proto result.Protocol, sgn *signer, vote bool, opts BenchOptions) error {
// minAwaitThreshold is the minimum required threshold for setup transactions to be awaited.
var minAwaitThreshold = 3 * time.Second

cs, err := c.GetNativeContracts()
if err != nil {
return err
}

timeout := 3 * time.Duration(proto.MillisecondsPerBlock) * time.Millisecond
if timeout < minAwaitThreshold {
timeout = minAwaitThreshold
}

var neoHash, gasHash, mgmtHash util.Uint160
for i := range cs {
Expand Down

0 comments on commit 17c8317

Please sign in to comment.