-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,560 additions
and
172 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ members = ["crates/*"] | |
[workspace.package] | ||
edition = "2021" | ||
version = "0.0.1" | ||
authors = ["clabby"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
[package] | ||
name = "durin-fault" | ||
description = "Game solver for the OP Stack's FaultDisputeGame" | ||
authors = ["clabby"] | ||
resolver = "2" | ||
|
||
edition.workspace = true | ||
version.workspace = true | ||
authors.workspace = true | ||
|
||
[dependencies] | ||
# Internal | ||
durin-primitives = { path = "../primitives" } | ||
|
||
# External | ||
alloy-primitives = { version = "0.4.2" } | ||
alloy-sol-types = { version = "0.4.2" } | ||
anyhow = "1.0.75" | ||
|
||
alloy-primitives = "0.6.0" | ||
alloy-sol-types = "0.6.0" | ||
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy" } | ||
alloy-transport = { git = "https://github.com/alloy-rs/alloy" } | ||
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy" } | ||
anyhow = "1.0.79" | ||
|
||
# Async | ||
tokio = { version = "1.35.1", features = ["macros"] } | ||
url = "2.5.0" | ||
reqwest = "0.11.23" | ||
async-trait = "0.1.77" | ||
futures = "0.3.30" | ||
|
||
[dev-dependencies] | ||
proptest = "1.2.0" | ||
proptest = "1.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
//! This module contains the implementation of the [crate::TraceProvider] trait for the mock Alphabet VM. | ||
use crate::{Position, TraceProvider}; | ||
use alloy_rpc_client::RpcClient; | ||
use alloy_transport::TransportResult; | ||
use alloy_transport_http::Http; | ||
use anyhow::Result; | ||
use durin_primitives::Claim; | ||
use reqwest::{Client, Url}; | ||
use std::sync::Arc; | ||
|
||
/// The [OutputTraceProvider] is a [TraceProvider] that provides L2 output commitments relative to a [Position] in the | ||
/// output bisection portion of the dispute game. | ||
pub struct OutputTraceProvider { | ||
pub rpc_client: RpcClient<Http<Client>>, | ||
pub starting_block_number: u64, | ||
pub leaf_depth: u64, | ||
} | ||
|
||
impl OutputTraceProvider { | ||
pub fn try_new( | ||
l2_archive_url: String, | ||
starting_block_number: u64, | ||
leaf_depth: u64, | ||
) -> Result<Self> { | ||
let rpc_client = RpcClient::builder().reqwest_http(Url::parse(&l2_archive_url)?); | ||
Ok(Self { | ||
rpc_client, | ||
starting_block_number, | ||
leaf_depth, | ||
}) | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl TraceProvider<[u8; 32]> for OutputTraceProvider { | ||
async fn absolute_prestate(&self) -> anyhow::Result<Arc<[u8; 32]>> { | ||
todo!() | ||
// let transport_result: TransportResult<> = self.rpc_client.prepare("optimism_outputAtBlock", (self.starting_block_number)).await.map_err(|e| anyhow::anyhow!(e))? | ||
} | ||
|
||
async fn absolute_prestate_hash(&self) -> anyhow::Result<Claim> { | ||
todo!() | ||
} | ||
|
||
async fn state_at(&self, position: Position) -> anyhow::Result<Arc<[u8; 32]>> { | ||
todo!() | ||
} | ||
|
||
async fn state_hash(&self, position: Position) -> anyhow::Result<Claim> { | ||
todo!() | ||
} | ||
|
||
async fn proof_at(&self, _: Position) -> anyhow::Result<Arc<[u8]>> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.