Skip to content

Feature Flag for Legacy P2P Support#6056

Merged
alexanderbez merged 68 commits intomasterfrom
erik/p2p-node
Feb 16, 2021
Merged

Feature Flag for Legacy P2P Support#6056
alexanderbez merged 68 commits intomasterfrom
erik/p2p-node

Conversation

@erikgrinaker
Copy link
Contributor

@erikgrinaker erikgrinaker commented Feb 5, 2021

This wires up the node to use either the new or old P2P stack based on the node.useLegacyP2P constant, using the new stack by default. It's a real mess, but it passes the simplest E2E tests:

test/e2e $ make && ./build/runner -f networks/simple.toml 
I[2021-02-05|12:46:44.401] Removing Docker containers and networks      
I[2021-02-05|12:46:44.625] Generating testnet files in "networks/simple" 
I[2021-02-05|12:46:44.633] Starting initial network nodes...            
I[2021-02-05|12:46:44.633] Starting transaction load (16 workers)...    
I[2021-02-05|12:46:46.580] Node validator01 up on http://127.0.0.1:5701 
I[2021-02-05|12:46:48.464] Node validator02 up on http://127.0.0.1:5702 
I[2021-02-05|12:46:50.374] Node validator03 up on http://127.0.0.1:5703 
I[2021-02-05|12:46:52.285] Node validator04 up on http://127.0.0.1:5704 
I[2021-02-05|12:46:52.285] Waiting for initial height 1...              
I[2021-02-05|12:46:52.310] Waiting for all nodes to reach height 7...   
I[2021-02-05|12:46:59.038] Ending transaction load after 112 txs (7.8 tx/s)... 
I[2021-02-05|12:46:59.045] Waiting for all nodes to reach height 12...  
I[2021-02-05|12:47:05.777] Running tests in ./tests/...                 
ok  	github.com/tendermint/tendermint/test/e2e/tests	1.787s

Branched off of #5969.

alexanderbez and others added 30 commits January 25, 2021 12:07
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
@alexanderbez alexanderbez changed the title node: support both new and legacy P2P stack Feature Flag for Legacy P2P Support Feb 15, 2021
@alexanderbez
Copy link
Contributor

alexanderbez commented Feb 15, 2021

@erikgrinaker at any point did this PR work with regards to e2e tests? I keep seeing chain stalled at unknown height regardless if the legacy stack is used or not.

EDIT: Actually, with the legacy p2p stack, it still errors, but with timed out waiting for full02 to reach height X. Is this typical in local environments?

@erikgrinaker
Copy link
Contributor Author

It works with the simple.toml network, i.e. the simplest possible 4-node network. The ci.toml network won't work, e.g. because it requires support for seed mode. This PR is just a basic proof of concept, there's a lot of work remaining before it's at parity with the legacy stack.

@alexanderbez
Copy link
Contributor

I would like to mark this PR r4r by having support for the feature flag only and having it build & pass. Did you envision anything specifically for this PR?

@erikgrinaker
Copy link
Contributor Author

This PR was just a quick-and-dirty proof of concept that I threw together in a couple of hours on my last day to see if the full stack was functional. It probably has bugs and omissions, and needs to be cleaned up. Whether you want to take this PR across the line or start fresh with a new PR is your call, but it wasn't really intended to be merged in its current form.

@alexanderbez
Copy link
Contributor

alexanderbez commented Feb 15, 2021

Ok, thanks for the clarification. Let me figure out if I can get seed mode to work as well (in pex v2) in this PR and get CI to pass and then we can go from there in future PRs.

@alexanderbez alexanderbez changed the title Feature Flag for Legacy P2P Support Feature Flag for Legacy P2P Support + PEX v2 Seed Mode Feb 15, 2021
@erikgrinaker
Copy link
Contributor Author

erikgrinaker commented Feb 15, 2021

Implementing seed mode with the new stack isn't trivial, we were discussing writing a separate daemon for it. As for why the legacy stack doesn't work, I'm not sure -- might have just forgotten some wiring or gotten something wrong somewhere.

@alexanderbez
Copy link
Contributor

I see. So I'm a bit lost on how we can even finish this PR then, unless we change CI to just run simple network for now.

@erikgrinaker
Copy link
Contributor Author

erikgrinaker commented Feb 15, 2021

You could default to the legacy stack, fix the issues causing it to break here, and clean up the code -- then implement the remaining P2P work until all E2E testnets pass with the new stack. Or alternatively implement all of the outstanding P2P work first, before wiring up the node.

@alexanderbez
Copy link
Contributor

Let's leave the default to true to use the legacy p2p stack. Note, there are no issues with the legacy stack in this PR -- false alarm. I'll clean this up and merge it shortly.

@alexanderbez alexanderbez changed the title Feature Flag for Legacy P2P Support + PEX v2 Seed Mode Feature Flag for Legacy P2P Support Feb 15, 2021
@alexanderbez alexanderbez marked this pull request as ready for review February 15, 2021 21:45
@codecov
Copy link

codecov bot commented Feb 15, 2021

Codecov Report

Merging #6056 (f1efd00) into master (16bbe8c) will decrease coverage by 0.09%.
The diff coverage is 65.64%.

@@            Coverage Diff             @@
##           master    #6056      +/-   ##
==========================================
- Coverage   60.77%   60.68%   -0.10%     
==========================================
  Files         276      276              
  Lines       25521    25646     +125     
==========================================
+ Hits        15511    15562      +51     
- Misses       8402     8463      +61     
- Partials     1608     1621      +13     
Impacted Files Coverage Δ
p2p/switch.go 59.90% <0.00%> (-3.10%) ⬇️
node/node.go 57.63% <66.45%> (+0.28%) ⬆️
privval/signer_endpoint.go 75.75% <0.00%> (-6.07%) ⬇️
privval/signer_server.go 94.73% <0.00%> (-5.27%) ⬇️
blockchain/v0/pool.go 77.18% <0.00%> (-2.67%) ⬇️
p2p/pex/pex_reactor.go 76.48% <0.00%> (-2.09%) ⬇️
consensus/reactor.go 66.92% <0.00%> (-1.89%) ⬇️
p2p/transport_memory.go 84.93% <0.00%> (-1.37%) ⬇️
p2p/pex/addrbook.go 68.59% <0.00%> (-0.51%) ⬇️
... and 9 more

@alexanderbez alexanderbez requested review from cmwaters and tac0turtle and removed request for alexanderbez February 16, 2021 13:16
Base automatically changed from bez/p2p-refactor-consensus-reactor to master February 16, 2021 16:02
@alexanderbez alexanderbez merged commit b6be889 into master Feb 16, 2021
@alexanderbez alexanderbez deleted the erik/p2p-node branch February 16, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C:p2p Component: P2P pkg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants