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
For now I fixed it in a quick and dirty way by applying the following changes to the running stellar-core DB:
CREATESCHEMAxdrs;
CREATE OR REPLACEFUNCTIONxdrs.xdr_int64(xdr bytea, inout pos integer, out result bigint) AS $$
SELECT pos +8, ('x'|| encode(substring(xdr from pos for 8), 'hex'))::bit(64)::bigint
$$ LANGUAGE SQL IMMUTABLE STRICT;
CREATE OR REPLACEFUNCTIONbuyingLiabilities(acc accounts) RETURNS bigintAS $$
SELECT coalesce(buying.value, 0)
FROM decode(acc.extension, 'base64') accraw(xdrbytes),
xdrs.xdr_int64(accraw.xdrbytes, 5) as buying(pos, value)
$$ LANGUAGE SQL IMMUTABLE STRICT;
CREATE OR REPLACEFUNCTIONsellingLiabilities(acc accounts) RETURNS bigintAS $$
SELECT coalesce(selling.value, 0)
FROM decode(acc.extension, 'base64') accraw(xdrbytes),
xdrs.xdr_int64(accraw.xdrbytes, 13) as selling(pos, value)
$$ LANGUAGE SQL IMMUTABLE STRICT;
CREATE OR REPLACEFUNCTIONbuyingLiabilities(tl trustlines) RETURNS bigintAS $$
SELECT coalesce(buying.value, 0)
FROM decode(tl.extension, 'base64') accraw(xdrbytes),
xdrs.xdr_int64(accraw.xdrbytes, 5) as buying(pos, value)
$$ LANGUAGE SQL IMMUTABLE STRICT;
CREATE OR REPLACEFUNCTIONsellingLiabilities(tl trustlines) RETURNS bigintAS $$
SELECT coalesce(selling.value, 0)
FROM decode(tl.extension, 'base64') accraw(xdrbytes),
xdrs.xdr_int64(accraw.xdrbytes, 13) as selling(pos, value)
$$ LANGUAGE SQL IMMUTABLE STRICT;
It seems to solve an issue for the time being, but we need to update Astrograph ORM layer to work with the new LedgerEntry format which stores extensions as base64-encoded XDR: entry-specific extension (AccountEntryExt, TrustLineEntryExt) in extension column, and common extension (LedgerEntryExt) in ledgerext column. It's similar to how we currently work with account signers.
The text was updated successfully, but these errors were encountered:
stellar-core 15.0.0 introduces breaking changes to the DB schema: stellar/stellar-core#2593
For now I fixed it in a quick and dirty way by applying the following changes to the running stellar-core DB:
It seems to solve an issue for the time being, but we need to update Astrograph ORM layer to work with the new LedgerEntry format which stores extensions as base64-encoded XDR: entry-specific extension (
AccountEntryExt
,TrustLineEntryExt
) inextension
column, and common extension (LedgerEntryExt
) inledgerext
column. It's similar to how we currently work with account signers.The text was updated successfully, but these errors were encountered: