Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Enable aleth-bootnode to connect to official Ethereum bootnodes #5485

Merged
merged 4 commits into from
Feb 14, 2019

Conversation

halfalicious
Copy link
Contributor

Enable aleth-bootnode to connect to the official Ethereum bootnodes. This is now the behavior by default, but it can be disabled via the new "--no-boostrap" flag.

I've included this functionality because I think it's useful for discovery testing purposes. Additionally, it now enables one to run a discovery-only node that can participate on a public network without one having to manually bootstrap it with another Ethereum node.

@codecov-io
Copy link

codecov-io commented Feb 12, 2019

Codecov Report

Merging #5485 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5485      +/-   ##
==========================================
- Coverage   61.87%   61.86%   -0.01%     
==========================================
  Files         345      345              
  Lines       28690    28699       +9     
  Branches     3262     3265       +3     
==========================================
+ Hits        17751    17756       +5     
- Misses       9773     9781       +8     
+ Partials     1166     1162       -4

aleth-bootnode/main.cpp Outdated Show resolved Hide resolved
aleth-bootnode/main.cpp Show resolved Hide resolved
@halfalicious
Copy link
Contributor Author

Looks like this test is flaky (I didn't touch any of this code so it's a test issue not a change issue):


Running 1 test case...
Test Case "pingNotSentAfterPongForKnownNode": 
/home/builder/project/libdevcore/concurrent_queue.h(47): fatal error: in "_T dev::concurrent_queue<_T, _QueueT>::pop(const milliseconds&) [with _T = std::vector<unsigned char>; _QueueT = std::queue<std::vector<unsigned char>, std::deque<std::vector<unsigned char>, std::allocator<std::vector<unsigned char> > > >; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]": boost::exception_detail::clone_impl<dev::WaitTimeout>: /home/builder/project/libdevcore/concurrent_queue.h(47): Throw in function _T dev::concurrent_queue<_T, _QueueT>::pop(const milliseconds&) [with _T = std::vector<unsigned char>; _QueueT = std::queue<std::vector<unsigned char>, std::deque<std::vector<unsigned char>, std::allocator<std::vector<unsigned char> > > >; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]
Dynamic exception type: boost::exception_detail::clone_impl<dev::WaitTimeout>

I'll open a new issue for this

aleth-bootnode/main.cpp Show resolved Hide resolved
@halfalicious
Copy link
Contributor Author

Looks like this test is flaky (I didn't touch any of this code so it's a test issue not a change issue):


Running 1 test case...
Test Case "pingNotSentAfterPongForKnownNode": 
/home/builder/project/libdevcore/concurrent_queue.h(47): fatal error: in "_T dev::concurrent_queue<_T, _QueueT>::pop(const milliseconds&) [with _T = std::vector<unsigned char>; _QueueT = std::queue<std::vector<unsigned char>, std::deque<std::vector<unsigned char>, std::allocator<std::vector<unsigned char> > > >; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]": boost::exception_detail::clone_impl<dev::WaitTimeout>: /home/builder/project/libdevcore/concurrent_queue.h(47): Throw in function _T dev::concurrent_queue<_T, _QueueT>::pop(const milliseconds&) [with _T = std::vector<unsigned char>; _QueueT = std::queue<std::vector<unsigned char>, std::deque<std::vector<unsigned char>, std::allocator<std::vector<unsigned char> > > >; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]
Dynamic exception type: boost::exception_detail::clone_impl<dev::WaitTimeout>

I'll open a new issue for this

Looks like this test is flaky (I didn't touch any of this code so it's a test issue not a change issue):


Running 1 test case...
Test Case "pingNotSentAfterPongForKnownNode": 
/home/builder/project/libdevcore/concurrent_queue.h(47): fatal error: in "_T dev::concurrent_queue<_T, _QueueT>::pop(const milliseconds&) [with _T = std::vector<unsigned char>; _QueueT = std::queue<std::vector<unsigned char>, std::deque<std::vector<unsigned char>, std::allocator<std::vector<unsigned char> > > >; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]": boost::exception_detail::clone_impl<dev::WaitTimeout>: /home/builder/project/libdevcore/concurrent_queue.h(47): Throw in function _T dev::concurrent_queue<_T, _QueueT>::pop(const milliseconds&) [with _T = std::vector<unsigned char>; _QueueT = std::queue<std::vector<unsigned char>, std::deque<std::vector<unsigned char>, std::allocator<std::vector<unsigned char> > > >; std::chrono::milliseconds = std::chrono::duration<long int, std::ratio<1l, 1000l> >]
Dynamic exception type: boost::exception_detail::clone_impl<dev::WaitTimeout>

I'll open a new issue for this

Opened #5488

aleth-bootnode can now connect to the official Ethereum bootnode servers. I've also included a "--no-bootstrap" flag to disable this functionality at runtime.
Also rename function from pocHosts to defaultBootNodes
@halfalicious halfalicious force-pushed the aleth-bootnode-bootstrap branch from e929cc0 to bad979f Compare February 13, 2019 18:29
@halfalicious
Copy link
Contributor Author

Rebased

libp2p/Common.cpp Outdated Show resolved Hide resolved
@@ -253,5 +253,24 @@ boost::log::formatting_ostream& operator<<(boost::log::formatting_ostream& _log,
return _log << _node.id << '@' << _node.endpoint;
}

unordered_map<Public, string>& defaultBootNodes()
{
static unordered_map<Public, string> ret = {
Copy link
Member

Choose a reason for hiding this comment

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

Actually, does it have to be a map at all? I think an std::array would work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants