Etcm 139 incomplete data errors during fast sync#748
Merged
Conversation
mmrozek
approved these changes
Oct 27, 2020
| .getOrElse(Account.empty(blockchainConfig.accountStartNonce)) | ||
| ) | ||
| } | ||
| }.recover { case _: MissingNodeException => |
Contributor
There was a problem hiding this comment.
When we could get MissingNodeException?
Contributor
Author
There was a problem hiding this comment.
Mainly during fast-sync.
Contributor
Author
There was a problem hiding this comment.
It could happen during regular one if state node is lost along the way, but it's much less probable while during fast-sync it is sure that such error happens.
| private def withAccount[T](address: Address, blockParam: BlockParam)(f: Account => T): ServiceResponse[T] = | ||
| Future { | ||
| resolveBlock(blockParam).map { case ResolvedBlock(block, _) => | ||
| f( |
Contributor
There was a problem hiding this comment.
Minor: I would like to name this function toResponse or sth similar and reformat the code to
val account = blockchain
.getAccount(address, block.header.number)
.getOrElse(Account.empty(blockchainConfig.accountStartNonce))
toResponse(account)
it is a little bit more readable
3aff6e9 to
e8201e1
Compare
e8201e1 to
b3165d2
Compare
126018c to
ba8f975
Compare
…eing so unhelpful there
ba8f975 to
75c74ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Report custom eth error "100 missing data" when getting data from account
Proposed Solution
implementation of https://eth.wiki/json-rpc/json-rpc-error-codes-improvement-proposal (at least in account-touching methods)
Important Changes Introduced
Reorganized a bit json serialization. Due to nasty error I run into at some point (json4s and its formats <3) I wanted to plug Encoder-based serialization into rpc servers, due to multiple issues I stopped that and got into working state
Testing
Call methods like
eth_getBalanceduring fast-sync - it should return error with additional information that state node is missing