server

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogSkipper

func LogSkipper(c echo.Context) bool

LogSkipper implements the `middleware.Skipper` interface.

Types

type CreateAssignmentRequestBody added in v0.17.0

type CreateAssignmentRequestBody struct {
	FeeToken   common.Address
	TierFees   []encoding.TierFee
	Expiry     uint64
	TxListHash common.Hash
}

CreateAssignmentRequestBody represents a request body when handling assignment creation request.

type NewProverServerOpts

type NewProverServerOpts struct {
	ProverPrivateKey         *ecdsa.PrivateKey
	MinOptimisticTierFee     *big.Int
	MinSgxTierFee            *big.Int
	MinPseZkevmTierFee       *big.Int
	MinSgxAndPseZkevmTierFee *big.Int
	MaxExpiry                time.Duration
	MaxBlockSlippage         uint64
	MaxProposedIn            uint64
	CapacityManager          *capacity.CapacityManager
	TaikoL1Address           common.Address
	AssignmentHookAddress    common.Address
	Rpc                      *rpc.Client
	LivenessBond             *big.Int
	IsGuardian               bool
	DB                       ethdb.KeyValueStore
}

NewProverServerOpts contains all configurations for creating a prover server instance.

type ProposeBlockResponse

type ProposeBlockResponse struct {
	SignedPayload []byte         `json:"signedPayload"`
	Prover        common.Address `json:"prover"`
	MaxBlockID    uint64         `json:"maxBlockID"`
	MaxProposedIn uint64         `json:"maxProposedIn"`
}

ProposeBlockResponse represents the JSON response which will be returned by the ProposeBlock request handler.

type ProverServer

type ProverServer struct {
	// contains filtered or unexported fields
}

@host prover-api.test.taiko.xyz ProverServer represents a prover server instance.

func New

func New(opts *NewProverServerOpts) (*ProverServer, error)

New creates a new prover server instance.

func (*ProverServer) CreateAssignment

func (srv *ProverServer) CreateAssignment(c echo.Context) error

CreateAssignment handles a block proof assignment request, decides if this prover wants to handle this block, and if so, returns a signed payload the proposer can submit onchain.

@Summary		Try to accept a block proof assignment
@Param          body        body    CreateAssignmentRequestBody   true    "assignment request body"
@Accept			json
@Produce		json
@Success		200		{object} ProposeBlockResponse
@Failure		422		{string} string	"invalid txList hash"
@Failure		422		{string} string	"only receive ETH"
@Failure		422		{string} string	"insufficient prover balance"
@Failure		422		{string} string	"proof fee too low"
@Failure		422		{string} string "expiry too long"
@Failure		422		{string} string "prover does not have capacity"
@Router			/assignment [post]

func (*ProverServer) GetSignedBlocks added in v0.18.0

func (srv *ProverServer) GetSignedBlocks(c echo.Context) error

GetSignedBlocks handles a query to retrieve the most recent signed blocks from the database.

@Summary		Get signed blocks
@ID			   	get-signed-blocks
@Accept			json
@Produce		json
@Success		200	{object} []SignedBlock
@Router			/signedBlocks [get]

func (*ProverServer) GetStatus

func (srv *ProverServer) GetStatus(c echo.Context) error

GetStatus handles a query to the current prover server status.

@Summary		Get current prover server status
@ID			   	get-status
@Accept			json
@Produce		json
@Success		200	{object} Status
@Router			/status [get]

func (*ProverServer) Health

func (srv *ProverServer) Health(c echo.Context) error

Health endpoints for probes.

func (*ProverServer) Shutdown

func (srv *ProverServer) Shutdown(ctx context.Context) error

Shutdown shuts down the HTTP server.

func (*ProverServer) Start

func (srv *ProverServer) Start(address string) error

Start starts the HTTP server.

type SignedBlock added in v0.18.0

type SignedBlock struct {
	BlockID   uint64         `json:"blockID"`
	BlockHash string         `json:"blockHash"`
	Signature string         `json:"signature"`
	Prover    common.Address `json:"proverAddress"`
}

SignedBlock represents a signed block.

type Status

type Status struct {
	MinOptimisticTierFee uint64 `json:"minOptimisticTierFee"`
	MinSgxTierFee        uint64 `json:"minSgxTierFee"`
	MinPseZkevmTierFee   uint64 `json:"minPseZkevmTierFee"`
	MaxExpiry            uint64 `json:"maxExpiry"`
	CurrentCapacity      uint64 `json:"currentCapacity"`
	Prover               string `json:"prover"`
	HeartBeatSignature   []byte `json:"heartBeatSignature"`
}

Status represents the current prover server status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL