AppVersion should be present in structs that use versioned consts
Hey! I’m from Lumina team. We started implementing versioned consts from appconsts and we encounter some issues while incorporating them in our celestia-types crate.
These are the issues:
SubtreeRootThresholdis used whenBlob.Commitmentis computed, howeverAppVersionis only present inExtendedHeader. So if a user requests aBlob, they need first to requestExtendedHeader, thenBloband then pass theAppVersionin order to get theCommitment. In celestia-node you workaround this by having a fixed version of constants, which we believe it is going to be an issue later on.ExtendedDataSquarehas a theoreticalMAX_EXTENDED_SQUARE_WIDTH, which isSquareSizeUpperBound * 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 theExtendedHeaderon validation.DataAvailabilityHeaderhas also a theoreticalMAX_EXTENDED_SQUARE_WIDTH, howeverDataAvailabilityHeaderexists inExtendedHeaderand you can not retrieve it independently. Because of that we can passExtendedHeader.Header.Version.Appwhen 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.
Adding to that, CIP-21 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.
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
Can you please repost this there @oblique ? I’m sorry for the confusion here.