altmempools

package
v0.6.44 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Overview

Package altmempool provides functions to pull an alternative mempool config from an IPFS gateway and validate it against a schema.

Schema originally written by @dancoombs: https://hackmd.io/@dancoombs/BJYRz3h8n.

Index

Constants

This section is empty.

Variables

View Source
var (
	Schema, _ = newJSONSchema()
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Id   string
	Data map[string]any
}

type Directory

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

Directory maintains a collection of alternative mempool configurations. It allows a consumer to check if a known alternative mempool exists that will allow specific exceptions that the canonical mempool cannot accept.

func New

func New(chain *big.Int, altMempools []*Config) (*Directory, error)

New accepts an array of alternative mempool configs and returns a Directory.

func NewFromIPFS

func NewFromIPFS(chain *big.Int, ipfsGateway string, ids []string) (*Directory, error)

NewFromIPFS will pull alternative mempool configs from IPFS and returns a Directory. The mempool id is equal to an IPFS CID.

func (*Directory) HasInvalidStorageAccessException

func (d *Directory) HasInvalidStorageAccessException(entity string, contract string, slot string) []string

HasInvalidStorageAccessException will attempt to find all mempools ids that will accept the given invalid storage access pattern and return it. If none is found, an empty array will be returned.

Jump to

Keyboard shortcuts

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