Documentation ¶
Index ¶
- Variables
- type Crypto
- func (c *Crypto) Blake2b256(dataPtr Pointer, dataLength int64, outPtr Pointer)
- func (c *Crypto) ED25519Verify(msgPtr Pointer, msgLength int64, sigPtr Pointer, pubkeyPtr Pointer) int64
- func (c *Crypto) Twox128(dataPtr Pointer, dataLength int64, outPtr Pointer)
- func (c *Crypto) Twox256(dataPtr Pointer, dataLength int64, outPtr Pointer)
- type Data
- func (d *Data) ClearPrefix(prefixPtr Pointer, prefixLength int64)
- func (d *Data) ClearStorage(keyPtr Pointer, keyLength int64)
- func (d *Data) ExistsStorage(keyPtr Pointer, keyLength int64) int
- func (d *Data) GetAllocatedStorage(keyPtr Pointer, keyLength int64, lenPtr Pointer) Pointer
- func (d *Data) GetStorageInto(keyPtr Pointer, keyLength int64, dataPtr Pointer, dataLength int64, ...) int64
- func (d *Data) SetStorage(keyPtr Pointer, keyLength int64, dataPtr Pointer, dataLength int64)
- type Env
- type Header
- type Heap
- func (h *Heap) Allocate(size int64) Pointer
- func (h *Heap) CalculateSize(buffer MemoryBuffer) int64
- func (h *Heap) Deallocate(ptr Pointer) (int64, error)
- func (h *Heap) Dup(ptr Pointer, length int64) []uint8
- func (h *Heap) Fill(ptr Pointer, value uint8, length int64) []uint8
- func (h *Heap) FindContaining(size int64) Pointer
- func (h *Heap) FreeAlloc(size int64) Pointer
- func (h *Heap) Get(ptr Pointer, length int64) []uint8
- func (h *Heap) GetU32(ptr Pointer) uint32
- func (h *Heap) GrowAlloc(size int64) Pointer
- func (h *Heap) GrowMemory(pages int64) bool
- func (h *Heap) Set(ptr Pointer, data []uint8) Pointer
- func (h *Heap) SetU32(ptr Pointer, value uint32) Pointer
- func (h *Heap) SetWASMMemory(wasmMemory *WasmMemory, pageOffset int64)
- func (h *Heap) Size() int64
- func (h *Heap) Used() SizeUsed
- func (h *Heap) WasResized() bool
- type HeapMemory
- type Interface
- type InterfaceChain
- type InterfaceCrypto
- type InterfaceEnvHeap
- type InterfaceIO
- type InterfaceInstrument
- type InterfaceMemory
- type InterfaceSandbox
- type InterfaceStorageData
- type InterfaceStorageTrie
- type Memory
- func (m *Memory) Free(ptr Pointer)
- func (m *Memory) Malloc(size int64) Pointer
- func (m *Memory) Memcmp(s1 Pointer, s2 Pointer, length int64) int64
- func (m *Memory) Memcpy(dst Pointer, src Pointer, num int64) Pointer
- func (m *Memory) Memmove(dst Pointer, src Pointer, num int64) Pointer
- func (m *Memory) Memset(dst Pointer, val uint8, num int64) Pointer
- type MemoryBuffer
- type Pointer
- type Runtime
- type Sandbox
- func (s *Sandbox) InstanceTeardown(instanceIndex int64)
- func (s *Sandbox) Instantiate(a, b, c, d, e, f int64) int64
- func (s *Sandbox) Invoke(instanceIndex int64, exportPtr Pointer, exportLength int64, argsPtr Pointer, ...)
- func (s *Sandbox) MemoryGet(memoryIndex int64, offset int64, ptr Pointer, length int64) int64
- func (s *Sandbox) MemoryNew(initial int64, maximum int64) int64
- func (s *Sandbox) MemorySet(memoryIndex int64, offset int64, ptr Pointer, length int64) int64
- func (s *Sandbox) MemoryTeardown(memoryIndex int64)
- type SignedBlock
- type SizeUsed
- type Stat
- type Stats
- type Storage
- type Trie
- type Version
- type WasmMemory
Constants ¶
This section is empty.
Variables ¶
var PageSize = 64 * 1024
PageSize ...
U32Max ...
Functions ¶
This section is empty.
Types ¶
type Crypto ¶
type Crypto struct {
Heap *Heap
}
Crypto ...
func (*Crypto) Blake2b256 ¶
Blake2b256 ...
func (*Crypto) ED25519Verify ¶
func (c *Crypto) ED25519Verify(msgPtr Pointer, msgLength int64, sigPtr Pointer, pubkeyPtr Pointer) int64
ED25519Verify ...
type Data ¶
Data ...
func (*Data) ClearPrefix ¶
ClearPrefix ...
func (*Data) ClearStorage ¶
ClearStorage ...
func (*Data) ExistsStorage ¶
ExistsStorage ...
func (*Data) GetAllocatedStorage ¶
GetAllocatedStorage ...
type Heap ¶
type Heap struct {
// contains filtered or unexported fields
}
Heap ...
func (*Heap) CalculateSize ¶
func (h *Heap) CalculateSize(buffer MemoryBuffer) int64
CalculateSize ...
func (*Heap) SetWASMMemory ¶
func (h *Heap) SetWASMMemory(wasmMemory *WasmMemory, pageOffset int64)
SetWASMMemory ...
type HeapMemory ¶
type HeapMemory struct { Allocated MemoryBuffer Deallocated MemoryBuffer IsResized bool Offset int64 End int64 Size int64 Buffer []uint8 }
HeapMemory ...
type InterfaceCrypto ¶
type InterfaceCrypto interface { Blake2b256(data Pointer, length int64, out Pointer) ED25519Verify(msgPtr Pointer, msgLen int64, sigPtr Pointer, pubkeyPtr Pointer) int64 Twox128(data Pointer, length int64, out Pointer) Twox256(data Pointer, length int64, out Pointer) }
InterfaceCrypto ...
type InterfaceEnvHeap ¶
type InterfaceEnvHeap interface { Allocate(size int64) Pointer Deallocate(ptr Pointer) (int64, error) Dup(ptr Pointer, length int64) []uint8 Fill(ptr Pointer, value uint8, length int64) []uint8 Get(ptr Pointer, length int64) []uint8 GetU32(ptr Pointer) []uint8 Set(ptr Pointer, data []uint8) Pointer SetU32(ptr Pointer, value []uint8) Pointer SetWASMMemory(wasmMemory *WasmMemory, pageOffset int64) Size() int64 Used() SizeUsed WasResized() bool }
InterfaceEnvHeap ...
type InterfaceIO ¶
type InterfaceIO interface { PrintHex(ptr Pointer, length int64) PrintUTF8(ptr Pointer, length int64) PrintNumber(hi int64, lo int64) }
InterfaceIO ...
type InterfaceInstrument ¶
type InterfaceInstrument interface { Start() Stop() Stats }
InterfaceInstrument ...
type InterfaceMemory ¶
type InterfaceMemory interface { Free(ptr Pointer) Malloc(size int64) Pointer Memcmp(s1 Pointer, s2 Pointer, length int64) int64 Memcpy(dst Pointer, src Pointer, num int64) Pointer Memmove(dst Pointer, src Pointer, num int64) Pointer Memset(dst Pointer, val uint8, num int64) Pointer }
InterfaceMemory ...
type InterfaceSandbox ¶
type InterfaceSandbox interface { Instantiate(a, b, c, d, e, f int64) int64 InstanceTeardown(instanceIndex int64) Invoke(instanceIndex int64, exportPtr Pointer, exportLength int64, argsPtr Pointer, argsLength int64, returnValPtr Pointer, returnValLength int64, state int64) MemoryGet(memoryIndex int64, offset int64, ptr Pointer, length int64) int64 MemoryNew(initial int64, maximum int64) int64 MemorySet(memoryIndex int64, offset int64, ptr Pointer, length int64) int64 MemoryTeardown(memoryIndex int64) }
InterfaceSandbox ...
type InterfaceStorageData ¶
type InterfaceStorageData interface { ClearPrefix(prefixPtr Pointer, prefixLength int64) ClearStorage(keyPtr Pointer, keyLength int64) ExistsStorage(keyPtr Pointer, keyLength int64) int64 GetAllocatedStorage(keyPtr Pointer, keyLength int64, writtenPtr Pointer) Pointer GetStorageInto(keyPtr Pointer, keyLength int64, dataPtr Pointer, dataLength int64, offset int64) int64 SetStorage(keyPtr Pointer, keyLength int64, dataPtr Pointer, dataLength int64) }
InterfaceStorageData ...
type InterfaceStorageTrie ¶
type InterfaceStorageTrie interface { Blake2b256EnumeratedTrieRoot(valuesPtr Pointer, lensPtr Pointer, lensLength int64, resultPtr Pointer) StorageChangesRoot(parentHashData Pointer, parentHashLength, parentNumHi, parentNumLo int64, result Pointer) StorageRoot(resultPtr Pointer) }
InterfaceStorageTrie ...
type Memory ¶
Memory ...
type Sandbox ¶
type Sandbox struct { }
Sandbox ...
func (*Sandbox) InstanceTeardown ¶
InstanceTeardown ...
func (*Sandbox) Instantiate ¶
Instantiate ...
func (*Sandbox) Invoke ¶
func (s *Sandbox) Invoke(instanceIndex int64, exportPtr Pointer, exportLength int64, argsPtr Pointer, argsLength int64, returnValPtr Pointer, returnValLength int64, state int64)
Invoke ...
func (*Sandbox) MemoryTeardown ¶
MemoryTeardown ...
type Trie ¶
Trie ...
func (*Trie) Blake2b256EnumeratedTrieRoot ¶
func (t *Trie) Blake2b256EnumeratedTrieRoot(valuesPtr Pointer, lenPtr Pointer, count int64, resultPtr Pointer)
Blake2b256EnumeratedTrieRoot ...
type Version ¶
type Version struct { // SpecName identifies the different Substrate runtimes. There'll be at least polkadot and node. // A different on-chain spec_name to that of the native runtime would normally result // in node not attempting to sync or author blocks. SpecName string // SpecVersion of the runtime specification. A full-node will not attempt to use its native // runtime in substitute for the on-chain Wasm runtime unless all of `SpecName`, // `SpecVersion` and `AuthoringVersion` are the same between Wasm and native. SpecVersion uint32 // AuthoringVersion of the authorship interface. An authoring node // will not attempt to author blocks unless this is equal to its native runtime. AuthoringVersion uint32 // ImplName is the name of the implementation of the spec. This is of little consequence for the node // and serves only to differentiate code of different implementation teams. For this // codebase, it will be parity-polkadot. If there were a non-Rust implementation of the // Polkadot runtime (e.g. C++), then it would identify itself with an accordingly different // `ImplName`. ImplName string // ImplVersion of the implementation of the specification. Nodes are free to ignore this; it // serves only as an indication that the code is different; as long as the other two versions // are the same then while the actual code may be different, it is nonetheless required to // do the same thing. // Non-consensus-breaking optimisations are about the only changes that could be made which // would result in only the `ImplVersion` changing. ImplVersion uint32 // APIS is a list of supported API "features" along with their versions. APIS map[uint8]uint32 }
Version should not be thought of as classic Semver (major/minor/tiny). This triplet have different semantics and mis-interpretation could cause problems. In particular: bug fixes should result in an increment of `SpecVersion` and possibly `AuthoringVersion`, absolutely not `ImplVersion` since they change the semantics of the runtime.