Skip to content

Commit

Permalink
🚧 Start preimage-oracle crate
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Sep 22, 2023
1 parent 8559eaf commit 7d136ce
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 2 deletions.
192 changes: 190 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions crates/preimage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "preimage-oracle"
description = "Bindings for interacting as a client or server over the Pre-image Oracle ABI"
edition = "2021"

version.workspace = true
authors.workspace = true

[dependencies]
alloy-primitives = "0.3.3"
once_cell = "1.18.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.106"
tokio = { version = "1.32.0", features = ["full"] }

# misc
anyhow = "1.0.75"
tracing = "0.1.37"

[features]
tracing = []
11 changes: 11 additions & 0 deletions crates/preimage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `preimage-oracle`

The `preimage-oracle` crate offers bindings to interact as client or sever over the Pre-image Oracle ABI.

Read more about the Preimage Oracle in the OP Stack [specs][specs].

See the OP Stack's [op-program][op-program] and [Cannon client examples](../../example) for client-side usage.
See [`mipsevm`](../mipsevm) for server-side usage.

[specs]: https://github.com/ethereum-optimism/optimism/blob/6c7f366a55febbb119aa0b02d73f008c1c909900/specs/fault-proof.md
[op-program]: https://github.com/ethereum-optimism/optimism/tree/develop/op-program
13 changes: 13 additions & 0 deletions crates/preimage/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#![doc = include_str!("../README.md")]
#![allow(dead_code, unused_variables)]

mod oracle;
// pub use oracle::{OracleClient, OracleServer};

mod traits;
pub use traits::{Hint, Hinter, Key, Oracle};

mod types;
pub use types::{
HinterFn, Keccak256Key, KeyType, LocalIndexKey, OracleFn, PreimageGetter, ReadWriterPair,
};
Loading

0 comments on commit 7d136ce

Please sign in to comment.