File tree Expand file tree Collapse file tree 4 files changed +37
-7
lines changed Expand file tree Collapse file tree 4 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,11 @@ test: ## Run the tests for rbuilder and op-rbuilder
5454.PHONY : lt
5555lt : lint test # # Run "lint" and "test"
5656
57+ # # TODO: use all features when tdx dependency is compatible with macOS
5758.PHONY : fmt
5859fmt : # # Format the code
5960 cargo +nightly fmt
60- cargo +nightly clippy --all -features --fix --allow-staged --allow-dirty
61+ cargo +nightly clippy --features ci -features --fix --allow-staged --allow-dirty
6162 cargo +nightly fix --allow-staged --allow-dirty
6263
6364.PHONY : bench
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ cargo run -p op-rbuilder --bin op-rbuilder -- node \
4747To run op-rbuilder with flashtestations:
4848
4949``` bash
50- cargo run -p op-rbuilder --bin op-rbuilder -- node \
50+ cargo run -p op-rbuilder --bin op-rbuilder --features=flashtestations -- node \
5151 --chain /path/to/chain-config.json \
5252 --http \
5353 --authrpc.port 9551 \
Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ hex = "0.4"
121121ureq = " 2.10"
122122
123123rollup-boost = { git = " https://github.com/flashbots/rollup-boost" , branch = " main" }
124- tdx = { git = " https://github.com/automata-network/tdx-attestation-sdk.git" }
125- dcap-rs = { git = " https://github.com/automata-network/dcap-rs.git" }
124+ tdx = { git = " https://github.com/automata-network/tdx-attestation-sdk.git" , optional = true }
125+ dcap-rs = { git = " https://github.com/automata-network/dcap-rs.git" , optional = true }
126126
127127dashmap = { version = " 6.1" , optional = true }
128128nanoid = { version = " 0.4" , optional = true }
@@ -175,7 +175,6 @@ min-info-logs = ["tracing/release_max_level_info"]
175175min-debug-logs = [" tracing/release_max_level_debug" ]
176176min-trace-logs = [" tracing/release_max_level_trace" ]
177177
178-
179178testing = [
180179 " dashmap" ,
181180 " nanoid" ,
@@ -187,13 +186,28 @@ testing = [
187186 " rlimit" ,
188187]
189188
190-
191189interop = []
192190
191+ flashtestations = [" dcap-rs" , " tdx" ]
192+
193193telemetry = [" reth-tracing-otlp" , " opentelemetry" ]
194194
195195custom-engine-api = []
196196
197+ ci-features = [
198+ " default" ,
199+ " jemalloc-prof" ,
200+ " min-error-logs" ,
201+ " min-warn-logs" ,
202+ " min-info-logs" ,
203+ " min-debug-logs" ,
204+ " min-trace-logs" ,
205+ " testing" ,
206+ " interop" ,
207+ " telemetry" ,
208+ " custom-engine-api" ,
209+ ]
210+
197211[[bin ]]
198212name = " op-rbuilder"
199213path = " src/bin/op-rbuilder/main.rs"
Original file line number Diff line number Diff line change 11use std:: io:: Read ;
2+ #[ cfg( feature = "flashtestations" ) ]
23use tdx:: { device:: DeviceOptions , Tdx } ;
34use tracing:: info;
45use ureq;
@@ -20,22 +21,26 @@ pub trait AttestationProvider {
2021}
2122
2223/// Real TDX hardware attestation provider
24+ #[ cfg( feature = "flashtestations" ) ]
2325pub struct TdxAttestationProvider {
2426 tdx : Tdx ,
2527}
2628
29+ #[ cfg( feature = "flashtestations" ) ]
2730impl Default for TdxAttestationProvider {
2831 fn default ( ) -> Self {
2932 Self :: new ( )
3033 }
3134}
3235
36+ #[ cfg( feature = "flashtestations" ) ]
3337impl TdxAttestationProvider {
3438 pub fn new ( ) -> Self {
3539 Self { tdx : Tdx :: new ( ) }
3640 }
3741}
3842
43+ #[ cfg( feature = "flashtestations" ) ]
3944impl AttestationProvider for TdxAttestationProvider {
4045 fn get_attestation ( & self , report_data : [ u8 ; 64 ] ) -> eyre:: Result < Vec < u8 > > {
4146 self . tdx
@@ -85,6 +90,16 @@ pub fn get_attestation_provider(
8590 . unwrap_or ( DEBUG_QUOTE_SERVICE_URL . to_string ( ) ) ,
8691 ) )
8792 } else {
88- Box :: new ( TdxAttestationProvider :: new ( ) )
93+ #[ cfg( feature = "flashtestations" ) ]
94+ {
95+ Box :: new ( TdxAttestationProvider :: new ( ) )
96+ }
97+ #[ cfg( not( feature = "flashtestations" ) ) ]
98+ {
99+ info ! ( "Using debug attestation provider as flashtestations feature is disabled" ) ;
100+ Box :: new ( DebugAttestationProvider :: new (
101+ DEBUG_QUOTE_SERVICE_URL . to_string ( ) ,
102+ ) )
103+ }
89104 }
90105}
You can’t perform that action at this time.
0 commit comments