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

Rework p2p req resp protocol #11781

Open
wants to merge 50 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
81ce6bd
Herp
anacrolix Aug 19, 2024
170f39f
Add test demonstrating inability to sync in reasonable time
anacrolix Aug 29, 2024
4ed047e
Extreme test passes
anacrolix Aug 29, 2024
a897178
Trim just check output
anacrolix Aug 30, 2024
7868a30
Pass payload source in L2PayloadIn
anacrolix Aug 30, 2024
af7761d
Improve debugging of peer efficiency
anacrolix Aug 30, 2024
5c6b312
Maintain a single active range request
anacrolix Aug 30, 2024
681ad9a
Fix active range request ID handling
anacrolix Aug 30, 2024
02f7aff
Restore results chan for now
anacrolix Aug 30, 2024
6fcb95d
Merge branch 'develop' into anacrolix/p2p-req-resp
anacrolix Sep 2, 2024
e4e5dd2
Everything stable
anacrolix Sep 2, 2024
9969026
Fix TestMultiPeerSync
anacrolix Sep 2, 2024
d9c899e
Move SyncClient.mu closer to its fields
anacrolix Sep 2, 2024
9e2baa5
Revert to go1.21
anacrolix Sep 3, 2024
bbd9877
go1.22...
anacrolix Sep 3, 2024
c850a51
Add just test-components
anacrolix Sep 3, 2024
9cb665b
Expose P2P sync config
anacrolix Sep 3, 2024
4788b58
Switch op-stack-go Dockerfile to go1.22
anacrolix Sep 3, 2024
ce688cd
Merge branch 'develop' into anacrolix/new-p2p-req-resp
anacrolix Sep 4, 2024
6170149
Group sync client request state
anacrolix Sep 4, 2024
690ee60
Retry promoted blocks that are requested again
anacrolix Sep 4, 2024
deac586
Merge remote-tracking branch 'origin/develop' into anacrolix/new-p2p-…
anacrolix Sep 4, 2024
c6dd233
Move all the new alt sync test code into a new file
anacrolix Sep 6, 2024
bdb4728
Tidy up comments
anacrolix Sep 6, 2024
1f4f8a9
Handle the case where the range changes or next promote target change…
anacrolix Sep 6, 2024
73964b6
Set anacrolix/{chansync,sync} tagged versions
anacrolix Sep 6, 2024
25ad57e
go1.21 support
anacrolix Sep 6, 2024
3c5bf67
Try to tap into the forkchoice update event to trigger alt sync
anacrolix Sep 6, 2024
59cf37f
Merge branch 'develop' into anacrolix/p2p-req-resp
anacrolix Sep 6, 2024
e16d7e8
Merge branch 'develop' into anacrolix/p2p-req-resp
anacrolix Sep 9, 2024
7f12b76
Fix lints
anacrolix Sep 9, 2024
445f552
Reduce diff
anacrolix Sep 9, 2024
3370816
Fixes with removed custom peer IDs
anacrolix Sep 9, 2024
2f0d61a
lint
anacrolix Sep 9, 2024
9316902
Remove stringly typed payload checks to avoid type mismatches in testify
anacrolix Sep 9, 2024
41b6cb0
Tidy
anacrolix Sep 9, 2024
f6c5236
Tidy
anacrolix Sep 9, 2024
c5eefe1
Move peer ID into syncClientPeer
anacrolix Sep 9, 2024
ab05aa2
Disable stdout debugging
anacrolix Sep 9, 2024
fccd892
lint
anacrolix Sep 9, 2024
d7fbb3a
Put request reservation in another frame to simplify logic
anacrolix Sep 9, 2024
d35d700
Fix @tynes nits
anacrolix Sep 11, 2024
8ae2217
Address the final hash unused I spotted with @seb
anacrolix Sep 13, 2024
aa9c491
Pass wanted from parent rather than looking it up again
anacrolix Sep 13, 2024
0f2c725
Fix spotted race
anacrolix Sep 13, 2024
45c5747
Limit quarantined payload count
anacrolix Sep 13, 2024
d620512
Merge remote-tracking branch 'origin/develop' into anacrolix/p2p-req-…
anacrolix Sep 18, 2024
6b9af4e
Remove unnecessary docker change
anacrolix Sep 18, 2024
598d0f0
Tidy up debug deps and unsigned wrapping
anacrolix Sep 18, 2024
cc64a80
lint
anacrolix Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass wanted from parent rather than looking it up again
  • Loading branch information
anacrolix committed Sep 13, 2024
commit aa9c491f068835209b77ba12a2586f24ea4f1669
11 changes: 3 additions & 8 deletions op-node/p2p/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func (s *SyncClient) maybePromote(ctx context.Context) {
}
}

func (s *syncClientPeer) requestAndHandleResult(ctx context.Context, num blockNumber) (err error) {
func (s *syncClientPeer) requestAndHandleResult(ctx context.Context, wanted *wantedBlock) (err error) {
// We already established the peer is available w.r.t. rate-limiting,
// and this is the only loop over this peer, so we can request now.

Expand All @@ -565,12 +565,6 @@ func (s *syncClientPeer) requestAndHandleResult(ctx context.Context, num blockNu

go func() {
defer cancel()
s.mu.Lock()
wanted := s.getWantedBlock(num)
s.mu.Unlock()
if wanted == nil {
return
}
select {
case <-wanted.done.On():
case <-ctx.Done():
Expand All @@ -579,6 +573,7 @@ func (s *syncClientPeer) requestAndHandleResult(ctx context.Context, num blockNu
start := time.Now()

resultCode := ResultCodeSuccess
num := wanted.num

envelope, err := s.doRequestRecoveringPanic(ctx, num)

Expand Down Expand Up @@ -674,7 +669,7 @@ func (s *syncClientPeer) reserveAndRequest(ctx context.Context, wanted *wantedBl
err = fmt.Errorf("waiting for global rate limiter: %w", err)
return
}
err = s.requestAndHandleResult(ctx, wanted.num)
err = s.requestAndHandleResult(ctx, wanted)
requested = true
if err != nil {
err = fmt.Errorf("requesting block %v: %w", wanted.num, err)
Expand Down