Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateProof ¶
func GenerateProof(backend Backend, ctx context.Context, startState *ExecutionState, config *ProverConfig) (*proof.OneStepProof, error)
Types ¶
type Backend ¶
type Backend interface { HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) RPCGasCap() uint64 ChainConfig() *params.ChainConfig Engine() consensus.Engine ChainDb() ethdb.Database // StateAtBlock returns the state corresponding to the stateroot of the block. // N.B: For executing transactions on block N, the required stateRoot is block N-1, // so this method should be called with the parent. StateAtBlock(ctx context.Context, block *types.Block, reexec uint64, base *state.StateDB, readOnly bool, preferDisk bool) (*state.StateDB, tracers.StateReleaseFunc, error) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (*core.Message, vm.BlockContext, *state.StateDB, tracers.StateReleaseFunc, error) }
Backend interface provides the common API services (that are provided by both full and light clients) with access to necessary functions.
type ExecutionState ¶
type ExecutionState struct { VMHash common.Hash Block *types.Block TransactionIdx uint64 StepIdx uint64 }
func GenerateStates ¶
func GenerateStates( backend Backend, ctx context.Context, startNum uint64, endNum uint64, config *ProverConfig, ) ([]*ExecutionState, error)
This function generates execution states across blocks [startNum, endNum) For example there are 2 transactions: a, b The states are: inter-state before a, intra-states in a, inter-state before b (after a), intra-states in b, inter-state after b
func (*ExecutionState) Hash ¶
func (s *ExecutionState) Hash() common.Hash
func (*ExecutionState) MarshalJson ¶
func (s *ExecutionState) MarshalJson() ([]byte, error)
type ProverAPI ¶
type ProverAPI struct {
// contains filtered or unexported fields
}
ProverAPI is the collection of Specular one-step proof APIs.
type ProverConfig ¶
type ProverConfig struct {
Reexec *uint64
}
Click to show internal directories.
Click to hide internal directories.