-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: support authored blobs #3765
Changes from all commits
7bad5ea
c11731d
1235a0d
792b208
7f43c2b
226a98c
521d7a2
9891402
2571c23
b684acd
08de9e3
9004999
2dfa407
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
package appconsts | ||
|
||
import ( | ||
"math" | ||
|
||
ns "github.com/celestiaorg/go-square/v2/share" | ||
"github.com/celestiaorg/go-square/v2/share" | ||
"github.com/celestiaorg/rsmt2d" | ||
"github.com/tendermint/tendermint/pkg/consts" | ||
) | ||
|
@@ -13,55 +11,9 @@ import ( | |
// | ||
// They can not change throughout the lifetime of a network. | ||
const ( | ||
// NamespaceVersionSize is the size of a namespace version in bytes. | ||
NamespaceVersionSize = ns.NamespaceVersionSize | ||
// NamespaceVersionMaxValue is the maximum value a namespace version can be. | ||
// This const must be updated if NamespaceVersionSize is changed. | ||
NamespaceVersionMaxValue = math.MaxUint8 | ||
|
||
// NamespaceIDSize is the size of a namespace ID in bytes. | ||
NamespaceIDSize = ns.NamespaceIDSize | ||
|
||
// NamespaceSize is the size of a namespace (version + ID) in bytes. | ||
NamespaceSize = ns.NamespaceSize | ||
|
||
// ShareSize is the size of a share in bytes. | ||
ShareSize = 512 | ||
|
||
// ShareInfoBytes is the number of bytes reserved for information. The info | ||
// byte contains the share version and a sequence start indicator. | ||
ShareInfoBytes = 1 | ||
|
||
// SequenceLenBytes is the number of bytes reserved for the sequence length | ||
// that is present in the first share of a sequence. | ||
SequenceLenBytes = 4 | ||
|
||
// ShareVersionZero is the first share version format. | ||
ShareVersionZero = uint8(0) | ||
cmwaters marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// DefaultShareVersion is the defacto share version. Use this if you are | ||
// unsure of which version to use. | ||
DefaultShareVersion = ShareVersionZero | ||
|
||
// CompactShareReservedBytes is the number of bytes reserved for the location of | ||
// the first unit (transaction, ISR) in a compact share. | ||
CompactShareReservedBytes = 4 | ||
|
||
// FirstCompactShareContentSize is the number of bytes usable for data in | ||
// the first compact share of a sequence. | ||
FirstCompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - SequenceLenBytes - CompactShareReservedBytes | ||
|
||
// ContinuationCompactShareContentSize is the number of bytes usable for | ||
// data in a continuation compact share of a sequence. | ||
ContinuationCompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - CompactShareReservedBytes | ||
|
||
// FirstSparseShareContentSize is the number of bytes usable for data in the | ||
// first sparse share of a sequence. | ||
FirstSparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - SequenceLenBytes | ||
|
||
// ContinuationSparseShareContentSize is the number of bytes usable for data | ||
// in a continuation sparse share of a sequence. | ||
ContinuationSparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes | ||
DefaultShareVersion = share.ShareVersionZero | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [question] why default to the previous share version when a new one exists? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually don't know what is meant by the default here. I have left it as is because v1 is a new feature and I a) don't know if many people will use it and b) should be opt in anyway. Maybe if this is just for tests we can change it but it would require a large refactor since the new version requires new arguments |
||
|
||
// MinSquareSize is the smallest original square width. | ||
MinSquareSize = 1 | ||
|
@@ -70,9 +22,6 @@ const ( | |
// data square. | ||
MinShareCount = MinSquareSize * MinSquareSize | ||
|
||
// MaxShareVersion is the maximum value a share version can be. | ||
MaxShareVersion = 127 | ||
|
||
// BondDenom defines the native staking denomination | ||
BondDenom = "utia" | ||
) | ||
|
@@ -92,7 +41,7 @@ var ( | |
DefaultCodec = rsmt2d.NewLeoRSCodec | ||
|
||
// SupportedShareVersions is a list of supported share versions. | ||
SupportedShareVersions = []uint8{ShareVersionZero} | ||
SupportedShareVersions = share.SupportedShareVersions | ||
) | ||
|
||
// HashLength returns the length of a hash in bytes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blocking] I think this test case should fail b/c app version is 2. Should this feature be gated behind an app version bump?
Ref: https://github.com/celestiaorg/CIPs/blob/main/cips/cip-21.md#backwards-compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was waiting on this until we have more information regarding your v3 prototype. At the moment it's not gated but it should be