openzeppelin_relayer/constants/
evm_transaction.rs1use crate::models::evm::Speed;
2use chrono::Duration;
3
4pub const DEFAULT_TX_VALID_TIMESPAN: i64 = 8 * 60 * 60 * 1000; pub const DEFAULT_TRANSACTION_SPEED: Speed = Speed::Fast;
7
8pub const DEFAULT_GAS_LIMIT: u64 = 21000;
9pub const ERC20_TRANSFER_GAS_LIMIT: u64 = 65_000;
10pub const ERC721_TRANSFER_GAS_LIMIT: u64 = 80_000;
11pub const COMPLEX_GAS_LIMIT: u64 = 200_000;
12pub const GAS_TX_CREATE_CONTRACT: u64 = 53000;
13
14pub const GAS_TX_DATA_ZERO: u64 = 4; pub const GAS_TX_DATA_NONZERO: u64 = 16; pub const GAS_LIMIT_BUFFER_MULTIPLIER: u64 = 110;
19
20pub const MIN_BUMP_FACTOR: f64 = 1.1;
22
23pub const MAXIMUM_TX_ATTEMPTS: usize = 50;
25pub const MAXIMUM_NOOP_RETRY_ATTEMPTS: u32 = 50;
27
28pub const ARBITRUM_TIME_TO_RESUBMIT: i64 = 20_000;
30
31pub const ARBITRUM_GAS_LIMIT: u64 = 50_000;
33
34pub const GAS_PRICE_CACHE_REFRESH_TIMEOUT_SECS: u64 = 300;
37
38pub const HISTORICAL_BLOCKS: u64 = 4;
40
41pub const EVM_STATUS_CHECK_INITIAL_DELAY_SECONDS: i64 = 8;
45
46pub const EVM_MIN_AGE_FOR_RESUBMIT_SECONDS: i64 = 20;
50
51pub const EVM_PREPARE_TIMEOUT_MINUTES: i64 = 2;
54
55pub const EVM_SUBMIT_TIMEOUT_MINUTES: i64 = 5;
57
58pub const EVM_RESEND_TIMEOUT_SECONDS: i64 = 25;
60
61pub const EVM_PENDING_RECOVERY_TRIGGER_SECONDS: i64 = 20;
63
64pub const EVM_MIN_AGE_FOR_HASH_RECOVERY_MINUTES: i64 = 2;
66
67pub const EVM_MIN_HASHES_FOR_RECOVERY: usize = 3;
69
70pub fn get_evm_prepare_timeout() -> Duration {
72 Duration::minutes(EVM_PREPARE_TIMEOUT_MINUTES)
73}
74
75pub fn get_evm_submit_timeout() -> Duration {
77 Duration::minutes(EVM_SUBMIT_TIMEOUT_MINUTES)
78}
79
80pub fn get_evm_resend_timeout() -> Duration {
82 Duration::seconds(EVM_RESEND_TIMEOUT_SECONDS)
83}
84
85pub fn get_evm_pending_recovery_trigger_timeout() -> Duration {
87 Duration::seconds(EVM_PENDING_RECOVERY_TRIGGER_SECONDS)
88}
89
90pub fn get_evm_status_check_initial_delay() -> Duration {
92 Duration::seconds(EVM_STATUS_CHECK_INITIAL_DELAY_SECONDS)
93}
94
95pub fn get_evm_min_age_for_hash_recovery() -> Duration {
97 Duration::minutes(EVM_MIN_AGE_FOR_HASH_RECOVERY_MINUTES)
98}