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

specs: add oracle specification doc #1941

Merged
merged 11 commits into from
Feb 19, 2025
Merged

specs: add oracle specification doc #1941

merged 11 commits into from
Feb 19, 2025

Conversation

noot
Copy link
Collaborator

@noot noot commented Jan 31, 2025

Summary

add oracle specification which details how the oracle protocol works, the types and functions changed, changes to the sequencer app and conductor.

Related Issues

closes #1890

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 31, 2025
@noot noot marked this pull request as ready for review February 13, 2025 16:36
@noot noot requested a review from a team as a code owner February 13, 2025 16:36
@noot noot requested a review from warhod February 13, 2025 16:36
Copy link
Contributor

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

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

Just a few nitpicks, but otherwise LGTM.

specs/oracle.md Outdated
## High level overview

Astria uses CometBFT for consensus, which communicates with the application
logic using [ABCI++](https://docs.cometbft.com/v0.37/spec/abci/abci++_basic_concepts#consensusblock-execution-methods).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logic using [ABCI++](https://docs.cometbft.com/v0.37/spec/abci/abci++_basic_concepts#consensusblock-execution-methods).
logic using [ABCI++](https://docs.cometbft.com/v0.38/spec/abci/abci++_basic_concepts#consensusblock-execution-methods).

specs/oracle.md Outdated

The overall price for a currency pair is calculated by using the voting-power-weighted
median of the prices posted by each validator. This way, one malfunctioning validator
should not be able to affect the resulting aggregated price.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
should not be able to affect the resulting aggregated price.
should not be able to significantly affect the resulting aggregated price.

specs/oracle.md Outdated

```rust
pub struct ExtendedCommitInfoWithCurrencyPairMapping {
// the entire set of vote extensions finalized in the sequencer block.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// the entire set of vote extensions finalized in the sequencer block.
/// The entire set of vote extensions finalized in the sequencer block.

specs/oracle.md Outdated
Comment on lines 87 to 88
// mapping of currency pair ID (since vote extensions contain only ID->price)
// to the currency pair and its price decimals.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// mapping of currency pair ID (since vote extensions contain only ID->price)
// to the currency pair and its price decimals.
/// Mapping of currency pair ID (since vote extensions contain only ID->price)
/// to the currency pair and its price decimals.

specs/oracle.md Outdated
}
```

The price data is set to the rollup as a `RollupData::OracleData` variant, which
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The price data is set to the rollup as a `RollupData::OracleData` variant, which
The price data is sent to the rollup as a `RollupData::OracleData` variant, which

specs/oracle.md Outdated

#### `process_proposal`

Other validators receive the proposed block in [`process_proposal`](https://github.com/astriaorg/astria/blob/b2083b4a82195dc9be1e85f31cea14c724b8b4ec/crates/astria-sequencer/src/app/vote_extension.rs#L271).
Copy link
Contributor

Choose a reason for hiding this comment

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

This links to validate_proposal - might be worthwhile renaming process_proposal in this doc throughout (but maybe mention validate_proposal is called during process proposal?

@noot noot merged commit 7cd711b into feat/oracle Feb 19, 2025
45 checks passed
@noot noot deleted the noot/oracle-spec branch February 19, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants