1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
use Range;
use ;
use DECODER_AUX_TRACE_OFFSET;
// CONSTANTS
// ================================================================================================
/// Index of the column holding code block IDs (which are row addresses from the hasher table).
pub const ADDR_COL_IDX: usize = 0;
/// Index at which operation bit columns start in the decoder trace.
pub const OP_BITS_OFFSET: usize = ADDR_COL_IDX + 1;
/// Number of columns needed to hold a binary representation of opcodes.
pub const NUM_OP_BITS: usize = OP_BITS;
/// Location of operation bits columns in the decoder trace.
pub const OP_BITS_RANGE: = range;
// Note: "hasher state" columns are shared between decoding operations and holding
// the hasher state during MAST node hashing.
/// Index at which hasher state columns start in the decoder trace.
pub const HASHER_STATE_OFFSET: usize = OP_BITS_RANGE.end;
/// Number of hasher columns in the decoder trace.
pub const NUM_HASHER_COLUMNS: usize = 8;
/// Number of helper registers available to user ops.
pub const NUM_USER_OP_HELPERS: usize = 6;
/// Index at which helper registers available to user ops start.
/// The first two helper registers are used by the decoder itself.
pub const USER_OP_HELPERS_OFFSET: usize = HASHER_STATE_OFFSET + 2;
/// Location of hasher columns in the decoder trace.
pub const HASHER_STATE_RANGE: = range;
/// Index of the in_span column in the decoder trace.
pub const IN_SPAN_COL_IDX: usize = HASHER_STATE_RANGE.end;
/// Index of the operation group count column in the decoder trace.
pub const GROUP_COUNT_COL_IDX: usize = IN_SPAN_COL_IDX + 1;
/// Index of the operation index column in the decoder trace.
pub const OP_INDEX_COL_IDX: usize = GROUP_COUNT_COL_IDX + 1;
/// Index at which operation batch flag columns start in the decoder trace.
pub const OP_BATCH_FLAGS_OFFSET: usize = OP_INDEX_COL_IDX + 1;
/// Number of operation batch flag columns.
pub const NUM_OP_BATCH_FLAGS: usize = 3;
/// Location of operation batch flag columns in the decoder trace.
pub const OP_BATCH_FLAGS_RANGE: = range;
/// Operation batch consists of 8 operation groups.
pub const OP_BATCH_8_GROUPS: = ;
/// Operation batch consists of 4 operation groups.
pub const OP_BATCH_4_GROUPS: = ;
/// Operation batch consists of 2 operation groups.
pub const OP_BATCH_2_GROUPS: = ;
/// Operation batch consists of 1 operation group.
pub const OP_BATCH_1_GROUPS: = ;
/// Index at which the op bits extra columns start in the decoder trace.
pub const OP_BITS_EXTRA_COLS_OFFSET: usize = OP_BATCH_FLAGS_RANGE.end;
/// Number of columns needed for degree reduction of the operation flags.
pub const NUM_OP_BITS_EXTRA_COLS: usize = 2;
/// Location of the operation bits extra columns (for degree reduction) in the decoder trace.
pub const OP_BITS_EXTRA_COLS_RANGE: =
range;
/// Index of a flag column which indicates whether an ending block is a body of a loop.
pub const IS_LOOP_BODY_FLAG_COL_IDX: usize = HASHER_STATE_RANGE.start + 4;
/// Index of a flag column which indicates whether an ending block is a LOOP block.
pub const IS_LOOP_FLAG_COL_IDX: usize = HASHER_STATE_RANGE.start + 5;
/// Index of a flag column which indicates whether an ending block is a CALL or DYNCALL block.
pub const IS_CALL_FLAG_COL_IDX: usize = HASHER_STATE_RANGE.start + 6;
/// Index of a flag column which indicates whether an ending block is a SYSCALL block.
pub const IS_SYSCALL_FLAG_COL_IDX: usize = HASHER_STATE_RANGE.start + 7;
// --- Column accessors in the auxiliary columns --------------------------------------------------
/// Running product column representing block stack table.
pub const P1_COL_IDX: usize = DECODER_AUX_TRACE_OFFSET;
/// Running product column representing block hash table
pub const P2_COL_IDX: usize = DECODER_AUX_TRACE_OFFSET + 1;
/// Running product column representing op group table.
pub const P3_COL_IDX: usize = DECODER_AUX_TRACE_OFFSET + 2;
// --- GLOBALLY-INDEXED DECODER COLUMN ACCESSORS --------------------------------------------------
pub const DECODER_OP_BITS_OFFSET: usize = DECODER_TRACE_OFFSET + OP_BITS_OFFSET;
pub const DECODER_USER_OP_HELPERS_OFFSET: usize =
DECODER_TRACE_OFFSET + USER_OP_HELPERS_OFFSET;