Skip to content

Commit ceeaa7b

Browse files
feat: call actual erc20 (#5)
* 50k conns? * rm: json parsing on testserver * huge backlog * allow get * log concurrent * limit to 1 worker * 50 workers * feat: hyper * fix? * actix -> axum * Update main.rs * rm batch factor * 3 second measurement interval * Update main.rs * worker id * request durr * fix: workers * Update network.rs * fix ids * feat: implied total rps * Update network.rs * Update network.rs * Create genesis.json * genalloc * 25k * start reth * 50k again? * wip: try one of 10k addrs * even workers * 20k conns * Update main.rs * back to 20 acc * 100 accounts * 100 acc * 2500 accounts * oops fix tx queue reporting * feat: rand addr * 500 accounts * use existing people, log * allow dead code * Update tx_gen.rs * lawging * hrmf * 1k accs * 10k accounts * wip: startup delay * Update tx_queue.rs * Update tx_queue.rs * log * moar thresholds * Update tx_queue.rs * feat: rayonify * Update tx_gen.rs * 50k connections? * Revert "50k connections?" This reverts commit 34ec48c. * log rayon thread pool size * Update tx_gen.rs * Initialize Rayon with explicit thread count. * Update tx_gen.rs * Update tx_gen.rs * feat: alternate ratelimit system * Update tx_queue.rs * Update tx_queue.rs * Update tx_queue.rs * Update tx_queue.rs * Update tx_queue.rs * hm * thresholds * Update tx_queue.rs * Update tx_queue.rs * Update tx_queue.rs * thresholds * Update tx_queue.rs * fewer socket conns * 10k connections * 50k RPS? * feat: longer ramp * 35k rps? * Update tx_queue.rs * 25k * Update start-reth.sh * Update genesis.json * Update start-reth.sh * batch factor of 5 * fix: implied rps * disable batching * feat: even slower ramp up * slightly faster * feat: 50k genesis * feat: better ramp * oops * worker ratio * feat: pareto distribute recipients * Update tx_gen.rs * Empty the rate limiter. * feat: empty rate limiter before AND after * wip: can we remove first set avail? * 15k tps * 20k? * 15k again * feat: ramp up faster * even faster * faster! * feat: erc20 precompile testing * fix: bytes * Update tx_gen.rs * lower limit * erc20 regular spam * 15k> * HIGH * Update tx_queue.rs * precompile * Update tx_queue.rs
1 parent 3b05d1c commit ceeaa7b

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

crescendo/src/tx_queue.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ use crate::workers::NUM_ACCOUNTS;
1010

1111
const INITIAL_RATELIMIT: u64 = 100;
1212
#[rustfmt::skip]
13-
const RATELIMIT_THRESHOLDS: [(u32, u64); 6] = [
13+
const RATELIMIT_THRESHOLDS: [(u32, u64); 8] = [
1414
(NUM_ACCOUNTS / 16, 250),
1515
(NUM_ACCOUNTS / 8, 500),
1616
(NUM_ACCOUNTS, 1_000),
1717
(NUM_ACCOUNTS * 2, 2_500),
18-
(NUM_ACCOUNTS * 4, 10_000),
19-
(NUM_ACCOUNTS * 8, 15_000),
20-
// (NUM_ACCOUNTS * 10, 20_000),
18+
(NUM_ACCOUNTS * 4, 5_000),
19+
// Avoid ramping up to max TPS before NUM_ACCOUNTS * ~5,
20+
// as we want to make sure most storage slots have been
21+
// touched + cached before we hit the max TPS. Why 5? See:
22+
// https://grok.com/share/bGVnYWN5_e508360c-2313-4d31-8098-6d892f5bf1aa
23+
(NUM_ACCOUNTS * 8, 7_500),
24+
(NUM_ACCOUNTS * 10, 12_500),
25+
(NUM_ACCOUNTS * 12, 15_000),
2126
]; // Note: This must be sorted in ascending order of threshold!
2227

2328
pub struct TxQueue {

crescendo/src/workers/tx_gen.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use std::sync::{LazyLock, Mutex};
33
use std::time::Instant;
44

55
use alloy::network::TxSignerSync;
6-
use alloy::primitives::{Bytes, TxKind, U256};
6+
use alloy::primitives::{address, TxKind, U256};
7+
use alloy::sol;
8+
use alloy::sol_types::SolCall;
79
use alloy_consensus::{SignableTransaction, TxLegacy};
810
use alloy_signer_local::coins_bip39::English;
911
use alloy_signer_local::{MnemonicBuilder, PrivateKeySigner};
@@ -42,6 +44,12 @@ static SIGNER_LIST: LazyLock<Vec<PrivateKeySigner>> = LazyLock::new(|| {
4244
list
4345
});
4446

47+
sol! {
48+
interface ERC20 {
49+
function transfer(address to, uint256 amount) external returns (bool);
50+
}
51+
}
52+
4553
pub fn tx_gen_worker(_worker_id: u32) {
4654
let mut rng = rand::rng();
4755

@@ -68,10 +76,12 @@ pub fn tx_gen_worker(_worker_id: u32) {
6876
chain_id: Some(CHAIN_ID),
6977
nonce,
7078
gas_price: 100_000_000_000, // 100 gwei
71-
gas_limit: 25_000, // 25k gas limit
72-
to: TxKind::Call(recipient),
73-
value: U256::from(rng.random_range(1..=10)),
74-
input: Bytes::new(),
79+
gas_limit: 100_000, // 100k gas limit
80+
to: TxKind::Call(address!("0x2000000000000000000000000000000000000001")),
81+
value: U256::ZERO,
82+
input: ERC20::transferCall { to: recipient, amount: U256::from(rng.random_range(1..=10)) }
83+
.abi_encode()
84+
.into(),
7585
},
7686
);
7787

0 commit comments

Comments
 (0)