mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Add commands from CONTRIBUTING.md to Makefile and update ci (#6141)
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
#![allow(missing_docs)]
|
||||
use criterion::{
|
||||
black_box, criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
|
||||
};
|
||||
@ -21,7 +22,7 @@ fn generate_test_data_priority() -> (u128, u128, u128, u128) {
|
||||
}
|
||||
|
||||
fn priority_bench(
|
||||
group: &mut BenchmarkGroup<WallTime>,
|
||||
group: &mut BenchmarkGroup<'_, WallTime>,
|
||||
description: &str,
|
||||
input_data: (u128, u128, u128, u128),
|
||||
) {
|
||||
@ -40,7 +41,7 @@ fn priority_bench(
|
||||
}
|
||||
|
||||
fn fee_jump_bench(
|
||||
group: &mut BenchmarkGroup<WallTime>,
|
||||
group: &mut BenchmarkGroup<'_, WallTime>,
|
||||
description: &str,
|
||||
input_data: (u128, u128),
|
||||
) {
|
||||
@ -53,7 +54,7 @@ fn fee_jump_bench(
|
||||
});
|
||||
}
|
||||
|
||||
pub fn blob_priority_calculation(c: &mut Criterion) {
|
||||
fn blob_priority_calculation(c: &mut Criterion) {
|
||||
let mut group = c.benchmark_group("Blob priority calculation");
|
||||
let fee_jump_input = generate_test_data_fee_delta();
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#![allow(missing_docs)]
|
||||
use criterion::{
|
||||
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
|
||||
};
|
||||
@ -9,12 +10,12 @@ use proptest::{
|
||||
use reth_transaction_pool::test_utils::MockTransaction;
|
||||
|
||||
/// Transaction Pool trait for benching.
|
||||
pub trait BenchTxPool: Default {
|
||||
trait BenchTxPool: Default {
|
||||
fn add_transaction(&mut self, tx: MockTransaction);
|
||||
fn reorder(&mut self, base_fee: u64);
|
||||
}
|
||||
|
||||
pub fn txpool_reordering(c: &mut Criterion) {
|
||||
fn txpool_reordering(c: &mut Criterion) {
|
||||
let mut group = c.benchmark_group("Transaction Pool Reordering");
|
||||
|
||||
for seed_size in [1_000, 10_000, 50_000, 100_000] {
|
||||
@ -54,7 +55,7 @@ pub fn txpool_reordering(c: &mut Criterion) {
|
||||
}
|
||||
|
||||
fn txpool_reordering_bench<T: BenchTxPool>(
|
||||
group: &mut BenchmarkGroup<WallTime>,
|
||||
group: &mut BenchmarkGroup<'_, WallTime>,
|
||||
description: &str,
|
||||
seed: Vec<MockTransaction>,
|
||||
new_txs: Vec<MockTransaction>,
|
||||
@ -170,7 +171,7 @@ mod implementations {
|
||||
|
||||
impl PartialEq for MockTransactionWithPriority {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.priority.eq(&other.priority)
|
||||
self.priority == other.priority
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#![allow(missing_docs)]
|
||||
use criterion::{
|
||||
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
|
||||
};
|
||||
@ -124,7 +125,7 @@ fn txpool_truncate(c: &mut Criterion) {
|
||||
}
|
||||
|
||||
fn truncate_pending(
|
||||
group: &mut BenchmarkGroup<WallTime>,
|
||||
group: &mut BenchmarkGroup<'_, WallTime>,
|
||||
description: &str,
|
||||
seed: Vec<MockTransaction>,
|
||||
senders: usize,
|
||||
@ -159,7 +160,7 @@ fn truncate_pending(
|
||||
}
|
||||
|
||||
fn truncate_parked(
|
||||
group: &mut BenchmarkGroup<WallTime>,
|
||||
group: &mut BenchmarkGroup<'_, WallTime>,
|
||||
description: &str,
|
||||
seed: Vec<MockTransaction>,
|
||||
senders: usize,
|
||||
|
||||
Reference in New Issue
Block a user