You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Motivation:
current implementation of
ContextExtension
(auxiliary data provided during spending a UTXO in a transaction input) is using default Scala SDK's Map implementation: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 againstscala.collection.Map[Byte, EvaluatedValue[_ <: SType]]
in testsrelated: #681
The text was updated successfully, but these errors were encountered: