perf: remove redundant ommers sealing (#2386)

This commit is contained in:
Roman Krasiuk
2023-04-25 15:53:16 +03:00
committed by GitHub
parent 21ebfee461
commit b4d69e68dc
11 changed files with 18 additions and 48 deletions

View File

@@ -584,11 +584,7 @@ mod tests {
.map(|block| {
(
block.hash(),
BlockBody {
transactions: block.body,
ommers: block.ommers.into_iter().map(|header| header.unseal()).collect(),
withdrawals: None,
},
BlockBody { transactions: block.body, ommers: block.ommers, withdrawals: None },
)
})
.collect::<HashMap<_, _>>();

View File

@@ -165,7 +165,7 @@ where
let block = SealedBlock {
header: next_header,
body: next_body.transactions,
ommers: next_body.ommers.into_iter().map(|h| h.seal_slow()).collect(),
ommers: next_body.ommers,
withdrawals: next_body.withdrawals,
};

View File

@@ -24,7 +24,7 @@ pub(crate) fn zip_blocks<'a>(
BlockResponse::Full(SealedBlock {
header: header.clone(),
body: body.transactions,
ommers: body.ommers.into_iter().map(|o| o.seal_slow()).collect(),
ommers: body.ommers,
withdrawals: body.withdrawals,
})
}

View File

@@ -28,7 +28,7 @@ pub(crate) fn generate_bodies(
block.hash(),
BlockBody {
transactions: block.body,
ommers: block.ommers.into_iter().map(|header| header.unseal()).collect(),
ommers: block.ommers,
withdrawals: block.withdrawals,
},
)