-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(txpool): export validation constants
- Loading branch information
Showing
4 changed files
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// TX_SLOT_SIZE is used to calculate how many data slots a single transaction | ||
/// takes up based on its size. The slots are used as DoS protection, ensuring | ||
/// that validating a new transaction remains a constant operation (in reality | ||
/// O(maxslots), where max slots are 4 currently). | ||
pub const TX_SLOT_SIZE: usize = 32 * 1024; | ||
|
||
/// TX_MAX_SIZE is the maximum size a single transaction can have. This field has | ||
/// non-trivial consequences: larger transactions are significantly harder and | ||
/// more expensive to propagate; larger transactions also take more resources | ||
/// to validate whether they fit into the pool or not. | ||
pub const TX_MAX_SIZE: usize = 4 * TX_SLOT_SIZE; // 128KB | ||
|
||
/// Maximum bytecode to permit for a contract | ||
pub const MAX_CODE_SIZE: usize = 24576; | ||
|
||
/// Maximum initcode to permit in a creation transaction and create instructions | ||
pub const MAX_INIT_CODE_SIZE: usize = 2 * MAX_CODE_SIZE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters