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

Modifications/Testing for Speedup strategy #22

Merged
23 commits merged into from
Mar 11, 2024

Conversation

derekpierre
Copy link
Member

@derekpierre derekpierre commented Mar 1, 2024

Based over #21 .

Related to #15.

Fixes #19

This speed up strategy is fairly aggressive by default - we can think about ways to dial it back. That being said, it attempts to be customizable.

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2024

Codecov Report

Attention: Patch coverage is 98.28326% with 4 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@6248d7d). Click here to learn what that means.

Files Patch % Lines
atxm/machine.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #22   +/-   ##
=======================================
  Coverage        ?   90.48%           
=======================================
  Files           ?       14           
  Lines           ?     1261           
  Branches        ?        0           
=======================================
  Hits            ?     1141           
  Misses          ?      120           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@derekpierre derekpierre changed the title [WIP] Testing for Speedup strategy [WIP] Modifications/Testing for Speedup strategy Mar 4, 2024
@derekpierre derekpierre self-assigned this Mar 4, 2024
…TransactionFaulted for unrecoverable/don't bother retrying errors, return updated params for an updated retry, or None if the strategy has no recommendation for updated params and the params should remain unchanged in which case wait for the existing tx a little while longer.

There is no need to raise a Wait exception, since other strategies may feel differently.
…rn None if the machine should do nothing and wait based on this strategy.

Remove Wait exception and its uses.
Ensure that even if some txs don't include both maxPriorityFeePerGas and maxFeePerGas the strategy still works.
Handle legacy transaction speed up.
Parameterize speed up factor and max tip.
Questions remain about the default for max tip, but since parameterized, less of an issue - but something to revisit.
…ggested tip as a way to limit the speedup strategy getting out of control.

Update maxFeePerGas depending on whether previously set or not - web3 py uses a default that doubles the base fee as part of maxFeePerGas so we probably don't want to further double that again.
Clean up constructor params validation and update tests.
Use tx.id in addition to nonce for speed up logs.
…resent in transaction parameters (eip1559 allows one or both).
…re expontential because they build on previous updates.
…meout is too short and warn threshold becomes too low.

Loosen warn factor from 5% to 15%.
@derekpierre derekpierre changed the title [WIP] Modifications/Testing for Speedup strategy Modifications/Testing for Speedup strategy Mar 4, 2024
@derekpierre derekpierre marked this pull request as ready for review March 4, 2024 21:35
@derekpierre derekpierre mentioned this pull request Mar 5, 2024
self.speedup_factor = 1 + speedup_increase_percentage
self.max_tip_factor = max_tip_factor

def _calculate_eip1559_speedup_fee(self, params: TxParams) -> Tuple[int, int, int]:
Copy link
Member Author

Choose a reason for hiding this comment

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

@vzotova , @cygnusv pay particular attention to this logic, and the logic in _calculate_legacy_speedup_fee().

@KPrasch KPrasch closed this pull request by merging all changes into nucypher:main in 667030f Mar 11, 2024
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.

FixedRateSpeedUp seems to hit the max tip immediately in tests
4 participants