chore: use u64 for blobcount (#14250)

This commit is contained in:
Matthias Seitz
2025-02-06 00:15:24 +01:00
committed by GitHub
parent 06132f509c
commit f80d8f25f9
3 changed files with 7 additions and 6 deletions

View File

@ -267,8 +267,8 @@ where
&pool_tx,
InvalidPoolTransactionError::Eip4844(
Eip4844PoolTransactionError::TooManyEip4844Blobs {
have: (block_blob_count + tx_blob_count) as usize,
permitted: max_blob_count as usize,
have: block_blob_count + tx_blob_count,
permitted: max_blob_count,
},
),
);

View File

@ -161,9 +161,9 @@ pub enum Eip4844PoolTransactionError {
#[error("too many blobs in transaction: have {have}, permitted {permitted}")]
TooManyEip4844Blobs {
/// Number of blobs the transaction has
have: usize,
have: u64,
/// Number of maximum blobs the transaction can have
permitted: usize,
permitted: u64,
},
/// Thrown if validating the blob sidecar for the transaction failed.
#[error(transparent)]

View File

@ -328,7 +328,8 @@ where
)
}
let blob_count = transaction.blob_versioned_hashes().map(|b| b.len()).unwrap_or(0);
let blob_count =
transaction.blob_versioned_hashes().map(|b| b.len() as u64).unwrap_or(0);
if blob_count == 0 {
// no blobs
return TransactionValidationOutcome::Invalid(
@ -339,7 +340,7 @@ where
)
}
let max_blob_count = self.fork_tracker.max_blob_count() as usize;
let max_blob_count = self.fork_tracker.max_blob_count();
if blob_count > max_blob_count {
return TransactionValidationOutcome::Invalid(
transaction,