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

Oracle data integration #922

Merged
merged 14 commits into from
Aug 15, 2024
Merged

Oracle data integration #922

merged 14 commits into from
Aug 15, 2024

Conversation

JesseAbram
Copy link
Member

@JesseAbram JesseAbram commented Jul 3, 2024

This PR integrates oracle data into programs and implements block number as the first use case

  • All oracle data is determined by the chain (how is up to specific implementation)
  • Oracle data is stored in oracle_data in the Oracle pallet under a scale encoded key and scale encoded value (bounded vecs for both
  • upon running a sig request the oracle data location is pulled from the ProgramInfo in the Programs pallet to know what heading the specific oracle data is under
  • The data pulled from the chain is passed to the program for evaluation

Closes #789

@JesseAbram JesseAbram marked this pull request as ready for review July 4, 2024 21:28
@JesseAbram JesseAbram requested a review from HCastano July 4, 2024 21:28
Copy link
Contributor

@ameba23 ameba23 left a comment

Choose a reason for hiding this comment

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

I've read over this and it all looks good.

But on a high level im still a bit unclear on the use case for oracles and how users who want to add an oracle data source would do that.

Are oracles supposed to be something which is fetched or computed at the point of making a signature request, or would the chain constantly retrieve data regardless of whether signature requests are made?

.ok_or(UserErr::NoProgramDefined(program_pointer.to_string()))?
.bytecode)
.ok_or(UserErr::NoProgramDefined(program_pointer.to_string()))?;
Ok((program_info.bytecode, program_info.oracle_data_pointer))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it would be clearer to return program_info rather than a tuple


#[pallet::storage]
#[pallet::getter(fn oracle_data)]
// TODO: parameterize bounded vec constants
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make an issue

@JesseAbram
Copy link
Member Author

I've read over this and it all looks good.

But on a high level im still a bit unclear on the use case for oracles and how users who want to add an oracle data source would do that.

Are oracles supposed to be something which is fetched or computed at the point of making a signature request, or would the chain constantly retrieve data regardless of whether signature requests are made?

the second one, then it gets fed into the program based on how the program is written. It can be a lot of data, but the "end game" for this as of now would be super cool to get ibc proofs on chain and then be able to give a proof of the state of a chain verify it in a program and use it as a constraint

@JesseAbram JesseAbram merged commit 5d64794 into master Aug 15, 2024
8 checks passed
@JesseAbram JesseAbram deleted the oracle-integration branch August 15, 2024 21:30
@HCastano HCastano added the Bump `spec_version` A change which affects the current runtime behaviour label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bump `spec_version` A change which affects the current runtime behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate oracle data into programs
3 participants