-
Notifications
You must be signed in to change notification settings - Fork 22
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
chore: QueryFinalityProviderHasPower
returns false
if there is no public randomness
#150
Conversation
} | ||
|
||
// fp has 0 voting power if there is no public randomness at this height | ||
lastCommittedPubRandHeight := pubRand.StartHeight + pubRand.NumPubRand - 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.
Nit: pubRand.StartHeight + pubRand.NumPubRand - 1
can be a function EndHeight()
under pubRand
"FP last committed public randomness", | ||
zap.Uint64("height", lastCommittedPubRandHeight), | ||
) | ||
if blockHeight > lastCommittedPubRandHeight { |
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.
this is good but there is another case that this check won't cover
what if pubrand is not consecutive? so block 1-100 and 300-400 has PRs. if blockHeight
is 200, lastCommittedPubRandHeight
will be 400 and it should be considered not having VP
but this check doesn't cover it
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.
Good point as Babylon allows gaps. Better to add a TODO here.
Also, currently BTC-timestamping is not involved, right?
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.
yes it doesn't need to be in this PR. we can add a TODO
no currently BTC ts is not involved
go.mod
Outdated
// fix for `make build` error: invalid CFI advance_loc expression | ||
github.com/supranational/blst => github.com/supranational/blst v0.3.13 | ||
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 | ||
|
||
// avoid v1.66 that has a breaking change for protobuf. That change breaks the relayer. | ||
// https://github.com/grpc/grpc-go/issues/7569 | ||
google.golang.org/grpc => google.golang.org/grpc v1.65.0 | ||
// fix for `go mod tidy` error: unknown revision v1.8.6 | ||
nhooyr.io/websocket => github.com/coder/websocket v1.8.7 |
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.
just curious, why previous CI run never detect these?
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.
yes, i tested on a new server with ubuntu 22.04, and it works fine.
for go mod tidy
, i saw it automatically selects the appropriate version on this new server
go: downloading nhooyr.io/websocket v1.8.17
for make build
, the error "invalid CFI advance_loc expression" only occurs on x86 macOS using LLVM 17
so i will revert these changes.
Summary
This PR updates the function
QueryFinalityProviderHasPower
, it will returnfalse
if there is no public randomness at the queried height.More content: #115 (comment)
Test Plan
open the debug log in
op_test_manager.go
, line 74: zapcore.InfoLevel -> zapcore.DebugLevel, and then run e2e test:once it is done, it should have some debug logs, like this but the value of fp pk is different:
Note: For the op e2e test, there is a working branch
test/fix-fg-circular-dependency-e2e-tests