Skip to content

Commit 3f92612

Browse files
committed
fix: adjust block generation logic for immediate transaction packing in eSpace
1 parent 71cca5c commit 3f92612

File tree

1 file changed

+4
-1
lines changed
  • crates/rpc/rpc-eth-impl/src

1 file changed

+4
-1
lines changed

crates/rpc/rpc-eth-impl/src/eth.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,9 +1508,12 @@ impl EthApiServer for EthApi {
15081508
}
15091509

15101510
let r = self.send_transaction_with_signature(tx)?;
1511+
// evm txs are packed every ratio blocks
1512+
// always generate another ratio blocks to ensure the tx is packed
1513+
let ratio = self.tx_pool.machine().params().evm_transaction_block_ratio;
15111514
if self.config.dev_pack_tx_immediately {
15121515
// Try to pack and execute this new tx.
1513-
for _ in 0..DEFERRED_STATE_EPOCH_COUNT {
1516+
for _ in 0..(DEFERRED_STATE_EPOCH_COUNT + ratio - 1) {
15141517
let generated = self.generate_one_block(
15151518
1, /* num_txs */
15161519
self.sync

0 commit comments

Comments
 (0)