Skip to content

Use a 2/3 instead of 1/2 majority in Aura.#109

Merged
vkomenda merged 4 commits into
aura-posfrom
afck-supermajority
May 14, 2019
Merged

Use a 2/3 instead of 1/2 majority in Aura.#109
vkomenda merged 4 commits into
aura-posfrom
afck-supermajority

Conversation

@afck
Copy link
Copy Markdown
Collaborator

@afck afck commented Mar 19, 2019

Closes #108.

@afck afck requested review from phahulin, varasev and vkomenda March 19, 2019 11:26
Comment thread ethcore/src/engines/authority_round/finality.rs
@phahulin
Copy link
Copy Markdown

Also probably in this test

if finalization_count * 2 > cur_signers.len() { break }

Copy link
Copy Markdown

@phahulin phahulin left a comment

Choose a reason for hiding this comment

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

LGTM

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented Mar 19, 2019

Good catch! Unfortunately the tests passed with the * 2 and now fail with the * 3 > … * 2. I'll try to fix them.

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented Mar 20, 2019

That's another test that uses an old validator set contract ABI, and (according to the docs) this implementation: https://gist.github.com/anonymous/2a43783647e0f0dfcc359bd6fd81d6d9
@vkomenda: Is that the one you already created an updated version of?

@vkomenda
Copy link
Copy Markdown

vkomenda commented Mar 20, 2019

That's another test that uses an old validator set contract ABI

Well spotted! We could use the updated version or we might store this file alongside the tests, possibly having updated to Solidity v0.5. My version doesn't emit ValidatorsChanged.

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented Mar 20, 2019

Yes, maybe we should try to make one test implementation work for all tests, and add ValidatorsChanged to it.

@vkomenda
Copy link
Copy Markdown

I can't find where ValidatorsChanged is received in Parity. Maybe it's unused?

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented Mar 20, 2019

Possibly… if it's only in the test contract, maybe it's only used in that test?

@vkomenda
Copy link
Copy Markdown

I don't think the event is ever used at all. We can try without it to see if the test still passes.

Copy link
Copy Markdown
Member

@varasev varasev left a comment

Choose a reason for hiding this comment

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

It works fine but we need to add supermajorityTransition spec option: #108 (comment)

@varasev
Copy link
Copy Markdown
Member

varasev commented May 3, 2019

Since we need 2/3 of the majority not only for POSDAO but also for our existing networks (Core/Sokol/Dai), let's do the same changes made in this PR above the original Parity code (which is not modified for POSDAO) and try to launch Parity's original unit tests.

@afck afck force-pushed the afck-supermajority branch from 44e0212 to 81cc746 Compare May 7, 2019 10:00
@afck afck force-pushed the afck-supermajority branch from 81cc746 to e63b0ec Compare May 7, 2019 10:12
@afck
Copy link
Copy Markdown
Collaborator Author

afck commented May 7, 2019

I added a quorum_2_3_transition option to the Aura configuration.

@varasev
Copy link
Copy Markdown
Member

varasev commented May 7, 2019

I added a quorum_2_3_transition option to the Aura configuration.

The corresponding parameter in spec.json is called quorum23Transition, right?

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented May 7, 2019

Ah, right, it's camel-cased. 👍

@varasev
Copy link
Copy Markdown
Member

varasev commented May 9, 2019

Can we add some line to the logs which would tell us that the quorum23Transition is applied?

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented May 9, 2019

I added a message—is trace enough or should it be a higher log level?

@varasev
Copy link
Copy Markdown
Member

varasev commented May 9, 2019

Let's display it on the info level like here: https://github.com/paritytech/parity-ethereum/blob/e91eb337c9d01ff339565e682bcd2b4b7608df6d/ethcore/src/engines/authority_round/mod.rs#L1429 so that it would be shown in the logs even when logging = "engine=trace" is not defined in toml config file.

Can we display it starting from the block when it is applied? Like https://github.com/paritytech/parity-ethereum/blob/e91eb337c9d01ff339565e682bcd2b4b7608df6d/ethcore/src/engines/authority_round/mod.rs#L1429.

@afck afck force-pushed the afck-supermajority branch from a0ccc54 to aa7dce7 Compare May 9, 2019 10:21
@afck
Copy link
Copy Markdown
Collaborator Author

afck commented May 9, 2019

I updated the last commit accordingly. 👍

@varasev
Copy link
Copy Markdown
Member

varasev commented May 9, 2019

Thanks, I will try to test that 👍

@varasev
Copy link
Copy Markdown
Member

varasev commented May 9, 2019

Please do the same for vk-stable-mulmod branch: aa7dce7

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented May 9, 2019

Done.
(@vkomenda: I took the liberty of directly pushing the log statement onto vk-stable-mulmod.

@varasev
Copy link
Copy Markdown
Member

varasev commented May 9, 2019

I updated the last commit accordingly. 👍

I see two lines in the logs for some reason:

image

And for the detailed logs (another, non-validator, node):

image

@afck
Copy link
Copy Markdown
Collaborator Author

afck commented May 9, 2019

I put it into on_close_block—another method that seems to be called multiple times for some reason, despite #103

@vkomenda
Copy link
Copy Markdown

vkomenda commented May 9, 2019

I looked at the callers of on_close_block and it looks like import_verified_blocks is called multiple times. This can happen if the block queue is flushed multiple times.

Copy link
Copy Markdown
Member

@varasev varasev left a comment

Choose a reason for hiding this comment

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

I guess multi reporting mentioned in my comment is not a problem. So, since we don't see any issues here, let's merge this into aura-pos branch.

@vkomenda vkomenda merged commit c159ba5 into aura-pos May 14, 2019
@afck afck deleted the afck-supermajority branch May 14, 2019 13:01
varasev added a commit to poanetwork/posdao-contracts that referenced this pull request May 15, 2019
afck added a commit that referenced this pull request Jul 24, 2019
* Use a 2/3 instead of 1/2 majority in Aura.

* Make Aura quorum transition configurable.

* use the quorum_2_3_transition configuration parameter

* Print an info message if 2/3 quorum is set.
afck added a commit that referenced this pull request Oct 7, 2019
* Use a 2/3 instead of 1/2 majority in Aura.

* Make Aura quorum transition configurable.

* use the quorum_2_3_transition configuration parameter

* Print an info message if 2/3 quorum is set.
Oyase-shinobi pushed a commit to Oyase-shinobi/hbbft-posdao-contracts that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can we make AuRa require 2/3 validators signatures instead of 1/2?

5 participants