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

refactor so txm owns blockhash assignment #928

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Farber98
Copy link
Contributor

@Farber98 Farber98 commented Nov 15, 2024

Description

Part 1:

  • moved blockhash assignment from transmitter and chain to txm. Needed to track expiration in Part 2.
  • reduce sendWithRetry complexity by dividing logic into smaller helper funcs. It was really hard to follow and had a lot of responsibilities.

Part 2:

  • Create a loop that, every TxExpirationTimeout, retrieves the slotHeight and checks if txes in our broadcastedMap that are in a broadcasted state have expired.
  • We do this by adding lastValidBlockHeight to the pendingTx when we create it. This allows us to compare the slotHeight to see if it has exceeded that value and decide if we need to rebuild and rebroadcast the transaction.
  • To achieve this, we will need to move the blockhash assignment logic to the sendWithRetry function.
  • If we need to rebroadcast a transaction, we should:
    • remove previous one by calling the Remove()
    • build the new transaction and call sendWithRetry with it

https://smartcontract-it.atlassian.net/browse/NONEVM-706

@Farber98
Copy link
Contributor Author

until this point, only refactor of existing logic:

  • moved blockhash assignment to txm
  • reduce sendWithRetry complexity making it simpler/clearer

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.

1 participant