const MaxInstances, MaxImage, MaxOutput, MaxInput, DefaultFuel, MaxSliceFuel
1const (
2 // MaxInstances is how many programs the realm keeps at once.
3 MaxInstances = 64
4 // MaxImage caps an uploaded text segment at 2,048 instructions.
5 //
6 // This one is not arbitrary. Predecoding costs about 19,600 gas per word
7 // and is redone on every resume, so the image size is a tax on every
8 // transaction that touches the instance, not just the upload. 8 KiB works
9 // out to roughly 40M gas per slice before the guest executes anything,
10 // which is about 1% of a block.
11 MaxImage = 8192
12 // MaxOutput caps the bytes one program may write. Past it the guest is
13 // trapped rather than truncated, so rendered output is never a lie.
14 MaxOutput = 4096
15 // MaxInput caps the call input a program can be given.
16 MaxInput = 1024
17 // DefaultFuel is the budget an upload gets when it asks for none, and the
18 // slice size Step uses when asked for none.
19 DefaultFuel = 100000
20 // MaxSliceFuel bounds one transaction's work regardless of what the
21 // caller asked for, and it is derived from the measurement rather than
22 // picked: an RV32IM instruction costs about 8,500 gas, so 100,000 of them
23 // is about 850M, a little under a third of a 3G block. Twice this would
24 // still be a legal transaction and a rude one, and it would leave no room
25 // for the predecode and the realm's own storage writes on top.
26 MaxSliceFuel = 100000
27)Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.
