Page MenuHomePhabricator

[avalanche] Request missing proofs from short ids
ClosedPublic

Authored by Fabien on May 31 2022, 12:44.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC041c5b4699c1: [avalanche] Request missing proofs from short ids
Summary

This diff introduce a new avaproofsreq message to request the missing proofs from a peer in response to a compact proofs message.

Depends on D11549 and D11571.

Test Plan
ninja all check-all

Diff Detail

Event Timeline

Fabien requested review of this revision.May 31 2022, 12:44

Use a hidden flag to bypass the anti dos in test rather than a dedicated network permission

deadalnix requested changes to this revision.May 31 2022, 16:32
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/init.cpp
397 ↗(On Diff #33747)

Why would you send and/or accept unsolicited compatcproofs messages? Just solicit them.

This revision now requires changes to proceed.May 31 2022, 16:32

Rebase on top of D11549 to actually request the compact proofs

Remove unnecessary timeout

deadalnix requested changes to this revision.Jun 1 2022, 15:41
deadalnix added inline comments.
src/net_processing.cpp
5169 ↗(On Diff #33764)

Shouldn't this require some kind of lock?

5249 ↗(On Diff #33764)

I assume most of this code is duplicated. You made design choices to have similar design between compact block and compact proofs, so you should be leveraging this and share the code.

This revision now requires changes to proceed.Jun 1 2022, 15:41
Fabien planned changes to this revision.Jun 1 2022, 16:01
Fabien added inline comments.
src/net_processing.cpp
5169 ↗(On Diff #33764)

Not at this stage, this is always accessed within the same thread, but I can make it an atomic to avoid silent issues if an RPC is added that calls this code

5249 ↗(On Diff #33764)

yes, there are some differences but most is common, I'll see what I can factorize

Rebase on top of D11571 to share most of the code with compact blocks

Store the radix tree as nullable in the node data

Bail out if proof relay is not enabled

Rebase, use calculate_shortid in the functional test (see D11573)

deadalnix requested changes to this revision.Jun 7 2022, 22:49
deadalnix added inline comments.
src/net.h
658

Stop wrapping that tree in a smart pointer. I don't know why you want to do that, just don't. If there is a problem fix it.

This revision now requires changes to proceed.Jun 7 2022, 22:49
Fabien planned changes to this revision.Jun 8 2022, 08:30
Fabien requested review of this revision.Jun 8 2022, 09:13
This revision is now accepted and ready to land.Jun 8 2022, 22:38