Documentation ¶
Index ¶
- Constants
- Variables
- type BatchEndpoints
- type BridgeEndpoints
- func (b *BridgeEndpoints) GetProof(networkID uint32, depositCount uint32, l1InfoTreeIndex uint32) (interface{}, rpc.Error)
- func (b *BridgeEndpoints) GetSponsoredClaimStatus(globalIndex *big.Int) (interface{}, rpc.Error)
- func (b *BridgeEndpoints) InjectedInfoAfterIndex(networkID uint32, l1InfoTreeIndex uint32) (interface{}, rpc.Error)
- func (b *BridgeEndpoints) L1InfoTreeIndexForBridge(networkID uint32, depositCount uint32) (interface{}, rpc.Error)
- func (b *BridgeEndpoints) SponsorClaim(claim claimsponsor.Claim) (interface{}, rpc.Error)
- type Bridger
- type ClaimSponsorer
- type L1InfoTreer
- type LastGERer
Constants ¶
const (
// BRIDGE is the namespace of the bridge service
BRIDGE = "bridge"
)
Variables ¶
var ( // ErrBusy is returned when the witness server is busy ErrBusy = errors.New("witness server is busy") )
var (
ErrNotOnL1Info = errors.New("this bridge has not been included on the L1 Info Tree yet")
)
Functions ¶
This section is empty.
Types ¶
type BatchEndpoints ¶ added in v0.4.0
type BatchEndpoints struct {
// contains filtered or unexported fields
}
func NewBatchEndpoints ¶ added in v0.4.0
func NewBatchEndpoints(url string) *BatchEndpoints
func (*BatchEndpoints) GetBatch ¶ added in v0.4.0
func (b *BatchEndpoints) GetBatch(batchNumber uint64) (*types.RPCBatch, error)
func (*BatchEndpoints) GetL2BlockTimestamp ¶ added in v0.4.0
func (b *BatchEndpoints) GetL2BlockTimestamp(blockHash string) (uint64, error)
func (*BatchEndpoints) GetWitness ¶ added in v0.4.0
func (b *BatchEndpoints) GetWitness(batchNumber uint64, fullWitness bool) ([]byte, error)
type BridgeEndpoints ¶
type BridgeEndpoints struct {
// contains filtered or unexported fields
}
BridgeEndpoints contains implementations for the "bridge" RPC endpoints
func NewBridgeEndpoints ¶
func NewBridgeEndpoints( logger *log.Logger, writeTimeout time.Duration, readTimeout time.Duration, networkID uint32, sponsor ClaimSponsorer, l1InfoTree L1InfoTreer, injectedGERs LastGERer, bridgeL1 Bridger, bridgeL2 Bridger, ) *BridgeEndpoints
NewBridgeEndpoints returns InteropEndpoints
func (*BridgeEndpoints) GetProof ¶ added in v0.4.0
func (b *BridgeEndpoints) GetProof( networkID uint32, depositCount uint32, l1InfoTreeIndex uint32, ) (interface{}, rpc.Error)
GetProof returns the proofs needed to claim a bridge. NetworkID and depositCount refere to the bridge origin while globalExitRoot should be already injected on the destination network. This call needs to be done to a client of the same network were the bridge tx was sent
func (*BridgeEndpoints) GetSponsoredClaimStatus ¶
func (b *BridgeEndpoints) GetSponsoredClaimStatus(globalIndex *big.Int) (interface{}, rpc.Error)
GetSponsoredClaimStatus returns the status of a claim that has been previously requested to be sponsored. This call needs to be done to the same client were it was requested to be sponsored
func (*BridgeEndpoints) InjectedInfoAfterIndex ¶
func (b *BridgeEndpoints) InjectedInfoAfterIndex(networkID uint32, l1InfoTreeIndex uint32) (interface{}, rpc.Error)
InjectedInfoAfterIndex return the first GER injected onto the network that is linked to the given index or greater. This call is useful to understand when a bridge is ready to be claimed on its destination network
func (*BridgeEndpoints) L1InfoTreeIndexForBridge ¶
func (b *BridgeEndpoints) L1InfoTreeIndexForBridge(networkID uint32, depositCount uint32) (interface{}, rpc.Error)
L1InfoTreeIndexForBridge returns the first L1 Info Tree index in which the bridge was included. networkID represents the origin network. This call needs to be done to a client of the same network were the bridge tx was sent
func (*BridgeEndpoints) SponsorClaim ¶
func (b *BridgeEndpoints) SponsorClaim(claim claimsponsor.Claim) (interface{}, rpc.Error)
SponsorClaim sends a claim tx on behalf of the user. This call needs to be done to a client of the same network were the claim is going to be sent (bridge destination)
type ClaimSponsorer ¶
type ClaimSponsorer interface { AddClaimToQueue(claim *claimsponsor.Claim) error GetClaim(globalIndex *big.Int) (*claimsponsor.Claim, error) }
type L1InfoTreer ¶
type L1InfoTreer interface { GetInfoByIndex(ctx context.Context, index uint32) (*l1infotreesync.L1InfoTreeLeaf, error) GetRollupExitTreeMerkleProof(ctx context.Context, networkID uint32, root common.Hash) (tree.Proof, error) GetLocalExitRoot(ctx context.Context, networkID uint32, rollupExitRoot common.Hash) (common.Hash, error) GetLastInfo() (*l1infotreesync.L1InfoTreeLeaf, error) GetFirstInfo() (*l1infotreesync.L1InfoTreeLeaf, error) GetFirstInfoAfterBlock(blockNum uint64) (*l1infotreesync.L1InfoTreeLeaf, error) GetLastVerifiedBatches(rollupID uint32) (*l1infotreesync.VerifyBatches, error) GetFirstVerifiedBatches(rollupID uint32) (*l1infotreesync.VerifyBatches, error) GetFirstVerifiedBatchesAfterBlock(rollupID uint32, blockNum uint64) (*l1infotreesync.VerifyBatches, error) GetFirstL1InfoWithRollupExitRoot(rollupExitRoot common.Hash) (*l1infotreesync.L1InfoTreeLeaf, error) }