Open gibson042 opened 1 month ago
As implied at https://github.com/endojs/endo/blob/b3a31b1559118dcfcd3811e9632c3f28fba99a3c/packages/marshal/src/encodePassable.js#L861-L865 and noted explicitly in https://github.com/Agoric/agoric-sdk/issues/2589#issuecomment-2427675183 , agoric-sdk liveslots expects | to be a prefix that sorts after all encoded values. But that assumption would no longer hold if ~-prefixed compactOrdered encodings were stored as-is. Here in endo, we can either assume that agoric-sdk will find a suitable workaround, or switch to a different prefix that does not suffer from this issue. The initial choice of ~ was mostly arbitrary, but did strive to avoid overloading any existing special character. Were we to stick with that goal, we'd be looking at candidates like
|
~
{
"
#
$
%
&
+
-
'
)
*
,
.
/
;
<
=
>
@
\
]
_
`
Describe the bug
As implied at https://github.com/endojs/endo/blob/b3a31b1559118dcfcd3811e9632c3f28fba99a3c/packages/marshal/src/encodePassable.js#L861-L865 and noted explicitly in https://github.com/Agoric/agoric-sdk/issues/2589#issuecomment-2427675183 , agoric-sdk liveslots expects
|
to be a prefix that sorts after all encoded values. But that assumption would no longer hold if~
-prefixed compactOrdered encodings were stored as-is. Here in endo, we can either assume that agoric-sdk will find a suitable workaround, or switch to a different prefix that does not suffer from this issue. The initial choice of~
was mostly arbitrary, but did strive to avoid overloading any existing special character. Were we to stick with that goal, we'd be looking at candidates like{
(which sorts after any other encoding but overloads the JSON begin-object token)"
(which overloads the JSON string quote)#
(which overloads the CapData body smallcaps prefix and smallcaps special-constant prefix)$
/%
/&
/+
/-
(which overload smallcaps type prefixes)'
/)
/*
/,
(which are reserved by smallcaps but not currently used).
//
/;
/<
/=
/>
/@
/\
/]
/_
/`
(no known conflicts other than sorting in between legacy passable encodings)