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

Forks can cause transactions to get stuck #1927

Open
wilwade opened this issue Apr 3, 2024 · 0 comments
Open

Forks can cause transactions to get stuck #1927

wilwade opened this issue Apr 3, 2024 · 0 comments
Labels
blocked Blocked by another issue bug Something isn't working

Comments

@wilwade
Copy link
Collaborator

wilwade commented Apr 3, 2024

The transaction pool is sometimes reject transactions when building a fork.

Example CI run with the issue: https://github.com/LibertyDSNP/frequency/actions/runs/8527529557/job/23359157130

Details of this are in the references, but here is a quote from https://hackmd.io/@_FY3-hvwQZ6cX_4n8zYUNA/HJqUWj4_s

The ready_at method operates on block height. It is not synced with maintenance process in terms of forks. This results in two major issues:

when building new blocks on top of block which are not best or finalized, the invalid::stale error will occur. This is because the transaction pruning was not executed on block import,

A -- B0[u0] -- C0[..] // If the maintenance was *not* triggered for B0, 
                      // ready_at will provide u0 when building C0 , 
                      // (which is stale from B0 perspective)

when constructing new blocks on an alternative fork, the invalid::future error might arise. This occurs when blocks on the alternative fork lack transactions that serve as prerequisites for transactions present in the ready pool. As the maintained for contains these prerequisite transactions the ready set would comprise transactions that are considered future on the alternative fork. See the figure below:

   B1[u0,u1]--C1[u2]  //u3 is ready, after maintenance was triggered for C1
 /
A
 \
   B0[t0,t1]--C0      //when building C0 ready_at will provide u3, 
                      //which is future from B0 perspective

How to reproduce on Testnet Paseo

  • Run the e2e tests
  • See that tests fail
  • See that the rpc node has pending extrinsics

(Note I have cleared out all pending extrinsics from prior test runs)

How to reproduce locally

Use branch: ci-update/e2e-paseo

Might not be possible without a lot of work, but this appears to work:

  • Download/Build (mac) Polkadot 1.8+
  • Startup Paseo Local Alice and Bob using the Paseo Local spec in resources
  • Register per normal make command
  • Start Frequency Alice and Bob
  • Onboard per normal make command
  • Run e2e tests
  • See failures

Suggested Solution

Wrap the transaction pool in a custom implementation that handles the issue in the short term.

Long-term Solution

Upgrade to a version of Polkadot-SDK with the issue resolved and remove any short-term solutions.

References

@wilwade wilwade added the bug Something isn't working label Apr 3, 2024
@wilwade wilwade added this to the 2024 Q2 Tech Debt milestone Apr 19, 2024
@wilwade wilwade added the blocked Blocked by another issue label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by another issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants