From 4290732e14dc0142e847f9d665ee019b0e7dae6d Mon Sep 17 00:00:00 2001 From: refcell Date: Mon, 26 Aug 2024 07:52:56 -0400 Subject: [PATCH] feat(rpc): setup an op-rpc crate --- Cargo.lock | 254 +++++++++++++++++++++++++----------------- Cargo.toml | 5 + crates/rpc/Cargo.toml | 25 +++++ crates/rpc/src/lib.rs | 7 ++ crates/rpc/src/rpc.rs | 38 +++++++ 5 files changed, 228 insertions(+), 101 deletions(-) create mode 100644 crates/rpc/Cargo.toml create mode 100644 crates/rpc/src/lib.rs create mode 100644 crates/rpc/src/rpc.rs diff --git a/Cargo.lock b/Cargo.lock index 943db0c..d32061f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3402,7 +3402,7 @@ dependencies = [ "kona-primitives", "lru", "miniz_oxide 0.7.4", - "op-alloy-consensus", + "op-alloy-consensus 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest", "revm", "serde", @@ -3424,7 +3424,7 @@ dependencies = [ "anyhow", "c-kzg", "hashbrown 0.14.5", - "op-alloy-consensus", + "op-alloy-consensus 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "revm", "serde", "sha2 0.10.8", @@ -4224,6 +4224,57 @@ dependencies = [ "serde", ] +[[package]] +name = "op-alloy-consensus" +version = "0.1.5" +source = "git+https://github.com/alloy-rs/op-alloy?branch=main#68f5f26301e025792c3fa61d1db06772554e3f4f" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "derive_more 0.99.18", + "serde", +] + +[[package]] +name = "op-alloy-rpc-jsonrpsee" +version = "0.1.5" +source = "git+https://github.com/alloy-rs/op-alloy?branch=main#68f5f26301e025792c3fa61d1db06772554e3f4f" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "jsonrpsee", + "op-alloy-rpc-types", +] + +[[package]] +name = "op-alloy-rpc-types" +version = "0.1.5" +source = "git+https://github.com/alloy-rs/op-alloy?branch=main#68f5f26301e025792c3fa61d1db06772554e3f4f" +dependencies = [ + "alloy-network", + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "op-alloy-consensus 0.1.5 (git+https://github.com/alloy-rs/op-alloy?branch=main)", + "serde", + "serde_json", +] + +[[package]] +name = "op-rpc" +version = "0.0.0" +dependencies = [ + "alloy-eips", + "async-trait", + "jsonrpsee", + "op-alloy-rpc-jsonrpsee", + "op-alloy-rpc-types", + "tracing", +] + [[package]] name = "op-rs" version = "0.1.0" @@ -5009,7 +5060,7 @@ dependencies = [ [[package]] name = "reth" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "aquamarine", @@ -5089,7 +5140,7 @@ dependencies = [ [[package]] name = "reth-auto-seal-consensus" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures-util", "reth-beacon-consensus", @@ -5116,7 +5167,7 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "futures-core", @@ -5139,7 +5190,7 @@ dependencies = [ [[package]] name = "reth-beacon-consensus" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures", "itertools 0.13.0", @@ -5173,7 +5224,7 @@ dependencies = [ [[package]] name = "reth-blockchain-tree" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "aquamarine", "linked_hash_set", @@ -5204,7 +5255,7 @@ dependencies = [ [[package]] name = "reth-blockchain-tree-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -5216,7 +5267,7 @@ dependencies = [ [[package]] name = "reth-chain-state" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "auto_impl", "derive_more 1.0.0", @@ -5238,7 +5289,7 @@ dependencies = [ [[package]] name = "reth-chainspec" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-chains", "alloy-eips", @@ -5258,7 +5309,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "ahash", "backon", @@ -5312,7 +5363,7 @@ dependencies = [ [[package]] name = "reth-cli-runner" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-tasks", "tokio", @@ -5322,7 +5373,7 @@ dependencies = [ [[package]] name = "reth-cli-util" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-eips", "alloy-primitives", @@ -5337,7 +5388,7 @@ dependencies = [ [[package]] name = "reth-codecs" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5353,7 +5404,7 @@ dependencies = [ [[package]] name = "reth-codecs-derive" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -5364,7 +5415,7 @@ dependencies = [ [[package]] name = "reth-config" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "eyre", "humantime-serde", @@ -5378,7 +5429,7 @@ dependencies = [ [[package]] name = "reth-consensus" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "auto_impl", "derive_more 1.0.0", @@ -5388,7 +5439,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-chainspec", "reth-consensus", @@ -5398,7 +5449,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5421,7 +5472,7 @@ dependencies = [ [[package]] name = "reth-db" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "bytes", "derive_more 1.0.0", @@ -5451,7 +5502,7 @@ dependencies = [ [[package]] name = "reth-db-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "bytes", "derive_more 1.0.0", @@ -5472,7 +5523,7 @@ dependencies = [ [[package]] name = "reth-db-common" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-genesis", "boyer-moore-magiclen", @@ -5498,7 +5549,7 @@ dependencies = [ [[package]] name = "reth-db-models" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "bytes", "modular-bitfield", @@ -5510,7 +5561,7 @@ dependencies = [ [[package]] name = "reth-discv4" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -5534,7 +5585,7 @@ dependencies = [ [[package]] name = "reth-discv5" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -5560,7 +5611,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "data-encoding", @@ -5582,7 +5633,7 @@ dependencies = [ [[package]] name = "reth-downloaders" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "futures", @@ -5609,7 +5660,7 @@ dependencies = [ [[package]] name = "reth-ecies" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "aes 0.8.4", "alloy-primitives", @@ -5640,7 +5691,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-chainspec", "reth-payload-primitives", @@ -5650,7 +5701,7 @@ dependencies = [ [[package]] name = "reth-engine-service" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures", "pin-project", @@ -5674,7 +5725,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures", "metrics", @@ -5709,7 +5760,7 @@ dependencies = [ [[package]] name = "reth-engine-util" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "eyre", "futures", @@ -5738,7 +5789,7 @@ dependencies = [ [[package]] name = "reth-errors" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-blockchain-tree-api", "reth-consensus", @@ -5751,7 +5802,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "bytes", @@ -5776,7 +5827,7 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-chains", "alloy-genesis", @@ -5792,7 +5843,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-chainspec", "reth-consensus", @@ -5804,7 +5855,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "reth-chainspec", @@ -5822,7 +5873,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-chains", "alloy-primitives", @@ -5839,7 +5890,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-basic-payload-builder", "reth-errors", @@ -5858,7 +5909,7 @@ dependencies = [ [[package]] name = "reth-etl" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "rayon", "reth-db-api", @@ -5868,7 +5919,7 @@ dependencies = [ [[package]] name = "reth-evm" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-eips", "auto_impl", @@ -5886,7 +5937,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-eips", "alloy-sol-types", @@ -5904,7 +5955,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-eips", "alloy-primitives", @@ -5920,7 +5971,7 @@ dependencies = [ [[package]] name = "reth-execution-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-execution-errors", "reth-primitives", @@ -5932,7 +5983,7 @@ dependencies = [ [[package]] name = "reth-exex" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "eyre", "futures", @@ -5959,7 +6010,7 @@ dependencies = [ [[package]] name = "reth-exex-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "reth-provider", @@ -5969,7 +6020,7 @@ dependencies = [ [[package]] name = "reth-fs-util" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "serde", "serde_json", @@ -5979,7 +6030,7 @@ dependencies = [ [[package]] name = "reth-ipc" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "async-trait", "bytes", @@ -6000,7 +6051,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -6016,7 +6067,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "bindgen", "cc", @@ -6025,7 +6076,7 @@ dependencies = [ [[package]] name = "reth-metrics" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures", "metrics", @@ -6037,7 +6088,7 @@ dependencies = [ [[package]] name = "reth-metrics-derive" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "proc-macro2", "quote", @@ -6048,7 +6099,7 @@ dependencies = [ [[package]] name = "reth-net-banlist" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", ] @@ -6056,7 +6107,7 @@ dependencies = [ [[package]] name = "reth-net-nat" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures-util", "reqwest", @@ -6068,7 +6119,7 @@ dependencies = [ [[package]] name = "reth-network" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "aquamarine", @@ -6116,7 +6167,7 @@ dependencies = [ [[package]] name = "reth-network-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "alloy-rpc-types-admin", @@ -6139,7 +6190,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "auto_impl", "derive_more 1.0.0", @@ -6157,7 +6208,7 @@ dependencies = [ [[package]] name = "reth-network-peers" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -6172,7 +6223,7 @@ dependencies = [ [[package]] name = "reth-network-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "humantime-serde", "reth-ethereum-forks", @@ -6186,7 +6237,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "anyhow", "bincode", @@ -6206,7 +6257,7 @@ dependencies = [ [[package]] name = "reth-node-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-chainspec", "reth-db-api", @@ -6224,7 +6275,7 @@ dependencies = [ [[package]] name = "reth-node-builder" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-network", "aquamarine", @@ -6281,7 +6332,7 @@ dependencies = [ [[package]] name = "reth-node-core" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-genesis", "alloy-rpc-types-engine", @@ -6331,7 +6382,7 @@ dependencies = [ [[package]] name = "reth-node-ethereum" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "eyre", "reth-auto-seal-consensus", @@ -6355,7 +6406,7 @@ dependencies = [ [[package]] name = "reth-node-events" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rpc-types-engine", "futures", @@ -6377,7 +6428,7 @@ dependencies = [ [[package]] name = "reth-node-metrics" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "eyre", "http", @@ -6401,12 +6452,12 @@ dependencies = [ [[package]] name = "reth-optimism-primitives" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" [[package]] name = "reth-payload-builder" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures-util", "metrics", @@ -6428,7 +6479,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-chain-state", "reth-chainspec", @@ -6444,7 +6495,7 @@ dependencies = [ [[package]] name = "reth-payload-validator" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "reth-chainspec", "reth-primitives", @@ -6455,8 +6506,9 @@ dependencies = [ [[package]] name = "reth-primitives" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ + "alloy-consensus", "alloy-eips", "alloy-genesis", "alloy-primitives", @@ -6484,7 +6536,7 @@ dependencies = [ [[package]] name = "reth-primitives-traits" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6504,7 +6556,7 @@ dependencies = [ [[package]] name = "reth-provider" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rpc-types-engine", "auto_impl", @@ -6542,7 +6594,7 @@ dependencies = [ [[package]] name = "reth-prune" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "itertools 0.13.0", @@ -6568,7 +6620,7 @@ dependencies = [ [[package]] name = "reth-prune-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "bytes", @@ -6582,7 +6634,7 @@ dependencies = [ [[package]] name = "reth-revm" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-eips", "reth-chainspec", @@ -6598,7 +6650,7 @@ dependencies = [ [[package]] name = "reth-rpc" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-dyn-abi", "alloy-genesis", @@ -6654,7 +6706,7 @@ dependencies = [ [[package]] name = "reth-rpc-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-json-rpc", "jsonrpsee", @@ -6668,7 +6720,7 @@ dependencies = [ [[package]] name = "reth-rpc-builder" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "http", "jsonrpsee", @@ -6701,7 +6753,7 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "async-trait", "jsonrpsee-core", @@ -6729,7 +6781,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-dyn-abi", "alloy-json-rpc", @@ -6765,7 +6817,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-sol-types", "derive_more 1.0.0", @@ -6803,7 +6855,7 @@ dependencies = [ [[package]] name = "reth-rpc-layer" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rpc-types-engine", "http", @@ -6816,7 +6868,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "jsonrpsee-core", @@ -6832,7 +6884,7 @@ dependencies = [ [[package]] name = "reth-rpc-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -6850,7 +6902,7 @@ dependencies = [ [[package]] name = "reth-rpc-types-compat" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "alloy-rpc-types", @@ -6862,7 +6914,7 @@ dependencies = [ [[package]] name = "reth-stages" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "futures-util", "itertools 0.13.0", @@ -6896,7 +6948,7 @@ dependencies = [ [[package]] name = "reth-stages-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "aquamarine", @@ -6923,7 +6975,7 @@ dependencies = [ [[package]] name = "reth-stages-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "bytes", @@ -6936,7 +6988,7 @@ dependencies = [ [[package]] name = "reth-static-file" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "parking_lot 0.12.3", @@ -6956,7 +7008,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-primitives", "clap", @@ -6968,7 +7020,7 @@ dependencies = [ [[package]] name = "reth-storage-api" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "auto_impl", "reth-chainspec", @@ -6985,7 +7037,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "derive_more 1.0.0", @@ -6996,7 +7048,7 @@ dependencies = [ [[package]] name = "reth-tasks" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "auto_impl", "dyn-clone", @@ -7014,7 +7066,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "tokio", "tokio-stream", @@ -7024,7 +7076,7 @@ dependencies = [ [[package]] name = "reth-tracing" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "clap", "eyre", @@ -7039,7 +7091,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "aquamarine", @@ -7071,7 +7123,7 @@ dependencies = [ [[package]] name = "reth-trie" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "auto_impl", @@ -7093,7 +7145,7 @@ dependencies = [ [[package]] name = "reth-trie-common" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-consensus", "alloy-genesis", @@ -7113,7 +7165,7 @@ dependencies = [ [[package]] name = "reth-trie-db" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "auto_impl", @@ -7137,7 +7189,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" version = "1.0.5" -source = "git+https://github.com/paradigmxyz/reth#dfcfe8d27166124324ba907d487ab7c27163373d" +source = "git+https://github.com/paradigmxyz/reth#709e7b73ce95bfe10ff757f0bd875edfb3c60a41" dependencies = [ "alloy-rlp", "derive_more 1.0.0", diff --git a/Cargo.toml b/Cargo.toml index 8465434..d6b07d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ members = [ "bin/op-rs", "crates/kona-providers", "crates/rollup", + "crates/rpc", "crates/ser", ] default-members = ["bin/hera"] @@ -129,10 +130,14 @@ alloy = { version = "0.2", features = [ "consensus", ] } alloy-rlp = "0.3.4" +alloy-eips = { version = "0.2", default-features = false } # Tokio tokio = { version = "1.21", default-features = false } +# rpc +jsonrpsee = { version = "0.24", features = ["jsonrpsee-core", "client-core", "server-core", "macros"] } + # Reth reth = { git = "https://github.com/paradigmxyz/reth", version = "1.0.5" } reth-chainspec = { git = "https://github.com/paradigmxyz/reth", version = "1.0.5" } diff --git a/crates/rpc/Cargo.toml b/crates/rpc/Cargo.toml new file mode 100644 index 0000000..bc8e810 --- /dev/null +++ b/crates/rpc/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "op-rpc" +description = "Consensus RPC for Rollup Nodes" +version = "0.0.0" +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +# op-alloy +# op-alloy-rpc-jsonrpsee isn't published yet, so we need to use the git version +op-alloy-rpc-jsonrpsee = { git = "https://github.com/alloy-rs/op-alloy", branch = "main", features = ["client"] } +op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", branch = "main" } + +# Alloy +alloy-eips.workspace = true + +# Misc +tracing.workspace = true +jsonrpsee.workspace = true +async-trait.workspace = true diff --git a/crates/rpc/src/lib.rs b/crates/rpc/src/lib.rs new file mode 100644 index 0000000..af0b716 --- /dev/null +++ b/crates/rpc/src/lib.rs @@ -0,0 +1,7 @@ +//! Consensus RPC for Rollup Nodes + +#![doc(issue_tracker_base_url = "https://github.com/paradigmxyz/op-rs/issues/")] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(not(test), warn(unused_crate_dependencies))] + +pub mod rpc; diff --git a/crates/rpc/src/rpc.rs b/crates/rpc/src/rpc.rs new file mode 100644 index 0000000..60de00d --- /dev/null +++ b/crates/rpc/src/rpc.rs @@ -0,0 +1,38 @@ +//! Contains the RPC Definition + +use alloy_eips::BlockNumberOrTag; +use async_trait::async_trait; +use jsonrpsee::core::RpcResult; +use op_alloy_rpc_jsonrpsee::traits::RollupNodeServer; +use op_alloy_rpc_types::{config::RollupConfig, output::OutputResponse, sync::SyncStatus}; +use tracing::trace; + +/// An implementation of the [`RollupNode`] trait. +#[derive(Debug, Clone)] +pub struct RollupNodeRpc { + /// The version of the node. + version: String, +} + +#[async_trait] +impl RollupNodeServer for RollupNodeRpc { + async fn op_output_at_block( + &self, + block_number: BlockNumberOrTag, + ) -> RpcResult { + trace!("op_output_at_block: {:?}", block_number); + unimplemented!() + } + + async fn op_sync_status(&self) -> RpcResult { + unimplemented!() + } + + async fn op_rollup_config(&self) -> RpcResult { + unimplemented!() + } + + async fn op_version(&self) -> RpcResult { + Ok(self.version.clone()) + } +}