Lots of retries and transaction expired on NEAR localnet

Viewed 141

We created a test chain that runs locally on a computer, launches a chain with 4 validators (quite similar to localnet) and from there, we are deploying a smart contract testing various aspect of the chain (failed transactions, async receipts, args encoding, logs, and such stuff).

Everything can be run/seen here https://github.com/streamingfast/battlefield-near (it’s a bunch of scripts that facilitate running this network and the transactions).

When I deploy my contract, it always requires like 2 to 3 retries before getting the transaction to pass correctly. More than that, I would say in 33% of the cases, I reach the retry limit and get a Transaction Expired error.

This seems weird to me that such amount of retry is required to deploy a contract assuming that everything runs locally on my computer. When deploying the contract, it’s the only transaction going in, so there should be no congestion involved (there should be actually no traffic at all).

How the contract deployment can pass right away without retries and without never expiring the transaction?

1 Answers

It is possible that the network is too fast given that, as you mentioned, it is a one-node local network. This may cause the transaction to expire quickly, especially given that the default value for expiration on localnet is quite small I believe. Check for transaction_validity_period in your genesis.json and see if setting it to a large number helps.

Related