Documentation
¶
Index ¶
- Variables
- func CLIFlags(envPrefix, category string) []cli.Flag
- func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag
- func HashBatchHashedMetadata(batchHeaderHash [32]byte, signatoryRecordHash [32]byte, blockNumber uint32) (geth_common.Hash, error)
- func HashBatchMetadata(bh *binding.IEigenDAServiceManagerBatchHeader, sigHash [32]byte, ...) (geth_common.Hash, error)
- func HashBlobHeader(blobHeader BlobHeader) (geth_common.Hash, error)
- func HashEncodeBlobHeader(header BlobHeader) (geth_common.Hash, error)
- func ProcessInclusionProof(proof []byte, leaf common.Hash, index uint64) (common.Hash, error)
- type BlobHeader
- type CertVerifier
- type Certificate
- type Config
- type G1Point
- type QuorumBlobParam
- type Verifier
- func (v *Verifier) Commit(blob []byte) (*bn254.G1Affine, error)
- func (v *Verifier) VerifyCert(cert *Certificate) error
- func (v *Verifier) VerifyCommitment(expectedCommit *common.G1Commitment, blob []byte) error
- func (v *Verifier) VerifySecurityParams(blobHeader BlobHeader, batchHeader binding.IEigenDAServiceManagerBatchHeader) error
Constants ¶
This section is empty.
Variables ¶
var ( BytesPerSymbol = 31 MaxCodingRatio = 8 MaxSRSPoints = 1 << 28 // 2^28 MaxAllowedBlobSize = uint64(MaxSRSPoints * BytesPerSymbol / MaxCodingRatio) )
var ( // cert verification flags CertVerificationDisabledFlagName = withFlagPrefix("cert-verification-disabled") EthRPCFlagName = withFlagPrefix("eth-rpc") SvcManagerAddrFlagName = withFlagPrefix("svc-manager-addr") EthConfirmationDepthFlagName = withFlagPrefix("eth-confirmation-depth") // kzg flags G1PathFlagName = withFlagPrefix("g1-path") G2PowerOf2PathFlagName = withFlagPrefix("g2-power-of-2-path") CachePathFlagName = withFlagPrefix("cache-path") MaxBlobLengthFlagName = withFlagPrefix("max-blob-length") )
var ( // cert verification flags DeprecatedCertVerificationEnabledFlagName = withDeprecatedFlagPrefix("cert-verification-enabled") DeprecatedEthRPCFlagName = withDeprecatedFlagPrefix("eth-rpc") DeprecatedSvcManagerAddrFlagName = withDeprecatedFlagPrefix("svc-manager-addr") DeprecatedEthConfirmationDepthFlagName = withDeprecatedFlagPrefix("eth-confirmation-depth") // kzg flags DeprecatedG1PathFlagName = withDeprecatedFlagPrefix("g1-path") DeprecatedG2TauFlagName = withDeprecatedFlagPrefix("g2-tau-path") DeprecatedCachePathFlagName = withDeprecatedFlagPrefix("cache-path") DeprecatedMaxBlobLengthFlagName = withDeprecatedFlagPrefix("max-blob-length") )
TODO: we should also upstream these deprecated flags into the eigenda client if we upstream the changes before removing the deprecated flags
var ErrBatchMetadataHashNotFound = errors.New("BatchMetadataHash not found for BatchId")
var MaxBlobLengthBytes uint64
this var is set by the action in the MaxBlobLengthFlagName flag TODO: there's def a better way to deal with this... perhaps a generic flag that can parse the string into a uint64?
Functions ¶
func CLIFlags ¶ added in v1.5.0
func CLIFlags(envPrefix, category string) []cli.Flag
CLIFlags ... used for Verifier configuration category is used to group the flags in the help output (see https://cli.urfave.org/v2/examples/flags/#grouping)
func DeprecatedCLIFlags ¶ added in v1.5.0
func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag
CLIFlags ... used for Verifier configuration category is used to group the flags in the help output (see https://cli.urfave.org/v2/examples/flags/#grouping)
func HashBatchHashedMetadata ¶ added in v1.1.1
func HashBatchHashedMetadata(batchHeaderHash [32]byte, signatoryRecordHash [32]byte, blockNumber uint32) (geth_common.Hash, error)
HashBatchHashedMetadata hashes the given metadata into the commitment that will be stored in the contract replicates: https://github.com/Layr-Labs/eigenda-utils/blob/c4cbc9ec078aeca3e4a04bd278e2fb136bf3e6de/src/libraries/EigenDAHasher.sol#L19-L25
func HashBatchMetadata ¶ added in v1.1.1
func HashBatchMetadata(bh *binding.IEigenDAServiceManagerBatchHeader, sigHash [32]byte, blockNum uint32) (geth_common.Hash, error)
HashBatchMetadata regenerates a batch data hash replicates: https://github.com/Layr-Labs/eigenda-utils/blob/c4cbc9ec078aeca3e4a04bd278e2fb136bf3e6de/src/libraries/EigenDAHasher.sol#L46-L54
func HashBlobHeader ¶ added in v1.1.1
func HashBlobHeader(blobHeader BlobHeader) (geth_common.Hash, error)
HashBlobHeader function to hash BlobHeader
func HashEncodeBlobHeader ¶ added in v1.1.1
func HashEncodeBlobHeader(header BlobHeader) (geth_common.Hash, error)
Function to hash and encode header
Types ¶
type BlobHeader ¶ added in v1.2.0
type BlobHeader struct { Commitment G1Point DataLength uint32 QuorumBlobParams []QuorumBlobParam }
BlobHeader struct to represent BlobHeader in Solidity
type CertVerifier ¶ added in v1.1.1
type CertVerifier struct {
// contains filtered or unexported fields
}
CertVerifier verifies the DA certificate against on-chain EigenDA contracts to ensure disperser returned fields haven't been tampered with
func NewCertVerifier ¶ added in v1.1.1
func NewCertVerifier(cfg *Config, l log.Logger) (*CertVerifier, error)
func (*CertVerifier) VerifyBatch ¶ added in v1.1.1
func (cv *CertVerifier) VerifyBatch( header *binding.IEigenDAServiceManagerBatchHeader, id uint32, recordHash [32]byte, confirmationNumber uint32, ) error
verifies on-chain batch ID for equivalence to certificate batch header fields
func (*CertVerifier) VerifyMerkleProof ¶ added in v1.1.1
func (cv *CertVerifier) VerifyMerkleProof(inclusionProof []byte, root []byte, blobIndex uint32, blobHeader BlobHeader) error
verifies the blob batch inclusion proof against the blob root hash
type Certificate ¶ added in v1.2.0
func (*Certificate) BatchHeaderRoot ¶ added in v1.2.0
func (c *Certificate) BatchHeaderRoot() []byte
func (*Certificate) BlobIndex ¶ added in v1.2.0
func (c *Certificate) BlobIndex() uint32
func (*Certificate) Proof ¶ added in v1.2.0
func (c *Certificate) Proof() *disperser.BlobVerificationProof
func (*Certificate) ReadBlobHeader ¶ added in v1.2.0
func (c *Certificate) ReadBlobHeader() BlobHeader
type Config ¶ added in v1.1.1
type Config struct { KzgConfig *kzg.KzgConfig VerifyCerts bool // below 3 fields are only required if VerifyCerts is true RPCURL string SvcManagerAddr string EthConfirmationDepth uint64 }
func ReadConfig ¶ added in v1.5.0
func ReadConfig(ctx *cli.Context) Config
type QuorumBlobParam ¶ added in v1.2.0
type QuorumBlobParam struct { QuorumNumber uint8 AdversaryThresholdPercentage uint8 ConfirmationThresholdPercentage uint8 ChunkLength uint32 }
QuorumBlobParam struct to represent QuorumBlobParam in Solidity
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
TODO: right now verification and confirmation depth are tightly coupled. we should decouple them
func (*Verifier) VerifyCert ¶ added in v1.1.1
func (v *Verifier) VerifyCert(cert *Certificate) error
verifies V0 eigenda certificate type
func (*Verifier) VerifyCommitment ¶ added in v1.1.1
func (v *Verifier) VerifyCommitment(expectedCommit *common.G1Commitment, blob []byte) error
Verify regenerates a commitment from the blob and asserts equivalence to the commitment in the certificate TODO: Optimize implementation by opening a point on the commitment instead
func (*Verifier) VerifySecurityParams ¶ added in v1.1.1
func (v *Verifier) VerifySecurityParams(blobHeader BlobHeader, batchHeader binding.IEigenDAServiceManagerBatchHeader) error
VerifySecurityParams ensures that returned security parameters are valid