Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve batch handling #316

Merged
merged 8 commits into from
Aug 14, 2023
Merged

Conversation

akildemir
Copy link
Contributor

fixes #280 alongside some improvements

  • restrict batch sizes to ~25kb
  • rate limit batches to 1 batch per serai block per key group
  • allow multiple batches per block

substrate/in-instructions/primitives/src/lib.rs Outdated Show resolved Hide resolved
substrate/in-instructions/pallet/src/lib.rs Outdated Show resolved Hide resolved
substrate/in-instructions/pallet/src/lib.rs Outdated Show resolved Hide resolved
@@ -61,6 +62,7 @@ pub mod sign {
pub struct SignId {
pub key: Vec<u8>,
pub id: [u8; 32],
pub block: Option<BlockHash>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an Option? Due to the SignId reuse for Batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It is used in SignId for batches but not in coordinator/tributary/scanner see my reply to #316 (comment) as well

processor/messages/src/lib.rs Outdated Show resolved Hide resolved
processor/src/substrate_signer.rs Outdated Show resolved Hide resolved
processor/src/substrate_signer.rs Outdated Show resolved Hide resolved
processor/src/substrate_signer.rs Outdated Show resolved Hide resolved
processor/src/tests/substrate_signer.rs Outdated Show resolved Hide resolved
processor/src/tests/substrate_signer.rs Outdated Show resolved Hide resolved
@kayabaNerve kayabaNerve merged commit e680eab into serai-dex:develop Aug 14, 2023
2 of 12 checks passed
@akildemir akildemir deleted the limit-batch-size branch August 21, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DoS by too big batches
2 participants