Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address cache with -b flag issue #232

Open
buhtignew opened this issue Jan 20, 2025 · 0 comments
Open

address cache with -b flag issue #232

buhtignew opened this issue Jan 20, 2025 · 0 comments
Labels
error message An error message received

Comments

@buhtignew
Copy link
Collaborator

buhtignew commented Jan 20, 2025

While I was testing for the issue #230 I've seen another issue with the address cache command.
For instance right now I have the address msgZN3qC7x3QDfAoarMnQBEKshKvS6yyGC cached till the block 662910 , i.e. my address cache msgZN3qC7x3QDfAoarMnQBEKshKvS6yyGC -v output is:

Address: msgZN3qC7x3QDfAoarMnQBEKshKvS6yyGC
Block heights: [632115]
Last checked block (hash): 0000009a20d0d28956a779c4a353a8eab377bb690af534333cca6ec7eb9870e4
Last checked block (height): 662910
First checked block height: 0
Was this address cached discontinuously?: False

While the most recent block is 665771 right now, i.e. slimcoind getinfo contains the following line:

 "blocks" : 665771,

If I run address cache msgZN3qC7x3QDfAoarMnQBEKshKvS6yyGC -b 50 I get:

  File "~/.local/bin/pacli", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "~/.local/lib/python3.13/site-packages/pacli/__main__.py", line 494, in main
    fire.Fire({
    ~~~~~~~~~^^
        'config': Config(),
        ^^^^^^^^^^^^^^^^^^^
    ...<12 lines>...
        'checkpoint' : Checkpoint()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        })
        ^^
  File "~/.local/lib/python3.13/site-packages/fire/core.py", line 135, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "~/.local/lib/python3.13/site-packages/fire/core.py", line 468, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
                                ~~~~~~~~~~~~~~~~~~~^
        component,
        ^^^^^^^^^^
    ...<2 lines>...
        treatment='class' if is_class else 'routine',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        target=component.__name__)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/lib/python3.13/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "~/.local/lib/python3.13/site-packages/pacli/extended_classes.py", line 762, in cache
    return ei.run_command(self.__cache, _value, startblock=startblock, blocks=blocks, chain=chain, keyring=keyring, erase=erase, force=force, quiet=quiet, view=view, all_locators=all_locators, debug=debug)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/lib/python3.13/site-packages/pacli/extended_interface.py", line 35, in run_command
    result = c(*args, **kwargs)
  File "~/.local/lib/python3.13/site-packages/pacli/extended_classes.py", line 797, in __cache
    return bx.store_address_blockheights(addresses, start_block=startblock, blocks=blocks, force=force, quiet=quiet, debug=debug)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/.local/lib/python3.13/site-packages/pacli/blockexp.py", line 306, in store_address_blockheights
    blockdata = bu.show_txes_by_block(locator_list=addresses,
                                   startblock=start_block,
    ...<3 lines>...
                                   quiet=quiet,
                                   debug=debug)
  File "~/.local/lib/python3.13/site-packages/pacli/blockexp_utils.py", line 112, in show_txes_by_block
    percentage = round(rh / percent)
                       ~~~^~~~~~~~~
ZeroDivisionError: division by zero

(the same for any command that has less than 50 blocks after the -b flag).

However if the number of blocks after the -b flag is enough high the command runs smoothly (for instance the command address cache msgZN3qC7x3QDfAoarMnQBEKshKvS6yyGC -b 100 runs smoothly and doesn't report any error).

I'll try go on with testing to understand what is the maximum number of blocks after the -b flag at which the error is still displayed.

Update 24-01-2025
I've tested address cache msgZN3qC7x3QDfAoarMnQBEKshKvS6yyGC -b with different number of blocks afterwards and the error message appears till the block 51.

@buhtignew buhtignew added the error message An error message received label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error message An error message received
Projects
None yet
Development

No branches or pull requests

1 participant