forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added proxy server * added isproxy field to peer objects * relay messages proxy receives to validator * Add addSentry RPC * Add removeSentry RPC * Add admin.sentryInfo RPC * Add --proxied flag * Don't consider sentry nodes as contributing toward the max peer count * Don't assume a sentry will never be a validator * Remove proxied check from api * Go back to assuming sentry will not be a validator * Fix eth tests * Fix eth test lint * Add max sentry node count as 1 * wip, add val_enode_share * Remove redundant proxied check * Add warning if proxied but not mining * Wip, messages now are received by sentry * Clean up, add signatures to val enode share msg * Add sharedValidatorEnode struct * Use received shared validator enodes, add proxied check for sharing * Clean up, remove proxied as a variable in istanbul backend * run go fmt * Fix tests * Add val enode share test * Change GlobalIsSet -> GlobalBool * Change to val enode share to every minute, fix comment * Read lock when reading val enode table entries * got blockchain syncing done via the sentry * Refactor val enode share to use istanbul message struct * changes for relayer consensus message handling * Refactor announce to use istanbul message struct * peer.Send done in a goroutine * Add better logging * Proxied validators do not peer with validators, sentries do * Don't refresh val set peers if proxy, lock once when upserting upon handling table message * Fix lint, tests * fixed lint errors * made the sentry and proxied command line argument more consistent * got announce and val_enode_share msgs working * forwarding of consensus messages now working * fix the old block seal * fixed comment * added test case for 'old block' preprepare * simplified the logic * refactored sentry related command line args and moved addsentry and removesentry rpc api to istanbul package * refactoring the p2p server to remove sentry and validator connections * moved all validator and sentry peer management from p2p to istanbul * fixed bugs * removed the refactoring of core.finalizeMessage, backend.Broadcast, backend.Gossip. Leave it for later * changed proxy listen port flag to listen endpoint * changes in the test files for the new addpeer and addtrusted p2p.server apis * changed order of params in Gossip to be same as original ordering * fixed p2p peer test for the new p2p server interface * lint fixes * changes to get istanbul related unit tests to pass * some changes for the unit tests * removed some debug logging and added some comment * added some comments to clarify the need for istanbul.backend.NewWork and istanbul.backend.NewChainHead * set maxpeers to 1 for the internal server interface * created istanbul forward message * removed unneeded whitespace * handled case of no sentry node set in unregisteredpeer * got sigint to work * added support for setting sentry nodes via command line * fixed a bug * addressed PR comments * fixed a big and addressed more PR comments * will now send an announce message at start of new epoch * refactor istanbul message (ethereum#583) * refactored istanbul message * addressed PR comments * addressed PR comments * addressed more PR comments * addressed more PR comments * change p2p static and trusted peer labels to purposes * got proxy end to end test working * changed the purpose from string type to bitmap based type * removed redundant adding of active validators to the regAndActiveVal set * fixed a bug * re-point celo-monorepo to master * fixed miner unit test to not create the validatorenode db directory in the miner directory * addressed PR comments from mcortesi * handled old announce messages * fixed a bug * addressed PR comments * modified UnionOfSeals to return an error instead of panic-ing * checked for dup or irrelevant entries when process an announce message * fixed bugs * don't regossip announce message if it has dups or irrelevent entries
- Loading branch information
Showing
56 changed files
with
1,935 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2017 The Celo Authors | ||
// This file is part of the celo library. | ||
// | ||
// The celo library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The celo library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the celo library. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package consensustest | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/consensus" | ||
"github.com/ethereum/go-ethereum/core/types" | ||
"github.com/ethereum/go-ethereum/p2p" | ||
"github.com/ethereum/go-ethereum/p2p/enode" | ||
) | ||
|
||
type MockBroadcaster struct{} | ||
|
||
func (b *MockBroadcaster) Enqueue(id string, block *types.Block) { | ||
} | ||
|
||
func (b *MockBroadcaster) FindPeers(targets map[enode.ID]bool, purpose p2p.PurposeFlag) map[enode.ID]consensus.Peer { | ||
return make(map[enode.ID]consensus.Peer) | ||
} | ||
|
||
type MockP2PServer struct { | ||
Node *enode.Node | ||
} | ||
|
||
func (serv *MockP2PServer) Self() *enode.Node { | ||
return serv.Node | ||
} | ||
|
||
func (serv *MockP2PServer) AddPeer(node *enode.Node, purpose p2p.PurposeFlag) {} | ||
|
||
func (serv *MockP2PServer) RemovePeer(node *enode.Node, purpose p2p.PurposeFlag) {} | ||
|
||
func (serv *MockP2PServer) AddTrustedPeer(node *enode.Node, purpose p2p.PurposeFlag) {} | ||
|
||
func (serv *MockP2PServer) RemoveTrustedPeer(node *enode.Node, purpose p2p.PurposeFlag) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.