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
While negative ids of context extension variables are allowed in deserializer :
// ContextExtension.serializer
val values = (0 until extSize)
.map(_ => (r.getByte(), r.getValue().asInstanceOf[EvaluatedValue[_ <: SType]]))
negative id will cause exception during validation due to
// ErgoLikeContext.toSigmaContext
def contextVars(m: Map[Byte, AnyValue]): Coll[AnyValue] = {
val maxKey = if (m.keys.isEmpty) 0 else m.keys.max // TODO optimize: max takes 90% of this method
val res = new Array[AnyValue](maxKey + 1)
for ((id, v) <- m) {
res(id) = v
}
CSigmaDslBuilder.Colls.fromArray(res)
}
While negative ids of context extension variables are allowed in deserializer :
negative id will cause exception during validation due to
Rejection tests are done in ergoplatform/ergo#2104 .
Happily, a transaction with neg-id context extension variable will be rejected on all the levels (block/mempool/block candidate generation).
Thus shaping semantics of context extension variable ids (prohibition of negative ids) can be done in deserializer in non-breaking way.
Will be done in #951
The text was updated successfully, but these errors were encountered: