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
Andrew Plaza edited this page Nov 17, 2021
·
12 revisions
List of some queries I've found to be useful.
All encoded storage items under a specific prefix
example uses SystemAccount prefix
-- Query for all storage items under a specific key prefixSELECT encode(storage::bytea, 'hex'), block_num FROM
(SELECTstorage.key, storage.storage, storage.block_num, blocks.specFROM storage, blocks
WHEREstorage.keylike (E'\\x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9')::bytea||'%'ANDblocks.block_num=storage.block_numANDblocks.spec=2023
) as z
ORDER BY block_num;
Blocks that have not been executed for storage changes
SELECT block_num FROM blocks
WHERE NOT EXISTS
(SELECT block_num FROM storage WHEREstorage.block_num=blocks.block_num)
ORDER BY block_num;
Blocks where a runtime upgrade has occurred
SELECT DISTINCTON (spec) spec, block_num
FROM blocks
ORDER BY spec, block_num ASC;