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

ECBP-1100: MESS implementation #181

Merged
merged 64 commits into from
Sep 25, 2020
Merged

ECBP-1100: MESS implementation #181

merged 64 commits into from
Sep 25, 2020

Conversation

meowsbits
Copy link
Contributor

@meowsbits meowsbits commented Sep 12, 2020

Implements ECBP-1100 (MESS) specified at ethereumclassic/ECIPs#373.

Define a function arbitrating chain acceptance using relative total difficulty and common ancestor time to raise finality confidence.

Extracts the reorganization data-aggregation
logic from its execution logic.

This will allow observation and arbitration
using the proposed reorganization data without
necessarily acting on it.

Signed-off-by: meows <[email protected]>
This is only really an optimization,
paving the way for installing additional
reorg arbitration.

Signed-off-by: meows <[email protected]>
Implements spec documented here:
https://github.com/etclabscore/artificial-finality/blob/master/MESS.md

MESS is an artificial finality mechanism endowing
the blockchain's current segment with so-called 'gravity'
by requiring a competing chain to satisfy an exponentially
increasing relative total difficulty.

Note that is change causes several tests with reorgs
to fail. This will be addressed by implementing
the feature as a chain configuration option.

Signed-off-by: meows <[email protected]>
…1355 configuration interface implementation

Implement ECBP11355 interface methods for supporting
chain configuration types.

Signed-off-by: meows <[email protected]>
This meter was added to ethereum/go-ethereum after my
original refactor was done, so my update missed it,
and it was caught by the deadcode linter.

Add it, fix it.

Signed-off-by: meows <[email protected]>
- local head staleness
- min peers

These are mechanisms designed to provide sane safeguard
heuristics for nodes to enable/disable artificial
finality features within reason.

Signed-off-by: meows <[email protected]>
This is intended to keep upstream merges streamlined
by moving 'custom' logic to a non-colliding space.

Signed-off-by: meows <[email protected]>
Should help with debugging if it comes to that.
4 decimals chosen because that matches the current
base value precision: 1.0001

Signed-off-by: meows <[email protected]>
Forgot to actually plug this in.

Signed-off-by: meows <[email protected]>
One order of magnitude greater than the exponent's
base of 1.0001.

Signed-off-by: meows <[email protected]>
The sinusoidal function seems the most desirable.

This changeset also includes a shallow threshold
of 3 blocks, returning positive acceptance with
difficulty is equivalent.
This is intended to sidestep negative impacts on uncle
rates.

Signed-off-by: meows <[email protected]>
This commit created by checkouting core/
package at development commit 0b162cd.

Signed-off-by: meows <[email protected]>
Also improves a graph generated by a test.

This commit was created by gitcheckouting
development commit 01406c7.

Signed-off-by: meows <[email protected]>
This is just for documentation and reference, doing the sam
e math but with different var types.

Signed-off-by: meows <[email protected]>
…for curve domain

This drastically changes the canonical allowance,
truncating it to a hard about 30 blocks.

Signed-off-by: meows <[email protected]>
This would present an exploit where the adversary
would simply use the etherbase(s) of powerful
honest miners to get them to permit the reorg.

Signed-off-by: meows <[email protected]>
This just keeps things lean and mean.

The int64 was a precursor to the function which is
now using big.Ints

Signed-off-by: meows <[email protected]>
This just rearranges to put importanter stuff
on top, and to move the development tests
and plotters toward the bottom.

Signed-off-by: meows <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants