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
Starting up kli witness demo after performing kli migrate run for each witness should bring up the demo witness set.
Actual behavior
The following error occurs:
$ kli witness demo
Witness wan : BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
ERR: invalid literal forint() with base 16: b'EA59RST48MLqNoh_jNxHysEXFL4PeQlj2mII0TVEdz64'
The bug is that the splitOnKey in LMDBer.getTopIoSetItemIter is using splitOnKey which expects the second part of the tuple to be a base16 serial number yet the key that is put in there is a dgKey, or a (pre, said) tuple.
classLMDBer(filing.Filer):
...
defgetTopIoSetItemIter(self, db, top=b'', *, sep=b'.'):
...
foriokey, valinself.getTopItemIter(db=db, top=top):
key, ion=splitOnKey(iokey, sep=sep)
yield (key, val)
defsplitOnKey(key, *, sep=b'.'):
...
ifisinstance(key, memoryview):
key=bytes(key)
top, on=splitKey(key, sep=sep)
on=int(on, 16)
return (top, on)
classKevery:
...
defprocessQueryNotFound(self):
...
key=ekey=b''# both start same. when not same means escrows foundpre=b''sn=0whileTrue: # break when donefor (pre, said), ediginself.db.qnfs.getItemIter(keys=key):
Steps to reproduce
Check out keripy repo and change to the keripy directory
git switch v1.1.18
python3 -m pip install -e ./
kli witness demo
`cd scripts/demo && source demo-scripts.sh
Modify the ./scripts/demo/basic/delegate.sh to exit prior to the call on line 12 to kli delegate confirm --name delegator --alias delegator -Y & which will cause a query not found message to remain in that escrow, the hab.db.qnfs database.
Run the script in `./scripts/demo/basic/delegate.sh
The modified delegate.sh script (exit before delegation confirmation) was key to reproducing this bug. Yet it may not be that important of a bug. It only occurs if you happen to have a message in the hab.db.qnfs database prior to upgrading from 1.1.18 to 1.2.0rc2. This occurs because in 1.1.18 the blank serial number (all zeroes) is not appended to the key used to look up an entry from the .qnfs database - the key looks something like this (note the periods) which fails the type conversion in splitOnKey:
While this does prevent a witness from starting and thereby could be a major problem for someone there is also the possibility of updating the migration script to add the number suffix on any entry in the .qnfs database.
Version
1.2.0rc2
Environment
Mac OS, Python 3.12.3, local deployment
Expected behavior
Starting up
kli witness demo
after performingkli migrate run
for each witness should bring up the demo witness set.Actual behavior
The following error occurs:
The bug is that the splitOnKey in LMDBer.getTopIoSetItemIter is using splitOnKey which expects the second part of the tuple to be a base16 serial number yet the key that is put in there is a dgKey, or a (pre, said) tuple.
Steps to reproduce
git switch v1.1.18
python3 -m pip install -e ./
kli witness demo
./scripts/demo/basic/delegate.sh
to exit prior to the call on line 12 tokli delegate confirm --name delegator --alias delegator -Y &
which will cause a query not found message to remain in that escrow, the hab.db.qnfs database.git switch v1.2.0rc2
python3 -m pip install -e ./
list=(wan wes wil wit wub wyz); printf '%s\n' "${list[@]}" | xargs -I {} kli migrate run --name {}
kli witness demo
then you will get a value error like:
This will stop your witnesses from starting.
The text was updated successfully, but these errors were encountered: