Documentation ¶
Index ¶
- Variables
- type GeneratedIntraState
- type IntraStateGenerator
- func (l *IntraStateGenerator) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error
- func (l *IntraStateGenerator) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, ...)
- func (l *IntraStateGenerator) CaptureExit(output []byte, gasUsed uint64, vmerr error)
- func (l *IntraStateGenerator) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (l *IntraStateGenerator) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...) error
- func (l *IntraStateGenerator) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (l *IntraStateGenerator) CaptureTxEnd(restGas uint64)
- func (l *IntraStateGenerator) CaptureTxStart(gasLimit uint64)
- func (l *IntraStateGenerator) GetGeneratedStates() ([]GeneratedIntraState, error)
- type OneStepProver
- func (l *OneStepProver) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error
- func (l *OneStepProver) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, ...)
- func (l *OneStepProver) CaptureExit(output []byte, gasUsed uint64, vmerr error)
- func (l *OneStepProver) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (l *OneStepProver) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...) error
- func (l *OneStepProver) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (l *OneStepProver) CaptureTxEnd(restGas uint64)
- func (l *OneStepProver) CaptureTxStart(gasLimit uint64)
- func (l *OneStepProver) GetProof() (*proof.OneStepProof, error)
- type OspTestGeneratedCtx
- type OspTestProof
- type OspTestResult
- type TestProver
- func (l *TestProver) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, vmerr error) error
- func (l *TestProver) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, ...)
- func (l *TestProver) CaptureExit(output []byte, gasUsed uint64, vmerr error)
- func (l *TestProver) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (l *TestProver) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...) error
- func (l *TestProver) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (l *TestProver) CaptureTxEnd(restGas uint64)
- func (l *TestProver) CaptureTxStart(gasLimit uint64)
- func (l *TestProver) GetResult() (json.RawMessage, error)
Constants ¶
This section is empty.
Variables ¶
var ErrStepIdxAndHashMismatch = errors.New("step index and hash mismatch")
Functions ¶
This section is empty.
Types ¶
type GeneratedIntraState ¶
type IntraStateGenerator ¶
type IntraStateGenerator struct {
// contains filtered or unexported fields
}
func NewIntraStateGenerator ¶
func NewIntraStateGenerator( blockNumber, transactionIdx uint64, committedGlobalState vm.StateDB, interState state.InterState, blockHashTree *state.BlockHashTree, ) *IntraStateGenerator
func (*IntraStateGenerator) CaptureEnd ¶
func (*IntraStateGenerator) CaptureEnter ¶
func (*IntraStateGenerator) CaptureExit ¶
func (l *IntraStateGenerator) CaptureExit(output []byte, gasUsed uint64, vmerr error)
func (*IntraStateGenerator) CaptureFault ¶
func (l *IntraStateGenerator) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, err error) error
CaptureFault will be called when the stack/gas validation is passed but the execution failed. The current call will immediately be reverted. The error is handled in CaptureExit so nothing to do here.
func (*IntraStateGenerator) CaptureStart ¶
func (*IntraStateGenerator) CaptureState ¶
func (l *IntraStateGenerator) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, rData []byte, depth int, vmerr error) error
CaptureState will be called before the opcode execution vmerr is for stack validation and gas validation the execution error is captured in CaptureFault
func (*IntraStateGenerator) CaptureTxEnd ¶
func (l *IntraStateGenerator) CaptureTxEnd(restGas uint64)
func (*IntraStateGenerator) CaptureTxStart ¶
func (l *IntraStateGenerator) CaptureTxStart(gasLimit uint64)
func (*IntraStateGenerator) GetGeneratedStates ¶
func (l *IntraStateGenerator) GetGeneratedStates() ([]GeneratedIntraState, error)
type OneStepProver ¶
type OneStepProver struct {
// contains filtered or unexported fields
}
func NewProver ¶
func NewProver( target common.Hash, step uint64, rules params.Rules, blockNumber uint64, transactionIdx uint64, committedGlobalState vm.StateDB, interState state.InterState, blockHashTree *state.BlockHashTree, transaction *types.Transaction, receipt *types.Receipt, ) *OneStepProver
NewProver creates a new tracer that generates proofs for:
- Type 4 IntraState -> IntraState: one-step EVM execution
- Type 5 IntraState -> InterState: transaction finalization
target is the hash of the start state that we want to prove step is the step number of the start state (step 0 is the InterState before the transaction) The target hash and step should be matched, otherwise ErrStepIdxAndHashMismatch will be returned receipt is the receipt of the *current* transaction traced
func (*OneStepProver) CaptureEnd ¶
func (*OneStepProver) CaptureEnter ¶
func (*OneStepProver) CaptureExit ¶
func (l *OneStepProver) CaptureExit(output []byte, gasUsed uint64, vmerr error)
func (*OneStepProver) CaptureFault ¶
func (l *OneStepProver) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, vmerr error) error
CaptureFault will be called when the stack/gas validation is passed but the execution failed. The current call will immediately be reverted.
func (*OneStepProver) CaptureStart ¶
func (*OneStepProver) CaptureState ¶
func (l *OneStepProver) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, rData []byte, depth int, vmerr error) error
CaptureState will be called before the opcode execution vmerr is for stack validation and gas validation the execution error is captured in CaptureFault
func (*OneStepProver) CaptureTxEnd ¶
func (l *OneStepProver) CaptureTxEnd(restGas uint64)
func (*OneStepProver) CaptureTxStart ¶
func (l *OneStepProver) CaptureTxStart(gasLimit uint64)
func (*OneStepProver) GetProof ¶
func (l *OneStepProver) GetProof() (*proof.OneStepProof, error)
type OspTestGeneratedCtx ¶
type OspTestGeneratedCtx struct { TxnHash string `json:"txnHash"` TxNonce string `json:"txNonce"` TxV string `json:"txV"` TxR string `json:"txR"` TxS string `json:"txS"` Coinbase string `json:"coinbase"` Timestamp string `json:"timestamp"` BlockNumber string `json:"blockNumber"` Difficulty string `json:"difficulty"` GasLimit string `json:"gasLimit"` ChainID string `json:"chainID"` BaseFee string `json:"baseFee"` Origin string `json:"origin"` Recipient string `json:"recipient"` Value string `json:"value"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Input string `json:"input"` InputSize string `json:"inputSize"` }
type OspTestProof ¶
type OspTestResult ¶
type OspTestResult struct { Ctx OspTestGeneratedCtx `json:"ctx"` Proof OspTestProof `json:"proof"` }
type TestProver ¶
type TestProver struct {
// contains filtered or unexported fields
}
func NewTestProver ¶
func NewTestProver( step int64, opcode int64, transaction *types.Transaction, txctx *vm.Context, receipt *types.Receipt, rules params.Rules, blockNumber uint64, transactionIdx uint64, committedGlobalState vm.StateDB, interState state.InterState, blockHashTree *state.BlockHashTree, ) *TestProver
func (*TestProver) CaptureEnd ¶
func (*TestProver) CaptureEnter ¶
func (*TestProver) CaptureExit ¶
func (l *TestProver) CaptureExit(output []byte, gasUsed uint64, vmerr error)
func (*TestProver) CaptureFault ¶
func (*TestProver) CaptureStart ¶
func (*TestProver) CaptureState ¶
func (*TestProver) CaptureTxEnd ¶
func (l *TestProver) CaptureTxEnd(restGas uint64)
func (*TestProver) CaptureTxStart ¶
func (l *TestProver) CaptureTxStart(gasLimit uint64)
func (*TestProver) GetResult ¶
func (l *TestProver) GetResult() (json.RawMessage, error)