Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate unique nonces for concurrent blockchain txns (#330)
A single address can not publish multiple transactions to the chain concurrently. If it does, we see this: ``` $ cargo run --package xdbg -- -d -b local generate -e identity -a 5 Finished `dev` profile [unoptimized] target(s) in 0.20s Running `target/debug/xdbg -d -b local generate -e identity -a 5` Error: 0: API error: API client error: mls error: status: Internal, message: "error publishing group message: rpc error: code = Internal desc = error publishing identity update: nonce too low", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} } 1: API client error: mls error: status: Internal, message: "error publishing group message: rpc error: code = Internal desc = error publishing identity update: nonce too low", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} } 2: mls error: status: Internal, message: "error publishing group message: rpc error: code = Internal desc = error publishing identity update: nonce too low", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} } 3: status: Internal, message: "error publishing group message: rpc error: code = Internal desc = error publishing identity update: nonce too low", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} } ``` This introduces a lock to prevent concurrent/parallel transactions. This won't work in a HA scenario as multiple payer processes can have the same private key. The solution is to give a new key to every payer.
- Loading branch information