# AppVersion should be present in structs that use versioned consts

**URL:** <https://forum.celestia.org/t/appversion-should-be-present-in-structs-that-use-versioned-consts/1833>\
**Category:** Celestia Improvement Proposals (CIPs)\
**Created:** [October 7, 2024, 1:44pm UTC](https://forum.celestia.org/t/appversion-should-be-present-in-structs-that-use-versioned-consts/1833 "2024-10-07T13:44:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oblique](https://forum.celestia.org/user_avatar/forum.celestia.org/oblique/32/1181_2.png) [@oblique](https://forum.celestia.org/u/oblique)\
**Post date:** [October 7, 2024, 1:44pm UTC](https://forum.celestia.org/t/appversion-should-be-present-in-structs-that-use-versioned-consts/1833/1 "2024-10-07T13:44:26Z")

</div>

Hey! I’m from Lumina team. We started implementing [versioned consts from appconsts](https://github.com/celestiaorg/celestia-app/tree/main/pkg/appconsts) and we encounter some issues while incorporating them in our `celestia-types` crate.

These are the issues:

- `SubtreeRootThreshold` is used when `Blob.Commitment` is computed, however `AppVersion` is only present in `ExtendedHeader`. So if a user requests a `Blob`, they need first to request `ExtendedHeader`, then `Blob` and then pass the `AppVersion` in order to get the `Commitment`. In celestia-node you workaround this by having a [fixed version of constants](https://github.com/celestiaorg/celestia-node/blob/f48223dbe4ae74fcf7f4d87a68523d0e4613c923/blob/blob.go#L22), which we believe it is going to be an issue later on.
- `ExtendedDataSquare` has a theoretical `MAX_EXTENDED_SQUARE_WIDTH`, which is `SquareSizeUpperBound * 2`. We use this value to validate EDS, but now this check can not be really done. We are unsure what to do about it. In order to keep this check then we need to apply restrictions on type-level and force user to give us the `ExtendedHeader` on validation.
- `DataAvailabilityHeader` has also a theoretical `MAX_EXTENDED_SQUARE_WIDTH`, however `DataAvailabilityHeader` exists in `ExtendedHeader` and you can not retrieve it independently. Because of that we can pass `ExtendedHeader.Header.Version.App` when we do the validation.

We believe `AppVersion` should be added in all structs that need versioned consts and can be fetched on independently with an API call.

---

<div class="post-metadata">

**Author:** ![zvolin](https://forum.celestia.org/user_avatar/forum.celestia.org/zvolin/32/933_2.png) [@zvolin](https://forum.celestia.org/u/zvolin)\
**Post date:** [October 7, 2024, 2:06pm UTC](https://forum.celestia.org/t/appversion-should-be-present-in-structs-that-use-versioned-consts/1833/2 "2024-10-07T14:06:31Z")

</div>

Adding to that, [CIP-21](https://cips.celestia.org/cip-21.html) introduced a namespace version 1, which is only valid for blocks in appversion v3. So to validate any shares obtained from the rpc, the appversion is required too.

---

<div class="post-metadata">

**Author:** ![josh](https://forum.celestia.org/user_avatar/forum.celestia.org/josh/32/215_2.png) [@josh](https://forum.celestia.org/u/josh)\
**Post date:** [October 16, 2024, 4:54pm UTC](https://forum.celestia.org/t/appversion-should-be-present-in-structs-that-use-versioned-consts/1833/3 "2024-10-16T16:54:07Z")

</div>

Thank you for adding this to the forum. In an effort to get more visibility on this discussion, it’s been recommended in Core Devs Call 18 to move this to [Issues · celestiaorg/celestia-app · GitHub](https://github.com/celestiaorg/celestia-app/issues/)

Can you please repost this there @oblique ? I’m sorry for the confusion here.
