Uh oh!
There was an error while loading. Please reload this page.
refactor(batcher): retry function - #1273
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
JuArce
left a comment
There was a problem hiding this comment.
This provider is using main rpc instead of fallback https://github.com/yetanotherco/aligned_layer/pull/1273/files#diff-fb54942eba81c272160ef10dfb2972fd0a6de56d45ed87c98ca1a65b3b2dd29bR126-R127
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d556a33 to
7da5d3eCompareChanges to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
39fb306 to
7da5d3eCompareCo-authored-by: avilagaston9 <gavila@fi.uba.ar> Co-authored-by: samoht9277 <totobighouse@gmail.com> Co-authored-by: Urix <43704209+uri-99@users.noreply.github.com>
Motivation
This PR implements the
retry_function(), which receives a function to be retried using exponential backoff.Description
Modifies the batcher to use
retry_function()in the following calls:user_balance_is_unlockedget_user_nonce_from_ethereumget_user_balanceget_gas_prices3::upload_objectlisten_new_blocks()Stops using our forked version of
ethers-rssince is not longer needed.Observations
The calls within the
Batcher::new()function are not modified since in case of failure the program will panic (changes can be implemented if needed).Also
create_new_taskwas left for a different PR.All modified calls use the following default parameters:
DEFAULT_MIN_DELAY = 500DEFAULT_MAX_TIMES = 5DEFAULT_FACTOR = 2.0How to Test
Now try killing the container running the s3 service. You should see 5 warnings separated by exponential time:
There are also some test in
batcher/aligned-batcher/src/retry.rsYou can also add a
sleep()before the function you want to test in the batcher, and then kill Anvil before the call happens.