Skip to content

Commit

Permalink
Add comment for potential overlapping tag nums in Cadence
Browse files Browse the repository at this point in the history
Currently, Atree uses CBOR tag numbers [247, 255] and grows downwards.
Cadence uses CBOR tag numbers [128, 224] and grows upwards.  There
MUST not be any overlap.

This commit adds comment to warning about overlapping.  We can be more
proactive about this by dividing up the remaining available tag numbers
between Cadence and Atree.

NOTE: A similar comment will be added to Cadence repo at
github.com/onflow/cadence when the next atree-cadence integration
PR is opened.
  • Loading branch information
fxamacker committed Oct 2, 2023
1 parent 7a2aeb1 commit e6fa347
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions storable.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func hasPointer(storable Storable) bool {
}

const (
// WARNING: tag numbers defined in here in github.com/onflow/atree
// MUST not overlap with tag numbers used by Cadence internal value encoding.
// As of Oct. 2, 2023, Cadence uses tag numbers from 128 to 224.
// See runtime/interpreter/encode.go at github.com/onflow/cadence.

CBORTagInlinedArrayExtraData = 247
CBORTagInlinedMapExtraData = 248
CBORTagInlinedCompositeExtraData = 249
Expand Down

0 comments on commit e6fa347

Please sign in to comment.