Skip to content
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

Tracking metablocks' rounds in the Consensus contract. #103

Merged
merged 42 commits into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
952feb7
GH-92: Tracking metablocks' rounds in the Consensus contract.
Dec 5, 2019
3019de8
Fixes Committee unit tests
Dec 5, 2019
4509cc1
Merge with 'origin/consensus-cleanup-naming'
Dec 6, 2019
c1f3f00
Fixing failing unit tests
Dec 6, 2019
d3eebe0
Change consensus move*Round nameing to go*Round
Dec 9, 2019
b82af0d
Fixes failing unittests
Dec 9, 2019
70911f3
Replaces chainId with metachainId
Dec 9, 2019
f5178a2
Merges with 'feature/consensus'
Dec 9, 2019
4e2685d
Adjusts chain and metachain naming
Dec 9, 2019
fe3ee29
Merges w/ feature/consensus
Dec 9, 2019
85b7f54
Merges feature/consensus
Dec 9, 2019
23c7cd1
Uses ws for web3
Dec 9, 2019
f993b43
Improves usage
Dec 9, 2019
53d57ba
Running reputation test first
Dec 9, 2019
a1ae788
Runs each test separately to fix instability
Dec 9, 2019
1e450a2
Merges feature/consensus
Dec 10, 2019
29a8d84
Drafts GH-95
Dec 10, 2019
a04023f
Merges metablock-round
Dec 10, 2019
1f2063e
Drafts GH-95. Compiling version.
Dec 10, 2019
152b459
Merges with feature/consensus
Dec 12, 2019
b83d062
Makes Consensus::isValidator internal
Dec 12, 2019
53441fd
Merges w/ pgev:metablock-round
Dec 12, 2019
64f9ce9
Merges w/ feature/consensus
Dec 16, 2019
12c8b06
Merge w/ metablock-round
Dec 16, 2019
676c171
Consensus minor adjustments
Dec 16, 2019
3056425
Consensus improvements
Dec 16, 2019
7e20990
Skipping failing consensus tests
Dec 16, 2019
c01dd25
Merges w/ feature/consensus
Dec 16, 2019
0da0ab7
Consensus storage cleanup.
Dec 17, 2019
d4272f2
Merge w/ feature/consensus
Dec 17, 2019
e61de39
Cleanup.
Dec 17, 2019
6b6090e
Ignores/fixes unit tests
Dec 17, 2019
e4168a0
Merge w/ feature/consensus
Dec 17, 2019
9985754
Fixes consensus unit test failure
Dec 18, 2019
76a08d4
Fixes Axiom unit test failure
Dec 18, 2019
9936d62
Merges w/ feature/consensus
Dec 19, 2019
9438c52
hashBlockSegment() reads blocksegment length from storage
Dec 19, 2019
16f0ed6
Fixes indentation
Dec 19, 2019
c31f408
Improves hashBlockSegment() to include metablockhash on seed calculation
Dec 19, 2019
182516d
Calls reputation first on validator logout
Dec 19, 2019
b2a3f91
Refines assertion for hashBlockSegment
Dec 19, 2019
2c1c70b
Improves hashBlockSegment() to include metablockhash on seed calculation
Dec 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/axiom/Axiom.sol
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ contract Axiom is AxiomI, ProxyFactory, ConsensusModule {
}

/**
* @notice Setup a new meta chain. Only technical governance address can
* @notice Setup a new metachain. Only technical governance address can
* call this function.
*/
function newMetaChain()
Expand Down
21 changes: 17 additions & 4 deletions contracts/committee/Committee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ contract Committee is MasterCopyNonUpgradable, ConsensusModule, CommitteeI {

/* Storage */

/** Metachain id of the meta-blockchain */
bytes32 public metachainId;

/** Committee size */
uint256 public committeeSize;

Expand Down Expand Up @@ -232,6 +235,7 @@ contract Committee is MasterCopyNonUpgradable, ConsensusModule, CommitteeI {
/* External functions */

function setup(
bytes32 _metachainId,
ConsensusI _consensus,
uint256 _committeeSize,
bytes32 _dislocation,
Expand All @@ -240,10 +244,15 @@ contract Committee is MasterCopyNonUpgradable, ConsensusModule, CommitteeI {
external
{
require(
committeeSize == 0 && proposal == bytes32(0),
metachainId == bytes32(0),
"Committee is already setup."
);

require(
_metachainId != bytes32(0),
"Metachain id is 0."
);

require(
_committeeSize >= 3,
"Committee size must not be smaller than three."
Expand All @@ -261,6 +270,8 @@ contract Committee is MasterCopyNonUpgradable, ConsensusModule, CommitteeI {

setupConsensus(_consensus);

metachainId = _metachainId;

committeeStatus = CommitteeStatus.Open;

// Initialize the members linked-list as the empty set.
Expand All @@ -272,9 +283,8 @@ contract Committee is MasterCopyNonUpgradable, ConsensusModule, CommitteeI {

proposal = _proposal;

// @qn (pro): In case of 7 quorum should be 4 or 5.
quorum = _committeeSize * COMMITTEE_SUPER_MAJORITY_NUMERATOR /
COMMITTEE_SUPER_MAJORITY_DENOMINATOR;
COMMITTEE_SUPER_MAJORITY_DENOMINATOR;
}

/**
Expand Down Expand Up @@ -572,7 +582,10 @@ contract Committee is MasterCopyNonUpgradable, ConsensusModule, CommitteeI {

if (committeeDecision == bytes32(0)) {
committeeDecision = _position;
consensus.registerCommitteeDecision(committeeDecision);
consensus.registerCommitteeDecision(
metachainId,
committeeDecision
);
}
}

Expand Down
Loading