mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Improve batch handling (#316)
* restrict batch size to ~25kb * add batch size check to node * rate limit batches to 1 per serai block * add support for multiple batches for block * fix review comments * Misc fixes Doesn't yet update tests/processor until data flow is inspected. * Move the block from SignId to ProcessorMessage::BatchPreprocesses * Misc clean up --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
This commit is contained in:
@@ -55,10 +55,9 @@ pub async fn test_scanner<N: Network>(network: N) {
|
||||
let verify_event = |mut scanner: ScannerHandle<N, MemDb>| async {
|
||||
let outputs =
|
||||
match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() {
|
||||
ScannerEvent::Block { key, block, batch, outputs } => {
|
||||
ScannerEvent::Block { key, block, outputs } => {
|
||||
assert_eq!(key, keys.group_key());
|
||||
assert_eq!(block, block_id);
|
||||
assert_eq!(batch, 0);
|
||||
assert_eq!(outputs.len(), 1);
|
||||
assert_eq!(outputs[0].kind(), OutputType::External);
|
||||
outputs
|
||||
@@ -90,10 +89,7 @@ pub async fn test_scanner<N: Network>(network: N) {
|
||||
|
||||
let mut cloned_db = db.clone();
|
||||
let mut txn = cloned_db.txn();
|
||||
assert_eq!(
|
||||
scanner.ack_up_to_block(&mut txn, keys.group_key(), block_id).await,
|
||||
(blocks, outputs)
|
||||
);
|
||||
assert_eq!(scanner.ack_up_to_block(&mut txn, keys.group_key(), block_id).await, outputs);
|
||||
txn.commit();
|
||||
|
||||
// There should be no more events
|
||||
|
||||
Reference in New Issue
Block a user