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

Dealing with next Hive Hard Fork 26 and testing in advance #56

Closed
brianoflondon opened this issue Sep 11, 2022 · 1 comment · Fixed by #57
Closed

Dealing with next Hive Hard Fork 26 and testing in advance #56

brianoflondon opened this issue Sep 11, 2022 · 1 comment · Fixed by #57
Assignees
Labels
enhancement New feature or request

Comments

@brianoflondon
Copy link
Collaborator

We used to have in the code a facility to switch to a testnet API but that was removed.

I'm looking at either putting that back so I can run tests for the upcoming Hard Fork:

https://peakd.com/hive-139531/@blocktrades/14th-update-of-2022-hive-hf26-release-candidate-and-mirrornet-api-node-ready-for-app-testing

The new release candidate has an informal date of Oct 11th for the date of the hardfork. The code requires us to always specify some date, and this was the earliest “feasible” date that we considered for it (feasible in terms of giving sufficient time for other parts of the ecosystem to be prepared for the hardfork). Discussions among various stakeholders supporting the ecosystem (core devs, apps devs, witnesses, api node operators, etc) will be necessary before this date or a later date can be made official. And, of course, it is always possible that we encounter some problematic error despite our quite rigorous testing that could cause the date to be pushed (but I think it is unlikely).
@brianoflondon brianoflondon self-assigned this Sep 11, 2022
@brianoflondon brianoflondon added the enhancement New feature or request label Sep 11, 2022
brianoflondon added a commit that referenced this issue Sep 13, 2022
Signed-off-by: Brian of London <[email protected]>
@brianoflondon brianoflondon linked a pull request Sep 28, 2022 that will close this issue
agates pushed a commit that referenced this issue Oct 10, 2022
* Update defaults to match current values

Defaults now match those held by @podping account on Hive as of 2022-08-26

* Fixes #54

Allow `hive_operation_period` to be set by ENV on startup and ignore overrides from control account
Fixes #54

* testing and preparing for HF26

Signed-off-by: Brian of London <[email protected]>

* fix warning for depreciated poetry option

Signed-off-by: Brian of London <[email protected]>

* linting

Signed-off-by: Brian of London <[email protected]>

* hard coded test against a testnet if one exists

Signed-off-by: Brian of London <[email protected]>

* bump version to 1.2.7

Signed-off-by: Brian of London <[email protected]>

* poetry updates

Signed-off-by: Brian of London <[email protected]>

* fix for stupidity reading envs

Signed-off-by: Brian of London <[email protected]>

* improve error handling in logging

Signed-off-by: Brian of London <[email protected]>

* fix test #51

Signed-off-by: Brian of London <[email protected]>

* update test_name in test #56

Signed-off-by: Brian of London <[email protected]>

* poetry updates

Signed-off-by: Brian of London <[email protected]>

Signed-off-by: Brian of London <[email protected]>
@brianoflondon
Copy link
Collaborator Author

@agates

I had to do a fair bit of work and testing to make RC Depletion handle as a retry. I believe I have all the automated tests working though I will admit they sometimes fail on Main net even though I know they work more reliably on the post HF26 FakeNet (this is desired anyway).

In the end very small code changes.

It's quite important that @daveajones starts running this today I think.

I know we've cut this really tight.

A key point is that I've hard coded the 3 most reliable API servers in. I think this is necessary for the next week or so AT LEAST as I know these three should be reliable. After everything shakes out we might go back to the default list in Lighthive.

        else:
            nodes = [
                "https://hive-api.arcange.eu",
                "https://api.deathwing.me",
                "https://api.hive.blog",
            ]

This is from the automated test and I'll explain below:

2022-10-11 08:34:25 [   ERROR] Failed to send 7 IRIs (podping_hivewriter.py:489)
2022-10-11 08:34:25 [   ERROR]  (podping_hivewriter.py:492)
2022-10-11 08:34:25 [ WARNING] Malformed error response (podping_hivewriter.py:506)
2022-10-11 08:34:25 [    INFO] FAILURE COUNT: 47 - RETRYING 7 IRIs (podping_hivewriter.py:473)
2022-10-11 08:34:27 [   ERROR] send_notification error: payer has not enough RC mana for transaction:Account: *** has 271970563 RC, needs 979072257 RC. Please wait to transact, or power up HIVE. (podping_hivewriter.py:404)
2022-10-11 08:34:27 [   ERROR] payer has not enough RC mana for transaction:Account: *** has 271970563 RC, needs 979072257 RC. Please wait to transact, or power up HIVE. (podping_hivewriter.py:415)
2022-10-11 08:34:27 [   ERROR] Failed to send 7 IRIs (podping_hivewriter.py:489)
2022-10-11 08:34:27 [   ERROR]  (podping_hivewriter.py:492)
2022-10-11 08:34:27 [ WARNING] Malformed error response (podping_hivewriter.py:506)
2022-10-11 08:34:27 [    INFO] FAILURE COUNT: 48 - RETRYING 7 IRIs (podping_hivewriter.py:473)
2022-10-11 08:34:29 [   ERROR] send_notification error: payer has not enough RC mana for transaction:Account: *** has 271970563 RC, needs 979072257 RC. Please wait to transact, or power up HIVE. (podping_hivewriter.py:404)
2022-10-11 08:34:29 [   ERROR] payer has not enough RC mana for transaction:Account: *** has 271970563 RC, needs 979072257 RC. Please wait to transact, or power up HIVE. (podping_hivewriter.py:415)
2022-10-11 08:34:29 [   ERROR] Failed to send 7 IRIs (podping_hivewriter.py:489)
2022-10-11 08:34:29 [   ERROR]  (podping_hivewriter.py:492)
2022-10-11 08:34:29 [ WARNING] Malformed error response (podping_hivewriter.py:506)
2022-10-11 08:34:29 [    INFO] FAILURE COUNT: 49 - RETRYING 7 IRIs (podping_hivewriter.py:473)
2022-10-11 08:34:30 [    INFO] Lighthive Node: https://api.hive.blog/ (podping_hivewriter.py:401)
2022-10-11 08:34:30 [    INFO] JSON size: 682 (podping_hivewriter.py:402)
2022-10-11 08:34:30 [    INFO] FAILURE CLEARED after 49 retries (podping_hivewriter.py:486)
2022-10-11 08:34:30 [    INFO] Batch send time: 101.56 | Failures: 49 - IRI batch_id 4636b5e0-349d-4b70-9a85-dde7ad26bbb8 | IRIs in batch: 7 | last_node: https://api.hive.blog/ (podping_hivewriter.py:236)
PASSED

During the git test I actually managed to run out of Resource Credits for the podping.gittest account. This happened TODAY because the RC Delegation bot I'm running doesn't yet work on Main Net so while this test was stalled, I manually gave more Hive Power to the podping.gittest account. That did the trick and after 49 retries the test continued successfully.

Post HardFork 26 this RC Delegation (instead of a Hive Power delegation) would have happened automatically.

I actually want to change the messages here but right now I'm sure it is working and I'm going to leave it alone. Testing against the HF25 and HF26 chains simultaneously is really hard so I'd rather cosmetically improve this after everything shakes out.

As far as writing test scripts to simulate this I think it is not necessary right now but perhaps I will think about how to do that.

@brianoflondon brianoflondon pinned this issue Oct 11, 2022
agates added a commit that referenced this issue Oct 15, 2022
* Re-add testnet API to Hive client (#57)

* Update defaults to match current values

Defaults now match those held by @podping account on Hive as of 2022-08-26

* Fixes #54

Allow `hive_operation_period` to be set by ENV on startup and ignore overrides from control account
Fixes #54

* testing and preparing for HF26

Signed-off-by: Brian of London <[email protected]>

* fix warning for depreciated poetry option

Signed-off-by: Brian of London <[email protected]>

* linting

Signed-off-by: Brian of London <[email protected]>

* hard coded test against a testnet if one exists

Signed-off-by: Brian of London <[email protected]>

* bump version to 1.2.7

Signed-off-by: Brian of London <[email protected]>

* poetry updates

Signed-off-by: Brian of London <[email protected]>

* fix for stupidity reading envs

Signed-off-by: Brian of London <[email protected]>

* improve error handling in logging

Signed-off-by: Brian of London <[email protected]>

* fix test #51

Signed-off-by: Brian of London <[email protected]>

* update test_name in test #56

Signed-off-by: Brian of London <[email protected]>

* poetry updates

Signed-off-by: Brian of London <[email protected]>

Signed-off-by: Brian of London <[email protected]>

* Update CLI docs

* Lighthive/zmq/tooling updates

* Use new lighthive load balancing/node selection

* Fix missing property on Config

* Fix tests, refactor error handling/logging, catch more API node failures

* More specific error handling in listen_for_custom_json_operations

* Handle RC depletion

Changes to handle RC depletion by retrying.

Separate to this software, Brianoflondon will be running a service which gives RC delegations to any podping sending account.

This should be fast enough to fix RC depletion so the correct response from HiveWriter will be to re-try.

* Bump version

Signed-off-by: Brian of London <[email protected]>

* Limit nodes to exclude pharesim and others.

Signed-off-by: Brian of London <[email protected]>

* Removed https://hived.emre.sh/

Signed-off-by: Brian of London <[email protected]>

* Catch and handle RC Depletion

This introduces a sleep timer which gives time for the RC delegation script to delegate more RCs to the server.

* Catch RC exhaustion

Uses secrets for random wait time with exponential back off.

* Test for NotEnoughResourceCredits error

* lint

Signed-off-by: Brian of London <[email protected]>

* version back to 1.2.7

Signed-off-by: Brian of London <[email protected]>

* Remove random time in wait for RC Delegation

Signed-off-by: Brian of London <[email protected]>

* Unit test for not enough RCs

Signed-off-by: Brian of London <[email protected]>

* Fix issue caused by git merge

Signed-off-by: Brian of London <[email protected]>

* remove failing resource checks on startup

Signed-off-by: Brian of London <[email protected]>

* Add send_notification_iris to #48 regression tests

* Make startup error handling more clear, construct_operation non-async

* Catch TooManyCustomJsonsPerBlock for backoff

* Separate exception catch for TooManyCustomJsonsPerBlock, sleep one block

Signed-off-by: Brian of London <[email protected]>
Co-authored-by: Alecks Gates <[email protected]>
@agates agates closed this as completed Oct 15, 2022
@agates agates unpinned this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants