1use fuel_types::{
4 AssetId,
5 Bytes32,
6 Word,
7};
8
9use core::mem;
10
11pub const VM_REGISTER_COUNT: usize = 64;
13
14pub const VM_REGISTER_SYSTEM_COUNT: usize = 16;
16
17pub const VM_REGISTER_PROGRAM_COUNT: usize = VM_REGISTER_COUNT - VM_REGISTER_SYSTEM_COUNT;
19
20pub const WORD_SIZE: usize = mem::size_of::<Word>();
24
25pub const FUEL_MAX_MEMORY_SIZE: u64 = 64;
27
28pub const VM_MAX_RAM: u64 = 1024 * 1024 * FUEL_MAX_MEMORY_SIZE;
30
31#[allow(clippy::cast_possible_truncation)]
33pub const MEM_SIZE: usize = VM_MAX_RAM as usize;
34
35static_assertions::const_assert!(VM_MAX_RAM < usize::MAX as u64);
36
37pub const VM_MEMORY_BASE_ASSET_ID_OFFSET: usize = Bytes32::LEN;
41
42pub const VM_MEMORY_BALANCES_OFFSET: usize =
44 VM_MEMORY_BASE_ASSET_ID_OFFSET + AssetId::LEN;
45
46pub const VM_REGISTER_WIDTH: u8 = 6;
48
49pub const EMPTY_RECEIPTS_MERKLE_ROOT: [u8; 32] = [
51 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f,
52 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b,
53 0x78, 0x52, 0xb8, 0x55,
54];