chia-blockchain icon indicating copy to clipboard operation
chia-blockchain copied to clipboard

[Bug] need root information in get_keys_values, get_keys, get_value

Open fizpawiz opened this issue 2 years ago • 1 comments

What happened?

It is not clear how a datalayer subsciber would be able to tell that the data they have is out of date. get_keys_values, ket_keys and get_value should return at least the root associated with the data it returns, and preferably also a flag inidicating whether that data is current based on the most recent root on chain.

Version

1.6.0 dogfood

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

No response

fizpawiz avatar Sep 01 '22 23:09 fizpawiz

https://github.com/Chia-Network/chia-blockchain/pull/13306

to these calls we can add the root_hash parameter now. if the root_hash misses, it should throw exceptions:

chia data get_keys_values --id=f3e0af1285b7c19bce99b091e23abe0ce8ba4649d42b197bd382d9bfd2c88b49 --root_hash=0000000000000000000000000000000000000000000000000000000000000001
Exception from 'data': {'error': "Can't find keys and values for 0000000000000000000000000000000000000000000000000000000000000001", 'success': False}

chia data get_keys --id=f3e0af1285b7c19bce99b091e23abe0ce8ba4649d42b197bd382d9bfd2c88b49 --root_hash=0000000000000000000000000000000000000000000000000000000000000001
Exception from 'data': {'error': "Can't find keys for 0000000000000000000000000000000000000000000000000000000000000001", 'success': False}

chia data get_value --id=f3e0af1285b7c19bce99b091e23abe0ce8ba4649d42b197bd382d9bfd2c88b49 --root_hash=0000000000000000000000000000000000000000000000000000000000000001 --key=0000
Exception from 'data': {'error': 'Key not found: 0000', 'success': False}

fchirica avatar Sep 06 '22 11:09 fchirica

This issue has not been updated in 14 days and is now flagged as stale. If this issue is still affecting you and in need of further review, please comment on it with an update to keep it from auto closing in 7 days.

github-actions[bot] avatar Sep 23 '22 11:09 github-actions[bot]

I believe this is resolved in 1.6.2 with the changes in #13306 and the new get_sync_status from #13440

emlowe avatar Jan 06 '23 19:01 emlowe