Versions in this module Expand all Collapse all v0 v0.3.0 Jun 16, 2023 Changes in this version + const MaxPageCount + const MipsEBADF + const MipsEINVAL + const PageAddrMask + const PageAddrSize + const PageKeyMask + const PageKeySize + const PageSize + var CheatBytes4 = crypto.Keccak256([]byte("cheat(uint256,bytes32,bytes32,uint256)"))[:4] + var LoadKeccak256PreimagePartBytes4 = crypto.Keccak256([]byte("loadKeccak256PreimagePart(uint256,bytes)"))[:4] + var StepBytes4 = crypto.Keccak256([]byte("Step(bytes,bytes)"))[:4] + func HashPair(left, right [32]byte) [32]byte + func NewEVMEnv(contracts *Contracts, addrs *Addresses) (*vm.EVM, *state.StateDB) + func PatchGo(f *elf.File, st *State) error + func PatchStack(st *State) error + func SE(dat uint32, idx uint32) uint32 + type Addresses struct + FeeRecipient common.Address + MIPS common.Address + Oracle common.Address + Sender common.Address + type CachedPage struct + Cache [PageSize / 32][32]byte + Data *Page + Ok [PageSize / 32]bool + func (p *CachedPage) Invalidate(pageAddr uint32) + func (p *CachedPage) InvalidateFull() + func (p *CachedPage) MerkleRoot() [32]byte + func (p *CachedPage) MerkleizeSubtree(gindex uint64) [32]byte + type Contract struct + DeployedBytecode struct{ ... } + func LoadContract(name string) (*Contract, error) + func (c *Contract) SourceMap(sourcePaths []string) (*SourceMap, error) + type Contracts struct + MIPS *Contract + Oracle *Contract + func LoadContracts() (*Contracts, error) + type HexU32 uint32 + func (v HexU32) MarshalText() ([]byte, error) + func (v HexU32) String() string + type InstrMapping struct + F int32 + J byte + L int32 + M int32 + S int32 + type InstrumentedState struct + func NewInstrumentedState(state *State, po PreimageOracle, stdOut, stdErr io.Writer) *InstrumentedState + func (m *InstrumentedState) Step(proof bool) (wit *StepWitness, err error) + type LineCol struct + Col uint32 + Line uint32 + type LoggingWriter struct + Log log.Logger + Name string + func (lw *LoggingWriter) Write(b []byte) (int, error) + type Memory struct + func NewMemory() *Memory + func (m *Memory) AllocPage(pageIndex uint32) *CachedPage + func (m *Memory) ForEachPage(fn func(pageIndex uint32, page *Page) error) error + func (m *Memory) GetMemory(addr uint32) uint32 + func (m *Memory) Invalidate(addr uint32) + func (m *Memory) MarshalJSON() ([]byte, error) + func (m *Memory) MerkleProof(addr uint32) (out [28 * 32]byte) + func (m *Memory) MerkleRoot() [32]byte + func (m *Memory) MerkleizeSubtree(gindex uint64) [32]byte + func (m *Memory) PageCount() int + func (m *Memory) ReadMemoryRange(addr uint32, count uint32) io.Reader + func (m *Memory) SetMemory(addr uint32, v uint32) + func (m *Memory) SetMemoryRange(addr uint32, r io.Reader) error + func (m *Memory) UnmarshalJSON(data []byte) error + func (m *Memory) Usage() string + type Metadata struct + Symbols []Symbol + func MakeMetadata(elfProgram *elf.File) (*Metadata, error) + func (m *Metadata) LookupSymbol(addr uint32) string + func (m *Metadata) SymbolMatcher(name string) func(addr uint32) bool + type Page [PageSize]byte + func (p *Page) MarshalText() ([]byte, error) + func (p *Page) UnmarshalText(dat []byte) error + type PreimageOracle interface + GetPreimage func(k [32]byte) []byte + Hint func(v []byte) + type SourceMap struct + Instr []InstrMapping + PosData [][]LineCol + Sources []string + func ParseSourceMap(sources []string, bytecode []byte, sourceMap string) (*SourceMap, error) + func (s *SourceMap) FormattedInfo(pc uint64) string + func (s *SourceMap) Info(pc uint64) (source string, line uint32, col uint32) + type SourceMapTracer struct + func NewSourceMapTracer(srcMaps map[common.Address]*SourceMap, out io.Writer) *SourceMapTracer + func (s *SourceMapTracer) CaptureEnd(output []byte, gasUsed uint64, err error) + func (s *SourceMapTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, ...) + func (s *SourceMapTracer) CaptureExit(output []byte, gasUsed uint64, err error) + func (s *SourceMapTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, ...) + func (s *SourceMapTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...) + func (s *SourceMapTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, ...) + func (s *SourceMapTracer) CaptureTxEnd(restGas uint64) + func (s *SourceMapTracer) CaptureTxStart(gasLimit uint64) + type State struct + ExitCode uint8 + Exited bool + HI uint32 + Heap uint32 + LO uint32 + LastHint hexutil.Bytes + Memory *Memory + NextPC uint32 + PC uint32 + PreimageKey common.Hash + PreimageOffset uint32 + Registers [32]uint32 + Step uint64 + func LoadELF(f *elf.File) (*State, error) + func (s *State) EncodeWitness() []byte + type StepWitness struct + MemProof []byte + PreimageKey [32]byte + PreimageOffset uint32 + PreimageValue []byte + State []byte + func (wit *StepWitness) EncodePreimageOracleInput() ([]byte, error) + func (wit *StepWitness) EncodeStepInput() []byte + func (wit *StepWitness) HasPreimage() bool + type Symbol struct + Name string + Size uint32 + Start uint32