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
SELECT storage_cids.cid,blocks.data,
was_storage_removed(storage_path,block_number,'0x4d172383ff04943c44b55a043e56145db94caf7aed03487151f6182f1ce2ea78')
AS removed
FROM eth.storage_cids
INNER JOIN eth.state_cids ON (storage_cids.state_id = state_cids.id)
INNER JOIN eth.header_cids ON (state_cids.header_id = header_cids.id)
INNER JOIN public.blocks ON (storage_cids.mh_key = blocks.key)
WHERE state_leaf_key = '0x6114658a74d9cc9f7acf2c5cd696c3494d7c344d78bfec3add0d91ec4e8d1c45'
AND storage_leaf_key = '0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6'
AND block_number <= (SELECT block_number
FROM eth.header_cids
WHERE block_hash = '0x4d172383ff04943c44b55a043e56145db94caf7aed03487151f6182f1ce2ea78')
AND header_cids.id = (SELECTcanonical_header_id(block_number))
ORDER BY block_number DESC
LIMIT 1;
The above query will fetch the latest leaf node and this is passed on to was_storage_removed
This will always return false as the height in was_storage_removed is the block_number passed , so height = block_number but block_number > height condition will evaluate to false.
The issue of storage key removal is fixed in #83 but the same issue exists for state key removal.
Query to fetch storage leaf node
https://github.com/vulcanize/ipld-eth-server/blob/8a105812c206067b6f1d266ed2daea2f9b2176c6/pkg/eth/ipld_retriever.go#L146-L160
Example:
The above query will fetch the latest leaf node and this is passed on to
was_storage_removed
This is the code before it was fixed.
https://github.com/vulcanize/ipld-eth-server/blob/8a105812c206067b6f1d266ed2daea2f9b2176c6/db/migrations/00014_create_stored_functions.sql#L4-L17
This will always return false as the
height
inwas_storage_removed
is theblock_number
passed , soheight
=block_number
butblock_number > height
condition will evaluate to false.This is fixed for the storage node in the master branch.
https://github.com/vulcanize/ipld-eth-server/blob/000c0ef066b530698a4d29f827a269c8fb4433b8/db/migrations/00014_create_stored_functions.sql#L11-L14
Added a fix for state node #98
The text was updated successfully, but these errors were encountered: