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
WIP Smart worker check for open window + persistent error mgmt (#66)
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v ✰ Thanks for creating a PR! You're awesome! ✰
v Please note that maintainers will only review those PRs with a
completed PR template.
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->
## Purpose of Changes and their Description
Smart window detection, reducing the need queries for open nonces
* Refactored mechanism to use same for workers and reputers via
interface.
* Fair offset calculation within window
* Configurable and generic `QueryDataWithRetry`, to further reduce the
chance of missing an epoch
* Added parameters to control the mechanism, explained in README
Other fixes
* Account Sequence and Fees error mgmt is now robust - there's
persistence of errors.
* Loglevels - adding Trace.
* Use of retries in all queries for robustness.
* More robust registration and staking, using confirmation of
registration and stake before going forward (otherwise the actor will
just get its tx continuously rejected)
* Fix panic when account on the keyring suddenly vanishes (eg cases of
key removal or rebuilding keyring)
* Added GetTopic query and others
## Link(s) to Ticket(s) or Issue(s) resolved by this PR
## Are these changes tested and documented?
- [X] If tested, please describe how. If not, why tests are not needed.
-- Tested against testnet, also added further unit tests
- [X] If documented, please describe where. If not, describe why docs
are not needed. -- On README. Added explanation and text-based
visualization.
- [x] Added to `Unreleased` section of `CHANGELOG.md`?
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,17 +41,18 @@ All notable changes to this project will be documented in this file.
41
41
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
42
42
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for all versions `v1.0.0` and beyond (still considered experimental prior to v1.0.0).
43
43
44
-
## [Unreleased]
44
+
## v0.6.0
45
45
46
46
### Added
47
+
*[#66](https://github.com/allora-network/allora-offchain-node/pull/66) Smart worker detection of submission windows + persistent error management + query retrials + reg/stake robustness + improved logging
48
+
*[#81](https://github.com/allora-network/allora-offchain-node/pull/81) Timeout height handling on tx submission
Copy file name to clipboardExpand all lines: README.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ from the root directory. This will:
25
25
5. Run `docker compose up --build`. This will:
26
26
- Run the both the offchain node and the source services, communicating through endpoints attached to the internal dns
27
27
28
-
Please note that the environment variable will be created as bumdle of your config.json and allora account secrets, please make sure to remove every sectrets before commiting to remote git repository
28
+
Please note that the environment variable will be created as bumdle of your config.json and allora account secrets, please make sure to remove every secrets before commiting to remote git repository
29
29
30
30
31
31
## How to run without docker
@@ -69,6 +69,64 @@ Some metrics has been provided for in the node. You can access them with port `:
69
69
70
70
> Please note that we will keep updating the list as more metrics are being added
71
71
72
+
## Cycle Example
73
+
74
+
Visualization of timeline and submission windows for an actor, in this case, a worker.
75
+
Reputers have submission windows too, but they are fixed to be 1 full topic's epoch length.
• Submission Window: 100 blocks (coincides with epoch)
103
+
• Near Zone: Last 20 blocks (NUM_SUBMISSION_WINDOWS_FOR_SUBMISSION_NEARNESS * WorkerSubmissionWindow)
104
+
105
+
-------------------------------
106
+
- Full cycle transition points
107
+
- Block 1000: Epoch N starts & Submission Window opens
108
+
- Block 1010: Submission Window closes. Waiting for next window, typically from far zone.
109
+
- Block 1080: Enters Near Zone (more frequent checks)
110
+
- Block 1100: Epoch N ends & Epoch N+1 starts
111
+
112
+
```
113
+
114
+
### Notes
115
+
116
+
- Submissions
117
+
- Submissions are accepted within the submission window
118
+
- Submission window opens at epoch start
119
+
- Waiting Zone Behavior
120
+
- The behaviour of the node when waiting for the submission window depends on its nearness to the submission window to reduce likelihood of missing a window.
121
+
- Far Zone: Longer intervals between checks, optimized for efficiency
122
+
- This is controlled by `blockDurationEstimated` and `windowCorrectionFactor`
123
+
- Near Zone: More frequent checks with randomization for fair participation
124
+
- Submissions are separated - they must happen within the submission window
125
+
126
+
### Random offset
127
+
128
+
The node introduces a random offset to the submission time to avoid the thundering herd problem alleviating mempool congestion.
129
+
72
130
## How to configure
73
131
74
132
There are several ways to configure the node. In order of preference, you can do any of these:
@@ -106,6 +164,13 @@ Note: when an account sequence mismatch is detected, the node will attempt to se
106
164
-`retryDelay`: For all other errors that need retry delays.
107
165
108
166
167
+
### Smart Window Detection
168
+
169
+
The node will automatically detect the submission window length for each topic on each actor type.
170
+
This can be configured by the following settings in the config.json:
171
+
*`blockDurationEstimated`: Estimated network block time in seconds. Minimum is 1.
172
+
*`windowCorrectionFactor`: Correction factor to fine-tune the submission window length. Higher values optimize the number of calls for window checking. Minimum is 0.5.
173
+
109
174
## Configuration examples
110
175
111
176
A complete example is provided in `config.example.json`.
0 commit comments