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

Update libp2p to 0.30.x #1999

Merged
merged 8 commits into from
Feb 3, 2021
Merged

Update libp2p to 0.30.x #1999

merged 8 commits into from
Feb 3, 2021

Conversation

wemeetagain
Copy link
Member

Having trouble committing on top of #1820
Updates libp2p dependencies to latest versions & updates yarn.lock

@codeclimate
Copy link

codeclimate bot commented Jan 26, 2021

Code Climate has analyzed commit 7a076d9 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions github-actions bot added the scope-networking All issues related to networking, gossip, and libp2p. label Jan 26, 2021
@dapplion
Copy link
Contributor

dapplion commented Jan 27, 2021

Sim test consistently fail, I've seen this in the logs

2021-01-26 18:48:10 [NETWORK]          warn: Cannot connect to peers on subnet subnet=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63], error=Cannot read property 'discv5' of undefined
2021-01-26 18:46:51 [VALIDATOR 0-8]   error: Failed to get validator details message=Validator not found
Error: Validator not found
    at BeaconStateApi.getStateValidator (/home/runner/work/lodestar/lodestar/packages/lodestar/src/api/impl/beacon/state/state.ts:89:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at runNextTicks (internal/process/task_queues.js:63:3)
    at listOnTimeout (internal/timers.js:501:9)
    at processTimers (internal/timers.js:475:7)
    at AttestationService.updateValidators (/home/runner/work/lodestar/lodestar/packages/lodestar-validator/src/services/attestation.ts:407:36)
    at ApiClientOverInstance.<anonymous> (/home/runner/work/lodestar/lodestar/packages/lodestar-validator/src/services/attestation.ts:107:5)
2021-01-26 18:46:57 [NETWORK]          warn: Ignoring gossip attestation attestationSlot=11, attestationBlockRoot=0x20ea10f2babb32cc90bf7f283a056ed21bfedc1d6c97d5862d722b86554d9b64, attestationRoot=0x38c2c92a312004162ebc64c504349becb9a9b0412f0406a243d36bdd99e28acf, subnet=3 code=ATTESTATION_ERROR_UNKNOWN_BEACON_BLOCK_ROOT, beaconBlockRoot=0x20ea10f2babb32cc90bf7f283a056ed21bfedc1d6c97d5862d722b86554d9b64
Error: ATTESTATION_ERROR_UNKNOWN_BEACON_BLOCK_ROOT
    at Object.validateGossipAttestation (/home/runner/work/lodestar/lodestar/packages/lodestar/src/chain/validation/attestation.ts:73:11)
    at GossipMessageValidator.isValidIncomingCommitteeAttestation (/home/runner/work/lodestar/lodestar/packages/lodestar/src/network/gossip/validator.ts:113:7)
    at LodestarGossipsub.libP2pTopicValidator (/home/runner/work/lodestar/lodestar/packages/lodestar/src/network/gossip/gossipsub.ts:113:32)
    at LodestarGossipsub.validate (/home/runner/work/lodestar/lodestar/node_modules/libp2p-interfaces/src/pubsub/index.js:594:7)

Not sure if any of these are related to the PR

@wemeetagain
Copy link
Member Author

Sim test consistently fail, I've seen this in the logs

2021-01-26 18:48:10 [NETWORK]          warn: Cannot connect to peers on subnet subnet=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63], error=Cannot read property 'discv5' of undefined

It seems like this is unique to this PR. It looks like the node is not able to stop properly (but just in the threaded sim test)

@wemeetagain
Copy link
Member Author

The simulation test was failing due to libp2p/js-libp2p-tcp#139 which has been resolved and re-released.

This PR is ready for re-review :)

@@ -96,11 +96,11 @@ export class Libp2pNetwork extends (EventEmitter as {new (): NetworkEventEmitter
public async stop(): Promise<void> {
this.libp2p.connectionManager.removeListener(NetworkEvent.peerConnect, this.emitPeerConnect);
this.libp2p.connectionManager.removeListener(NetworkEvent.peerDisconnect, this.emitPeerDisconnect);
await Promise.all([this.diversifyPeersTask.stop(), this.checkPeerAliveTask.stop()]);
Copy link
Contributor

Choose a reason for hiding this comment

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

everything else in the PR looks good to me, but i'm curious, what is the effect of stopping these tasks here instead of where it used to be? What motivated this particular change?

Copy link
Member Author

Choose a reason for hiding this comment

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

These tasks are for searching for peers and pinging peers. Before, we were shutting these down after we shut down libp2p, and no longer had any peers. So there was a slight change that tasks could error or not shut down cleanly.

This was usually not even visible or a practical issue, since these tasks run on long intervals, and would shut down before having a chance to run after libp2p had been shut down. During debugging this PR, this little wrinkle became apparent tho.

@wemeetagain wemeetagain merged commit bf2d293 into master Feb 3, 2021
@wemeetagain wemeetagain deleted the cayman/update-libp2p branch February 3, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-networking All issues related to networking, gossip, and libp2p.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants