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

Update sequencer #272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 16 additions & 132 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ members = [
]

[workspace.dependencies]
contract-bindings = { git = "https://github.com/EspressoSystems/espresso-sequencer.git", branch = "gg/1047" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.0.10" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.19" }
contract-bindings = { git = "https://github.com/EspressoSystems/espresso-sequencer.git", branch = "main" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.0.13" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.20" }
jf-primitives = { git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.0" }
sequencer = { git = "https://github.com/EspressoSystems/espresso-sequencer.git", branch = "gg/1047" }
sequencer-utils = { git = "https://github.com/EspressoSystems/espresso-sequencer.git", branch = "gg/1047" }
sequencer = { git = "https://github.com/EspressoSystems/espresso-sequencer.git", branch = "main" }
sequencer-utils = { git = "https://github.com/EspressoSystems/espresso-sequencer.git", branch = "main" }
4 changes: 2 additions & 2 deletions polygon-zkevm-adaptor/src/json_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ use ethers::{
};
use http_types::{headers::HeaderValue, Url};
use jsonrpc_v2::{Data, Error as RpcError, MapRouter, Params, RequestObject, Server};
use sequencer::{Transaction, VmId};
use sequencer::{NamespaceId, Transaction};
use surf_disco::error::ClientError;
use tide::security::{CorsMiddleware, Origin};

pub type RpcApiService = Arc<Server<MapRouter>>;
pub type RpcServer = tide::Server<RpcApiService>;
pub type RpcServerRequest = tide::Request<RpcApiService>;

pub type RpcData = (Url, VmId);
pub type RpcData = (Url, NamespaceId);

/// Handle incoming HTTP JSON RPC requests.
pub async fn handle_http_request(mut request: RpcServerRequest) -> tide::Result {
Expand Down
30 changes: 12 additions & 18 deletions polygon-zkevm-adaptor/src/query_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,13 @@ mod test {
use async_compatibility_layer::logging::{setup_backtrace, setup_logging};
use async_std::task::spawn;
use ethers::{prelude::*, types::transaction::eip2718::TypedTransaction};
use futures::future::ready;
use futures::future::{ready, FutureExt};
use portpicker::pick_unused_port;
use rand_chacha::{rand_core::SeedableRng, ChaChaRng};
use sequencer::{
api::{self, options},
context::SequencerContext,
persistence::fs,
Vm,
testing::TestConfig,
};
use sequencer_utils::AnvilOptions;
use std::str::FromStr;
Expand All @@ -168,8 +167,14 @@ mod test {
.await;

// Start a sequencer network.
let nodes = sequencer::testing::init_hotshot_handles().await;
let api_node = nodes[0].clone();
let cfg = TestConfig::default();
let mut nodes = cfg.init_nodes().await;
for node in &nodes {
node.start_consensus().await;
}
let handle = nodes[0].consensus().clone();

// Start query service.
let sequencer_store = TempDir::new().unwrap();
api::Options::from(options::Http {
port: sequencer_port,
Expand All @@ -180,20 +185,9 @@ mod test {
path: sequencer_store.path().into(),
},
)
.serve(Box::new(move |_| {
ready(SequencerContext::new(
api_node,
0,
Default::default(),
Default::default(),
))
.boxed()
}))
.serve(move |_| ready(nodes.remove(0)).boxed())
.await
.unwrap();
for node in &nodes {
node.hotshot.start_consensus().await;
}

// Start the query service adaptor.
let opt = Options {
Expand Down Expand Up @@ -229,7 +223,7 @@ mod test {
let txn = EvmTransaction::new(txn, sig);

// Sequence the transaction.
nodes[0].submit_transaction(zkevm.wrap(&txn)).await.unwrap();
handle.submit_transaction(zkevm.wrap(&txn)).await.unwrap();

// Wait for it to be sequenced.
let expected = encode_transactions(vec![&txn]);
Expand Down
Loading
Loading