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

Reschedule too early events #1152

Merged

Conversation

netcriptus
Copy link
Contributor

Solves #1149

@auto-assign auto-assign bot requested a review from fredo February 16, 2022 16:26
@netcriptus netcriptus requested review from weilbith and removed request for fredo February 16, 2022 16:27
Copy link
Contributor

@weilbith weilbith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nitpicks and a bigger discussion point (there no approval yet). But no critique to your work. Very good job. Simple and effective. 👍🏾
Not your fault: I hate the end-to-end test. It is incredibly long with 90% basic stuff the exact case doesn't care about (which comes at the very end).

src/monitoring_service/handlers.py Outdated Show resolved Hide resolved
src/monitoring_service/service.py Outdated Show resolved Hide resolved
src/monitoring_service/service.py Outdated Show resolved Hide resolved
tests/monitoring/monitoring_service/test_end_to_end.py Outdated Show resolved Hide resolved
Copy link
Contributor

@weilbith weilbith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏾

The database schema defining the token network table defines the settle timeout
column as an hex integer. The Python module interacting with the database as
a regular number. In result the later read number is a different then the
originally inserted one.

This commit includes an unrelated autoformatting change.
@netcriptus netcriptus merged commit f4bfe06 into raiden-network:arbitrum Feb 22, 2022
@netcriptus netcriptus deleted the feature/handle-time-sync branch February 22, 2022 11:15
karlb added a commit that referenced this pull request Feb 24, 2022
* adapt monitoring to use timestamps (#1144)

* Reschedule too early events (#1152)

* add automatic adaption of confirmations blocks

When the user does not manually define a number of confirmation blocks for the
PFS or MS and the chain is detected to be Arbitrum, it will automatically set
the number to zero. On Arbitrum based chains there are no confirmation blocks
necessary.

* Stop trying scheduled events after TooEarlyExc

When the scheduled event with the lowest timestamp fails with a
TransactionTooEarlyException, then we know that all other events would
do that, too. So there is no reason to continue executing scheduled
events at the moment.

* Reduce the retry frequency of scheduled events.

We don't want to put too much load on the ETH-RPC node and risk getting
blocked or rate limited.

* Trigger CI for PRs on all branches

This would have helped when working on the arbitrum branches.

* chore: Deprecate support for python 3.7

* Test retry changes in test_reschedule_too_early_events

* Ensure ordering of scheduled events.

* fix usage of eth-tester import in production

Importing anything from eth-tester does not work in production as it is a test
dependency that is not available. In result the monitoring service was failing
to start.
The import was used to test if a failed update balance proof transaction should
be retried or not. The challenge is that in test mode, web3 forwards eth-tester
exceptions untouched. That is not the same in production mode. Thereby the error
looks slightly different. But both are based on the BaseException class. So it
is possible to just verify their error message without matching the exact error
class.

This bug got introduced with a recent feature implementation. Unfortunately the
CI pipeline was not properly working, which allowed to introduce this mistake.

Co-authored-by: Fernando Cezar <fernando@brainbot.com>
Co-authored-by: Thore Strassburg <thore@weilbier.net>
Co-authored-by: Paul Lange <palango@gmx.de>
@weilbith weilbith mentioned this pull request Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle unsynchronized clocks between monitoring service and blockchain node
2 participants