Workaround for missing implementation of 'pending' tag (#2178)

The transaction spammer from Kurtosis requests the nonce value of its
account based on 'pending' tag. As we lack that implementation, go with
the next best answer from the 'latest' tag. This does not include info
about transactions from the mempool that have not yet been executed.
This commit is contained in:
Etan Kissling 2024-05-13 16:42:28 +03:00 committed by GitHub
parent 56e478c701
commit 1b8f2b0ea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,11 @@ proc headerFromTag*(chain: CoreDbRef, blockId: BlockTag): BlockHeader
of "finalized": result = chain.finalizedHeader()
of "pending":
#TODO: Implement get pending block
raise newException(ValueError, "Pending tag not yet implemented")
# We currently fall back to `latest` so that the `tx-spammer` in
# `kurtosis-tech/ethereum-package` can make progress. A real
# implementation is still required that takes into account any
# pending transactions that have not yet been bundled into a block.
result = chain.getCanonicalHead()
else:
raise newException(ValueError, "Unsupported block tag " & tag)
else: