mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Implement "Synchronously check all transactions to have non-zero length"
This commit is contained in:
@@ -121,6 +121,11 @@ impl<'block, E: EthSpec> NewPayloadRequest<'block, E> {
|
||||
|
||||
let _timer = metrics::start_timer(&metrics::EXECUTION_LAYER_VERIFY_BLOCK_HASH);
|
||||
|
||||
// Check that no transactions in the payload are zero length
|
||||
if payload.transactions().iter().any(|slice| slice.is_empty()) {
|
||||
return Err(Error::ZeroLengthTransaction);
|
||||
}
|
||||
|
||||
let (header_hash, rlp_transactions_root) = calculate_execution_block_hash(
|
||||
payload,
|
||||
parent_beacon_block_root,
|
||||
|
||||
@@ -149,6 +149,7 @@ pub enum Error {
|
||||
payload: ExecutionBlockHash,
|
||||
transactions_root: Hash256,
|
||||
},
|
||||
ZeroLengthTransaction,
|
||||
PayloadBodiesByRangeNotSupported,
|
||||
InvalidJWTSecret(String),
|
||||
InvalidForkForPayload,
|
||||
|
||||
@@ -1226,7 +1226,7 @@ async fn progressive_balances_cache_attester_slashing() {
|
||||
.apply_blocks_while(|_, state| state.finalized_checkpoint().epoch == 0)
|
||||
.await
|
||||
.unwrap()
|
||||
// TODO(electra) The shuffling calculations changed between Altair and Electra. Without
|
||||
// TODO(electra) The shuffling calculations changed between Altair and Electra. Without
|
||||
// skipping slots this test breaks. For some reason `fork_name_unchecked` returns Altair
|
||||
// initially, even though this test harness should be initialized with the most recent fork, i.e. Electra
|
||||
.skip_slots(32)
|
||||
|
||||
Reference in New Issue
Block a user