-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add subscription and handler for upgrade oracle event #61
Conversation
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.
lgtm
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.
Thank you.
I have an one comment.
approvalMsg := &oracletypes.ApprovalSharingOracleKey{ | ||
UniqueId: approverUniqueID, | ||
ApproverOracleAddress: approverAddress, | ||
TargetOracleAddress: targetAddress, |
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 think we need to targetOracleUniqueID
field in ApprovalSharingOracleKey
struct.
This message should include the uniqueID of the target to be upgraded so that panacea-core can find it.
That is, it is a confirmation that this request is for the current upgrade target.
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.
That's good point. It'd be better to include target unique ID and compare 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.
I'll make an issue in both core and oracle, and then handle it as another PR.
Thank you for your comments.
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.
Wait, if the targetOracleUniqueID
is to enable panacea to find unique ID, there is no need to add it.
panacea can get(find) unique ID of target uniqueID using GetOracleUpgradeInfo
.
I'll think a little more about whether this is really necessary.
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.
In my opinion, as @gyuguen said, it would be better to include TargetOracleUniqueID
in ApprovalSharingOracleKey
struct.
It's not a critical point because oracle checks the unique ID from upgrade-oracle event is equal to the current unique ID of upgrade version of oracle.
However, assuming that oracle and core do not believe each other, the unique ID check should also been done in core side.
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. As you said, the value can be got from OracleUpgradeInfo
.
But I think we will check if the request for Approval is really the uniqueID currently upgrading to.
If it is determined that this validation is not important, the TargetOracleUniqueID
need not be added. :)
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 also think it's good to add.
made an issue 👍
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.
LGTM 👍
…de-oracle # Conflicts: # go.mod # go.sum # panacea/query_client.go # server/middleware/auth_test.go
62e1b4d
to
108c845
Compare
close #58
With implementation, I did some refactoring:
verifyTrustedBlockInfo
to the function ofverifiedQueryClient
struct.event/oracle/event.go
to reuse inOracleUpgradeEvent
.