Skip to content

Conversation

someone235
Copy link
Collaborator

@someone235 someone235 commented Feb 15, 2021

If someone sends you a pruned block you reject the block, but the header is still valid

@codecov
Copy link

codecov bot commented Feb 15, 2021

Codecov Report

Merging #1529 (98eea8c) into v0.9.0-dev (d835f72) will increase coverage by 0.01%.
The diff coverage is 30.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           v0.9.0-dev    #1529      +/-   ##
==============================================
+ Coverage       61.80%   61.82%   +0.01%     
==============================================
  Files             507      507              
  Lines           19238    19247       +9     
==============================================
+ Hits            11890    11899       +9     
- Misses           5642     5643       +1     
+ Partials         1706     1705       -1     
Impacted Files Coverage Δ
app/rpc/rpccontext/verbosedata.go 73.26% <0.00%> (-2.25%) ⬇️
app/rpc/rpchandlers/get_block.go 0.00% <0.00%> (ø)
...onsensus/processes/blockprocessor/validateblock.go 88.88% <100.00%> (+0.65%) ⬆️
app/protocol/flows/blockrelay/handle_relay_invs.go 70.00% <0.00%> (+1.33%) ⬆️
...k/netadapter/server/grpcserver/connection_loops.go 59.61% <0.00%> (+5.76%) ⬆️
infrastructure/network/netadapter/router/route.go 85.71% <0.00%> (+7.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a31074...98eea8c. Read the comment docs.

@@ -54,11 +54,14 @@ func (bp *blockProcessor) validateBlock(block *externalapi.DomainBlock, isPrunin
if err != nil {
if errors.As(err, &ruleerrors.RuleError{}) {
// If we got ErrMissingParents the block shouldn't be considered as invalid
// because it could be added later on when its parents are present, and if
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd reformat this comment as something like:

We don't mark the following errors as invalid for the following reasons:
ErrMissingParents - explanation
ErrBlabla - explanation
etc.

@svarogg svarogg merged commit e78cdff into v0.9.0-dev Feb 15, 2021
@svarogg svarogg deleted the dont-mark-rejected-pruned-block-as-invalid branch February 15, 2021 13:34
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