-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
VerifyConsensusFault syscall impl #1534
Conversation
chain/vm/syscalls.go
Outdated
return nil, xerrors.Errorf("cannot decode extra: %w", decodeErr) | ||
} | ||
|
||
if types.CidArrsEqual(blockA.Parents, blockC.Parents) && blockA.Height == blockB.Height && |
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.
from what I'm reading, a.Height
and b.Height
will be always different in this case, code says something else.
also with that check it would be a more restricted case (a)
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.
ah typo, it is blockA.Height == blockC.Height
. Great catch.
Do you see how it's different from a?
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.
yeah, now it makes sense.
bdc8585
to
93a4c36
Compare
VerifyConsensusFault syscall impl
This impl is heavily based on the structure of https://github.com/filecoin-project/go-filecoin/blob/d75e700d2b5b116a794c3da672d6379bcb24b803/internal/pkg/slashing/check.go#L40.
A few things to note:
Contains
) based on CIDs rather than tipsets given the headers submitted toVerifyConsensusFault
may be invalid (and yet the faults themselves may not be).VerifySignature
instead of makingVerifyBlockSig