Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
c093f2f to
5464d82
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
0d3c902 to
cd6870a
Compare
- wip: feat: add OraclePriceTracker state machine. - wip: adding proper type trait. - feat: sketch of OP statemachine complete. - wip: implementing `generic_elections`. - chore: make it compile. - feat: first prototype implementation of oracle price witnessing ES. - feat: expose generic electoral rpcs. - feat: engine side scaffoling for oracle elections. - wip: try to call sol rpc from voter.
Previously we used the `request` which is not compatible with being called in elections since these have their own retry mechanism. Having infinite retries for rpc calls that always fail would mean that they would never be cleaned up.
… from the ES state.
cd6870a to
c4b37c9
Compare
…eSettings`. Note, does not compile yet because of missing values.
…ng allowed in const vars.
state-chain/pallets/cf-elections/src/electoral_systems/oracle_price/state_machine.rs
Show resolved
Hide resolved
state-chain/runtime/src/chainflip.rs
Outdated
| // TODO: is this how we will provide the prices to other pallets? | ||
| #[allow(dead_code)] | ||
| struct GenericElectionsEnvironment; |
There was a problem hiding this comment.
I think the answer here is that it might make sense to remove the 'elections' context from the naming of this and just provide a struct/trait like PriceFeedApi or something.
For example we could define a struct PriceFeed and impl PriceFeedApi for PriceFeed or something. This is better than using ChainEnvironment, which is a little too generic and vague.
|
I'm happy with this, will let @marcellorigotti review the state machine implementation since he's more familiar with this. After that let's merge. |
chore: update insta test for safemode serialization.
| pub struct Aggregated<A: AggregationValue> { | ||
| pub median: A, | ||
| pub iq_range: RangeInclusive<A>, | ||
| } |
There was a problem hiding this comment.
What is iq_range used for exactly? Is it only for testing?
There was a problem hiding this comment.
The idea is that it would be nice to have at least some insight into the distribution of votes. We could of course track the extrinsics as you do in the vote log script, but I thought it's easier if we track the value on-chain. So we can easily add it to the prometheus exporter.
There was a problem hiding this comment.
I see! I like the idea 👌
…t is higher than success threshold
… prices, explicit base and quote asset).
7ceda5b to
aa526ff
Compare
aa526ff to
6104769
Compare
| match self { | ||
| Btc => 8, | ||
| Eth => 12, | ||
| Eth => 18, |
* rpc * refactor: remove `get_latest_price` and replace occurences by `get_latest_asset_state`. * rpc --------- Co-authored-by: Maxim Urschumzew <maxu@chainflip.io>
d7d61b8 to
7ca2f33
Compare
7ca2f33 to
33a1df9
Compare
…reward * origin/main: feat: delegated staking auction integration (#6022) ci: improve secret passing 🥷 (#6042) feat: generate backspin chain spec (#6041) refactor: return `Ok(None)` instead of error if sol egress witnessing cannot find a tx (#6036) feat: add operator to validator info (#6040) feat: Support for DCA 1 block interval (#6025) feat: added account balance of operator (#6035) fix: remove race condition in bouncer observe event (#6023) fix: use `any::Asset` instead of `ChainlinkAssetpair` in internal price API (#6034) feat: price oracle elections (#5971) feat: don't error if tx is Confirmed (#6019) chore: process all events in a block in parallel (#6013)
Pull Request
Closes: PRO-2289
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
This PR adds another instantiation of the
electionspallet to the runtime, withI = (), calledGenericElections. It contains a single electoral system,ChainlinkOraclePriceESthat implements oracle price elections as described in the linear issue. There's a new safemode that stops the creation of oracle elections situated in theGenericElectionsinstantiation of the elections pallet.Features that are not part of this PR: