-
Notifications
You must be signed in to change notification settings - Fork 215
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
[Merged by Bors] - Detect double PoST inclusion malfeasance #6117
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6117 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 308 308
Lines 33795 33843 +48
=======================================
+ Hits 27705 27750 +45
- Misses 4318 4319 +1
- Partials 1772 1774 +2 ☔ View full report in Codecov by Sentry. |
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.
Looks good, might want convert SQL to use INNER JOIN
db := sql.InMemory() | ||
|
||
// one atx | ||
atx0, blob := newAtx(t, sig, withPublishEpoch(1)) |
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.
newAtx
returns a wire.ActivationTxV1
as blob. I think newAtx
doesn't need to return any wire type for the tests here, if a blob is needed for a test it should generally be possible to just use types.RandomBytes(20)
since the blob should not be needed to be decoded in any test in this package.
Wdyt?
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 wouldn't say I like returning a fake value when a real one is so easy to use. It's a footgun waiting to shoot somebody in the future. However, the blob could be obtained by calling atx0.Blob()
, so we can only return the ATX.
I will refactor it to return only ATX in a separate PR.
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.
The problem I see with returning a real value is that for this we probably will need a dependency on activation
and/or activation/wire
but sql
packages shouldn't depend on those (cyclic dependencies). Using xxx_test
packages for tests is a way around this, but since sql packages can't even decode the bytes by themselves I don't see an issue with faking the bytes that are stored / returned in tests.
bors merge |
## Motivation With ATX merge, a dishonest smesher might try to include his PoST twice for doubled rewards: - once in a merged ATX (published by another identity) - once in a self-published ATX
Build failed: |
bors merge |
## Motivation With ATX merge, a dishonest smesher might try to include his PoST twice for doubled rewards: - once in a merged ATX (published by another identity) - once in a self-published ATX
Build failed (retrying...): |
## Motivation With ATX merge, a dishonest smesher might try to include his PoST twice for doubled rewards: - once in a merged ATX (published by another identity) - once in a self-published ATX
Build failed: |
bors merge |
## Motivation With ATX merge, a dishonest smesher might try to include his PoST twice for doubled rewards: - once in a merged ATX (published by another identity) - once in a self-published ATX
Pull request successfully merged into develop. Build succeeded: |
Motivation
With ATX merge, a dishonest smesher might try to include his PoST twice for doubled rewards:
Description
Detect if any of the IDs participating in the processed ATX has already contributed its PoST to another ATX in the epoch
💡 This PR doesn't implement the malfeasance proof, just malfeasance detection. The proof is stubbed and will come in a later PR.
Test Plan
added tests
TODO