-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types: blob - extract createcommitment (#32)
## Overview This PR extracts `CreateCommitment` from `celestia-app`. This can be used to submit blob commitments with minimal dependencies. Fixes #25 ## Checklist - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [x] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords
- Loading branch information
Showing
21 changed files
with
1,284 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package v1 | ||
|
||
const ( | ||
Version uint64 = 1 | ||
SquareSizeUpperBound int = 128 | ||
SubtreeRootThreshold int = 64 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package appconsts | ||
|
||
import v1 "github.com/rollkit/celestia-openrpc/types/appconsts/v1" | ||
|
||
const ( | ||
LatestVersion = v1.Version | ||
) | ||
|
||
// SubtreeRootThreshold works as a target upper bound for the number of subtree | ||
// roots in the share commitment. If a blob contains more shares than this | ||
// number, then the height of the subtree roots will increase by one so that the | ||
// number of subtree roots in the share commitment decreases by a factor of two. | ||
// This step is repeated until the number of subtree roots is less than the | ||
// SubtreeRootThreshold. | ||
// | ||
// The rationale for this value is described in more detail in ADR-013. | ||
func SubtreeRootThreshold(_ uint64) int { | ||
return v1.SubtreeRootThreshold | ||
} | ||
|
||
// SquareSizeUpperBound is the maximum original square width possible | ||
// for a version of the state machine. The maximum is decided through | ||
// governance. See `DefaultGovMaxSquareSize`. | ||
func SquareSizeUpperBound(_ uint64) int { | ||
return v1.SquareSizeUpperBound | ||
} | ||
|
||
var ( | ||
DefaultSubtreeRootThreshold = SubtreeRootThreshold(LatestVersion) | ||
DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion) | ||
) |
Oops, something went wrong.