Skip to content

parallel calls to blob.Submit sometimes trigger broadcast tx error: account sequence mismatch #3986

Open
@zvolin

Description

@zvolin

Celestia Node version

0.20.4

OS

nixos unstable with asahi

Install tools

docker

Others

No response

Steps to reproduce it

I'm reposting #3164 (comment) as a new issue per request from @Bidon15. Related to #3164 and #3980.

In lumina for a long time we had a lock in rpc tests that sequenced calls to blob.Submit. I tried removing it and it still quite reliably results in:

---- blob_submit_and_get stdout ----
thread 'blob_submit_and_get' panicked at rpc/tests/blob.rs:24:72:
called `Result::unwrap()` on an `Err` value: Call(ErrorObject { code: ServerError(1), message: "broadcast tx error: account sequence mismatch, expected 5, got 6: incorrect account sequence", data: None })

For reproduction

git clone [email protected]:eigerco/lumina && cd lumina
docker compose -f ci/docker-compose.yml up --build --force-recreate -d
./tools/gen_auth_tokens.sh

# remove the mentioned lock
patch -p1 <<"EOF"
diff --git a/rpc/tests/utils/client.rs b/rpc/tests/utils/client.rs
index 55beb7d..1e7681c 100644
--- a/rpc/tests/utils/client.rs
+++ b/rpc/tests/utils/client.rs
@@ -55,6 +55,6 @@ pub async fn blob_submit<C>(client: &C, blobs: &[Blob]) -> Result<u64, ClientErr
 where
     C: SubscriptionClientT + Sync,
 {
-    let _guard = write_lock().await;
+    // let _guard = write_lock().await;
     client.blob_submit(blobs, TxConfig::default()).await
 }
EOF

# run rpc tests
cargo test -p celestia-rpc

After it reproduces, all subsequent calls fail with this error

Expected result

no errors

Actual result

---- blob_submit_and_get stdout ----
thread 'blob_submit_and_get' panicked at rpc/tests/blob.rs:24:72:
called `Result::unwrap()` on an `Err` value: Call(ErrorObject { code: ServerError(1), message: "broadcast tx error: account sequence mismatch, expected 5, got 6: incorrect account sequence", data: None })

Relevant log output

No response

Is the node "stuck"? Has it stopped syncing?

No response

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexternalIssues created by non node team members

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions