-
Notifications
You must be signed in to change notification settings - Fork 152
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
Block<T>.ProtocolVersion & BlockHeader.ProtocolVersion #1147
Conversation
4e7173c
to
8d36070
Compare
Codecov Report
@@ Coverage Diff @@
## main #1147 +/- ##
==========================================
- Coverage 87.60% 87.41% -0.20%
==========================================
Files 346 347 +1
Lines 30049 30292 +243
==========================================
+ Hits 26324 26479 +155
- Misses 2092 2112 +20
- Partials 1633 1701 +68
|
@planetarium/libplanet PTAL. |
Libplanet/Blocks/Block.cs
Outdated
@@ -126,9 +135,11 @@ public Block(Bencodex.Types.Dictionary dict) | |||
{ | |||
} | |||
|
|||
// FIXME: Should this be |
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.
Something is missing I guess...
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.
Completed the sentence.
8d36070
to
7cc31af
Compare
@planetarium/libplanet Rebased. PTAL. |
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.
I understand that libplanet separately control the flow of actions through protocol version management (this patch) instead of creating a new action file (i.e., Buy {2,3,4}.cs), am I right? -- for proper patching of planetarium/lib9c#248
If so, this PR looks OK for me. However, from an attacker's point of view, if an attacker has enough mining power, the block's previous version can continue to be mined even if the new protocol version introduces.
There are some mitigations for it:
- Set the maximum number of blocks(=limit) allowed with the previous protocol version.
- Like lib9c, use an authorized miner to introduce a new version.
- Change to a consensus algorithm to that selecting the next block proposer randomly.
- ...
7cc31af
to
1e2cb45
Compare
@junorouse Thanks for your review and suggestions!
Even if we don't merge this PR, that attackers can outpace honest nodes is the critical problem in itself and we need to address it as soon as possible. Therefore, IMHO we'd better deal with it in the separate issue/patches. |
1e2cb45
to
849e3c0
Compare
This implements #1142.