File tree 3 files changed +24
-3
lines changed
crates/op-rbuilder/src/integration
3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,24 @@ mod tests {
125
125
. await ?
126
126
. expect ( "block" ) ;
127
127
128
- // blocks should only include two
129
- println ! ( "block: {:?}" , block. transactions. len( ) ) ;
128
+ // blocks should only include two transactions (deposit + builder)
129
+ assert_eq ! ( block. transactions. len( ) , 2 ) ;
130
+ }
131
+
132
+ // check that the builder emitted logs for the reverted transactions
133
+ // with the monitoring logic
134
+ // TODO: this is not ideal, lets find a different way to detect this
135
+ // Each time a transaction is dropped, it emits a log like this
136
+ // 'Transaction event received target="monitoring" tx_hash="<tx_hash>" kind="discarded"'
137
+ let builder_logs = std:: fs:: read_to_string ( harness. builder_log_path ) ?;
138
+
139
+ for txn in pending_txn {
140
+ let txn_log = format ! (
141
+ "Transaction event received target=\" monitoring\" tx_hash=\" {}\" kind=\" discarded\" " ,
142
+ txn. tx_hash( )
143
+ ) ;
144
+
145
+ assert ! ( builder_logs. contains( txn_log. as_str( ) ) ) ;
130
146
}
131
147
132
148
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -270,16 +270,19 @@ impl TestHarnessBuilder {
270
270
271
271
framework. start ( "op-reth" , & reth) . await . unwrap ( ) ;
272
272
273
- let _ = framework
273
+ let builder = framework
274
274
. start ( "op-rbuilder" , & op_rbuilder_config)
275
275
. await
276
276
. unwrap ( ) ;
277
277
278
+ let builder_log_path = builder. log_path . clone ( ) ;
279
+
278
280
Ok ( TestHarness {
279
281
_framework : framework,
280
282
builder_auth_rpc_port,
281
283
builder_http_port,
282
284
validator_auth_rpc_port,
285
+ builder_log_path,
283
286
} )
284
287
}
285
288
}
@@ -289,6 +292,7 @@ pub struct TestHarness {
289
292
builder_auth_rpc_port : u16 ,
290
293
builder_http_port : u16 ,
291
294
validator_auth_rpc_port : u16 ,
295
+ builder_log_path : PathBuf ,
292
296
}
293
297
294
298
impl TestHarness {
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ impl Service for OpRbuilderConfig {
118
118
. arg ( "--disable-discovery" )
119
119
. arg ( "--color" )
120
120
. arg ( "never" )
121
+ . arg ( "--builder.log-pool-transactions" )
121
122
. arg ( "--port" )
122
123
. arg ( self . network_port . expect ( "network_port not set" ) . to_string ( ) )
123
124
. arg ( "--ipcdisable" ) ;
You can’t perform that action at this time.
0 commit comments