-
Notifications
You must be signed in to change notification settings - Fork 20k
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
consensus/istanbul: Istanbul BFT (EIP650) #14674
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e22d86f
cmd, consensus, eth, ethstats: add protocol interface into consensus …
markya0616 dacf71e
params: add Istanbul consensus engine config to ChainConfig
markya0616 84e22ad
cmd/*: add Istanbul command line flags
bailantaotao e03ac4b
consensus/istanbul, eth: add Istanbul configuration
bailantaotao fddd663
node: add an interface to retrieve node key from config
94ec62c
consensus: add Istanbul consensus engine interface
markya0616 d9b440a
consensus/istanbul: common Istanbul interfaces and types
markya0616 f03a83a
consensus/istanbul: Istanbul validator set implementation
markya0616 0abccdb
consensus/istanbul: Istanbul core implementation
markya0616 1e297ef
consensus/istanbul: add tests for Istanbul core
markya0616 efd8b5b
core/types: add Istanbul specific block hash calculation
bailantaotao 72ae3ec
consensus/istanbul: Istanbul consensus backend implementation
markya0616 3718bc0
internal/web3ext: add Istanbul JS RPC API
bailantaotao 159fba7
core, les, eth, miner: Istanbul consensus integration
markya0616 c754738
cmd/*, core, params: add ottoman testnet
markya0616 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,73 @@ | ||
// Copyright 2017 The go-ethereum Authors | ||
// This file is part of the go-ethereum library. | ||
// | ||
// The go-ethereum 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 go-ethereum 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 go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package istanbul | ||
|
||
import ( | ||
"math/big" | ||
"time" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/event" | ||
) | ||
|
||
// Backend provides application specific functions for Istanbul core | ||
type Backend interface { | ||
// Address returns the owner's address | ||
Address() common.Address | ||
|
||
// Validators returns the validator set | ||
Validators(proposal Proposal) ValidatorSet | ||
|
||
// EventMux returns the event mux in backend | ||
EventMux() *event.TypeMux | ||
|
||
// Broadcast sends a message to all validators (include self) | ||
Broadcast(valSet ValidatorSet, payload []byte) error | ||
|
||
// Gossip sends a message to all validators (exclude self) | ||
Gossip(valSet ValidatorSet, payload []byte) error | ||
|
||
// Commit delivers an approved proposal to backend. | ||
// The delivered proposal will be put into blockchain. | ||
Commit(proposal Proposal, seals [][]byte) error | ||
|
||
// Verify verifies the proposal. If a consensus.ErrFutureBlock error is returned, | ||
// the time difference of the proposal and current time is also returned. | ||
Verify(Proposal) (time.Duration, error) | ||
|
||
// Sign signs input data with the backend's private key | ||
Sign([]byte) ([]byte, error) | ||
|
||
// CheckSignature verifies the signature by checking if it's signed by | ||
// the given validator | ||
CheckSignature(data []byte, addr common.Address, sig []byte) error | ||
|
||
// LastProposal retrieves latest committed proposal and the address of proposer | ||
LastProposal() (Proposal, common.Address) | ||
|
||
// HasPropsal checks if the combination of the given hash and height matches any existing blocks | ||
HasPropsal(hash common.Hash, number *big.Int) bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change it to |
||
|
||
// GetProposer returns the proposer of the given block height | ||
GetProposer(number uint64) common.Address | ||
|
||
// ParentValidators returns the validator set of the given proposal's parent block | ||
ParentValidators(proposal Proposal) ValidatorSet | ||
|
||
// HasBadBlock returns whether the block with the hash is a bad block | ||
HasBadProposal(hash common.Hash) bool | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it "if the consensus" instead of "is the consensus" ?