Skip to content

Finish SigmaMap implementation #1067

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

Open
kushti opened this issue Apr 11, 2025 · 0 comments · May be fixed by #1070
Open

Finish SigmaMap implementation #1067

kushti opened this issue Apr 11, 2025 · 0 comments · May be fixed by #1070
Assignees

Comments

@kushti
Copy link
Member

kushti commented Apr 11, 2025

Motivation:

current implementation of ContextExtension (auxiliary data provided during spending a UTXO in a transaction input) is using default Scala SDK's Map implementation:

case class ContextExtension(values: scala.collection.Map[Byte, EvaluatedValue[_ <: SType]])  

which is preserving insertion order only for up to four elements (as under the hood specialized Map1 ... Map4 implementations are used).

As insertion order is consensus-critical, there is need to replace scala.collection.Map with own implementation which preserves insertion order, to be safe against possible traversal order changes in future versions of SDK, and also gives possibility to translate implementation to JS and Rust.

Enough interface for SigmaMap can be found in #951 , along with beginning of implementation and some tests. There is need to finish implementation for the whole Byte range and check traversal order against scala.collection.Map[Byte, EvaluatedValue[_ <: SType]] in tests

related: #681

@ccellado ccellado linked a pull request Apr 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants