Skip to content

Commit

Permalink
fix waitingforreceipt error (#7098)
Browse files Browse the repository at this point in the history
* fix waitingforreceipt error

* update cach

* remove comment

* throw other errors

* update changelog and text

* update linter
  • Loading branch information
Alex authored Jun 25, 2024
1 parent 8b11192 commit 4c36f55
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 5 additions & 1 deletion packages/web3-eth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,8 @@ Documentation:
- WebEth has `setTransactionMiddleware` and `getTransactionMiddleware` for automatically passing to `sentTransaction` (#7088)
- `TransactionMiddleware` and `TransactionMiddleware` data types are exported (#7088)

## [Unreleased]
## [Unreleased]

### Fixed

- Fixed geth issue when running a new instance, transactions will index when there are no blocks created (#7098)
21 changes: 16 additions & 5 deletions packages/web3-eth/src/rpc_method_wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,22 @@ export async function getTransactionReceipt<ReturnFormat extends DataFormat>(
transactionHash,
DEFAULT_RETURN_FORMAT,
);
const response = await ethRpcMethods.getTransactionReceipt(
web3Context.requestManager,
transactionHashFormatted,
);

let response;
try {
response = await ethRpcMethods.getTransactionReceipt(
web3Context.requestManager,
transactionHashFormatted,
);
} catch (error) {
// geth indexing error, we poll until transactions stopped indexing
if (typeof error === 'object' && !isNullish(error) && 'message' in error && (error as { message: string }).message === 'transaction indexing is in progress') {
console.warn('Transaction indexing is in progress.')
} else {
throw error;
}

}

return isNullish(response)
? response
: (format(
Expand Down

1 comment on commit 4c36f55

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 4c36f55 Previous: 8b11192 Ratio
processingTx 8908 ops/sec (±3.80%) 8995 ops/sec (±3.98%) 1.01
processingContractDeploy 37581 ops/sec (±7.58%) 36613 ops/sec (±7.87%) 0.97
processingContractMethodSend 14717 ops/sec (±8.65%) 15517 ops/sec (±7.51%) 1.05
processingContractMethodCall 26349 ops/sec (±6.87%) 26346 ops/sec (±8.33%) 1.00
abiEncode 40728 ops/sec (±6.86%) 43217 ops/sec (±6.80%) 1.06
abiDecode 28489 ops/sec (±8.32%) 29753 ops/sec (±7.55%) 1.04
sign 1521 ops/sec (±3.51%) 1507 ops/sec (±0.68%) 0.99
verify 362 ops/sec (±1.09%) 364 ops/sec (±0.46%) 1.01

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.