Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chunks): process partial encoded chunk properly handles missing blocks #3033

Merged

Conversation

birchmd
Copy link
Contributor

@birchmd birchmd commented Jul 24, 2020

The signature check for partial encoded chunks looks up the epoch id using the referenced block hash, however if this block is not known by the node then the check will fail, causing the processing of the chunk to return an error. However, the desired behaviour is to signal that a block is missing so that this chunk can be re-tried in the future. This fixes the issue, properly handling the potential error from the signature check and returning NeedBlock appropriately.

Note: The majority of the code is for the testing, the fix itself is quite small (see the second commit)

Testing Plan:

  • New unit test for this case

@gitpod-io
Copy link

gitpod-io bot commented Jul 24, 2020

panic!("I can't make that many validators!");
}

let letters = (b'A'..=b'Z')
Copy link
Collaborator

Choose a reason for hiding this comment

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

capital letters are not allowed in account ids. We don't check it here but it's better to be consistent.

@nearprotocol-bulldozer nearprotocol-bulldozer bot merged commit 73c7f00 into near:master Jul 24, 2020
@birchmd birchmd deleted the fix-chunks-handle-missing-block-2 branch July 24, 2020 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants