Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the reasoning in DHA-Team/arbundles#6, this pull request does the same on HyperBEAM: Enforce that the tags section is at most 128*4096 bytes in size and that a combination of tag name and value does not exceed 4096 bytes. That still allows for tags that aren't strictly ans-104 but at least adds an upper bound on tag amount and combined size.
The changes aim at making hyperbeam backwards compatible with what's currently stored on chain and accepted by gateways and projects using arbundles.
(short change summary generated by AI)
Tag validation logic changes
enforce_valid_tx/1to check the combined size of tag name and value against a newMAX_TAG_COMBINED_SIZEconstant, replacing separate checks for name and value lengths. Also added a check for the total tag section size. (src/ar_tx.erl,src/ar_bundles.erl) [1] [2]{invalid_field, tag_size, {Name, Value}}when the combined size exceeds the limit, and{invalid_field, tag_section_size, Tags}when the total section size is too large. (src/ar_tx.erl,src/ar_bundles.erl) [1] [2]Constant definitions
MAX_TAG_NAME_SIZEandMAX_TAG_VALUE_SIZEwith a singleMAX_TAG_COMBINED_SIZEand updatedMAX_TAG_SECTION_SIZEto be based on the new combined size inar.hrl. (src/include/ar.hrl)Test updates
src/ar_tx.erl)src/ar_tx.erl) [1] [2]