Skip to content

Commit 10e28d9

Browse files
Skip memory intensive engine test (#2809)
* Allocate less memory (3GB) in engine tests * Run cargo format * Remove tx too large test Co-authored-by: Michael Sproul <[email protected]>
1 parent c8b535d commit 10e28d9

File tree

1 file changed

+5
-20
lines changed
  • beacon_node/execution_layer/src/engine_api

1 file changed

+5
-20
lines changed

beacon_node/execution_layer/src/engine_api/http.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ mod test {
569569
VariableList<Transaction<E::MaxBytesPerTransaction>, E::MaxTransactionsPerPayload>,
570570
serde_json::Error,
571571
> {
572-
let json = json!({
572+
let mut json = json!({
573573
"parentHash": HASH_00,
574574
"coinbase": ADDRESS_01,
575575
"stateRoot": HASH_01,
@@ -583,8 +583,11 @@ mod test {
583583
"extraData": "0x",
584584
"baseFeePerGas": "0x1",
585585
"blockHash": HASH_01,
586-
"transactions": transactions,
587586
});
587+
// Take advantage of the fact that we own `transactions` and don't need to reserialize it.
588+
json.as_object_mut()
589+
.unwrap()
590+
.insert("transactions".into(), transactions);
588591
let ep: JsonExecutionPayload<E> = serde_json::from_value(json)?;
589592
Ok(ep.transactions)
590593
}
@@ -671,24 +674,6 @@ mod test {
671674
decode_transactions::<MainnetEthSpec>(serde_json::to_value(too_many_txs).unwrap())
672675
.is_err()
673676
);
674-
675-
/*
676-
* Check for transaction too large
677-
*/
678-
679-
use eth2_serde_utils::hex;
680-
681-
let num_max_bytes = <MainnetEthSpec as EthSpec>::MaxBytesPerTransaction::to_usize();
682-
let max_bytes = (0..num_max_bytes).map(|_| 0_u8).collect::<Vec<_>>();
683-
let too_many_bytes = (0..=num_max_bytes).map(|_| 0_u8).collect::<Vec<_>>();
684-
decode_transactions::<MainnetEthSpec>(
685-
serde_json::to_value(&[hex::encode(&max_bytes)]).unwrap(),
686-
)
687-
.unwrap();
688-
assert!(decode_transactions::<MainnetEthSpec>(
689-
serde_json::to_value(&[hex::encode(&too_many_bytes)]).unwrap()
690-
)
691-
.is_err());
692677
}
693678

694679
#[tokio::test]

0 commit comments

Comments
 (0)