Skip to content
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 oracle upgrade endblocker #578

Merged
merged 18 commits into from
Jan 3, 2023
Merged

Conversation

audtlr24
Copy link
Contributor

closes #570 .

  • TODO: add a part to update Oracle in ApplyOracle

Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

@inchori inchori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

x/oracle/abci.go Outdated
if err := keeper.ApplyUpgrade(ctx, upgradeInfo); err != nil {
panic(err)
}
keeper.RemoveOracleUpgradeInfo(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about not deleting the upgrade info?
When a new upgrade proposal passes, it will be overwritten anyway.

The reason I'm talking about this is because of the following case:

If the oracles didn't upgrade until the target height, they had to re-request register-oracle transaction again to be shared the oracle private key in the new binary(upgrade version).
However, at this time, the oracles will be able to enter the commission rate, which overwrites the existing oracle commission rate.
In other words, this case should also be done through upgrade-oracle, and to do so, it seems that upgrade info should be left. upgrade info will mean upcoming or recent upgrade information.

--
FYI) Plus, in register-oracle, the check that if the oracle has already been set or not should be added.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea.
Then, how about OracleKeyMigration rather than a name OracleUpgrade?
OracleKeyMigration works only when it has the same value as uniqueID of OracleUpgradeInfo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, please forget the name change. I'll think about it more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I understand the problem.
If the oracles didn't upgrade until the target height, oracle operator have to use upgrade-oracle because the oracle is already in Oracle store.
For now, I think @H4NLee 's suggestion is the best way.

Copy link
Contributor

@gyuguen gyuguen Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you reflect this flow, please leave a comment :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it in 8e1a3d8.

Base automatically changed from ft/569/oracle-upgrade-handler to main January 3, 2023 01:57
…cker

# Conflicts:
#	proto/panacea/oracle/v2/query.proto
#	x/oracle/keeper/upgrade.go
#	x/oracle/keeper/upgrade_test.go
x/oracle/types/oracle.go Outdated Show resolved Hide resolved
Copy link
Contributor

@gyuguen gyuguen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Please check my review.

Co-authored-by: gyuguen <gyuguen.jang@medibloc.org>
@audtlr24 audtlr24 merged commit c8132b2 into main Jan 3, 2023
@audtlr24 audtlr24 deleted the ft/570/upgrade-endblocker branch January 3, 2023 08:38
Copy link
Contributor

@youngjoon-lee youngjoon-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement oracle upgrade handler at endblocker
5 participants