-
Notifications
You must be signed in to change notification settings - Fork 291
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
Feature: 1 second finality #4771
Open
Frozen
wants to merge
26
commits into
dev
Choose a base branch
from
feature/1-second-finality
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
39d07ff
One second configuration and commission calculation for 67%
Frozen 9df86dd
Moved spawn into finalCommit.
Frozen 9e67e70
Final commit for 1s version.
Frozen 757a127
Pre commit 1s version.
Frozen 739355a
Reuse network message.
Frozen 73ecf69
Rotate each block.
Frozen 1516882
Each block rotation activation.
Frozen f655e3e
Fixed `PostConsensusProcessing` usage.
Frozen 4c761db
Broadcast epoch block (#4756)
Frozen 5c1c3da
Final commit for 1s version.
Frozen 4ca809c
Reuse network message.
Frozen 2e5034b
Fixed final commit method args.
Frozen 82a2e5d
Fixed final commit method args.
Frozen dbb3361
Fixed conflicts.
Frozen fec16fd
Expects 100% sign in one second.
Frozen ad4b80f
Fixed config.
Frozen e74731b
Removed debug info.
Frozen a27abe9
Configuration fix.
Frozen 34f7c79
`finalCommit` method refactored.
Frozen f4f24d0
Removed unused `preCommitAndPropose1s`.
Frozen 5925d4b
Removed `commitBlock1s`.
Frozen a283e04
Clean up.
Frozen 1c91cbf
Set activation epoch 5.
Frozen c0060ce
Fixed config to pass tests.
Frozen 647cb9b
Fixed config to pass tests.
Frozen c9518a5
Fixed tests.
Frozen 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,6 +323,8 @@ var ( | |
MaxRateEpoch: EpochTBD, | ||
DevnetExternalEpoch: EpochTBD, | ||
TestnetExternalEpoch: EpochTBD, | ||
IsOneSecondEpoch: big.NewInt(6), | ||
IsRotationEachBlockEpoch: big.NewInt(6), | ||
} | ||
|
||
// AllProtocolChanges ... | ||
|
@@ -374,6 +376,8 @@ var ( | |
big.NewInt(0), | ||
big.NewInt(0), | ||
big.NewInt(0), | ||
big.NewInt(0), | ||
big.NewInt(0), | ||
} | ||
|
||
// TestChainConfig ... | ||
|
@@ -425,6 +429,8 @@ var ( | |
big.NewInt(0), // MaxRateEpoch | ||
big.NewInt(0), | ||
big.NewInt(0), | ||
big.NewInt(0), | ||
big.NewInt(0), | ||
} | ||
|
||
// TestRules ... | ||
|
@@ -606,6 +612,10 @@ type ChainConfig struct { | |
// vote power feature https://github.com/harmony-one/harmony/pull/4683 | ||
// if crosslink are not sent for an entire epoch signed and toSign will be 0 and 0. when that happen, next epoch there will no shard 1 validator elected in the committee. | ||
HIP32Epoch *big.Int `json:"hip32-epoch,omitempty"` | ||
|
||
IsOneSecondEpoch *big.Int `json:"is-one-second-epoch,omitempty"` | ||
|
||
IsRotationEachBlockEpoch *big.Int `json:"is-rotation-each-block-epoch"` | ||
} | ||
|
||
// String implements the fmt.Stringer interface. | ||
|
@@ -731,6 +741,10 @@ func (c *ChainConfig) IsTwoSeconds(epoch *big.Int) bool { | |
return isForked(c.TwoSecondsEpoch, epoch) | ||
} | ||
|
||
func (c *ChainConfig) IsOneSecond(epoch *big.Int) bool { | ||
return isForked(c.IsOneSecondEpoch, epoch) | ||
} | ||
|
||
// IsSixtyPercent determines whether it is the epoch to reduce internal voting power to 60% | ||
func (c *ChainConfig) IsSixtyPercent(epoch *big.Int) bool { | ||
return isForked(c.SixtyPercentEpoch, epoch) | ||
|
@@ -895,6 +909,10 @@ func (c *ChainConfig) IsOneEpochBeforeHIP30(epoch *big.Int) bool { | |
return new(big.Int).Sub(c.HIP30Epoch, epoch).Cmp(common.Big1) == 0 | ||
} | ||
|
||
func (c *ChainConfig) IsRotationEachBlock(epoch *big.Int) bool { | ||
return isForked(c.IsRotationEachBlockEpoch, epoch) | ||
} | ||
|
||
// UpdateEthChainIDByShard update the ethChainID based on shard ID. | ||
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. What is RotationEachBlockEpoch ??? do you mean "Leader Rotation at Epoch Block"? 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. same question here |
||
func UpdateEthChainIDByShard(shardID uint32) { | ||
once.Do(func() { | ||
|
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
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.
why are we doing that now ? or is this a new config rename that was meant for HIP32 ?