Skip to content

Commit

Permalink
Cap the coding ratio <= 10 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Nov 13, 2023
1 parent 1feeefa commit 830f836
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions api/proto/disperser/disperser.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ message SecurityParams {
//
// Requires:
// 1 <= quorum_threshld <= 100
// quorum_threshld > adversary_threshold.
// quorum_threshld > adversary_threshold + 10.
//
// Note: The adversary_threshold and quorum_threshold will directly influence the
// cost of encoding for the blob to be dispersed, roughly by a factor of
// 100 / (quorum_threshold - adversary_threshold). See the spec for more details:
// https://github.com/Layr-Labs/eigenda/blob/master/docs/spec/protocol-modules/storage/overview.md
// Currently it's required that the difference must be at least 10.
uint32 quorum_threshold = 3;
}

Expand Down Expand Up @@ -198,8 +199,8 @@ message BatchMetadata {
BatchHeader batch_header = 1;
// The hash of all public keys of the operators that did not sign the batch.
bytes signatory_record_hash = 2;
// The gas fee of confirming this batch. It's the bytes representation of
// a big.Int value.
// The fee payment paid by users for dispersing this batch. It's the bytes
// representation of a big.Int value.
bytes fee = 3;
// The Ethereum block number at which the batch is confirmed onchain.
uint32 confirmation_block_number = 4;
Expand Down
4 changes: 2 additions & 2 deletions core/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type BlobRequestHeader struct {

func (h *BlobRequestHeader) Validate() error {
for _, quorum := range h.SecurityParams {
if quorum.AdversaryThreshold >= quorum.QuorumThreshold {
return errors.New("invalid request: quorum threshold does not exceed adversary threshold")
if quorum.AdversaryThreshold+10 >= quorum.QuorumThreshold {
return errors.New("invalid request: quorum threshold must be >= 10 + adversary threshold")
}
if quorum.QuorumThreshold > 100 {
return errors.New("invalid request: quorum threshold exceeds 100")
Expand Down

0 comments on commit 830f836

Please sign in to comment.