One Signer, Many Workers: Lease Nonces Before Submit
Proposed N-630 workflow for a shared Ethereum signer.
Worker A records a signed Ethereum transaction and starts submitting it. Its RPC request times out. By the time worker B picks up the job, the short lease on worker A has expired. A read from worker B's provider shows no receipt. Both the old worker and the new worker can offer plausible explanations for what happened. The outgoing transaction may already be pending somewhere neither worker is looking.
The deciding question is which evidence belongs to the original business instruction. A worker timeout can transfer responsibility for investigating it. It cannot establish that an account nonce is free. A system that makes this distinction can keep accepting work while it pauses new commitments for one signer.
The nonce lease and runbook below are a proposed design for workers authorized to use a shared Ethereum externally owned account. All record identifiers and outcomes are fictional. The design uses no real addresses, keys or signed payloads. Apply it in a controlled test environment before relying on the behavior of a particular execution client or RPC service.
Give the account nonce one owner at a time
Ethereum.org describes the transaction nonce as:
a sequentially incrementing counter which indicates the transaction number from the account
Transactions, Ethereum developer documentation.
Nonce allocation belongs to the chain and sending account. Two workers submitting through different RPC endpoints still share the account's sequence if the account and chain are the same. A queue partition per worker or a per-process nonce counter therefore leaves a coordination gap. Replacing a worker, restarting a queue or changing RPC providers leaves the signing scope unchanged.
Give the signing service three separate identifiers. The first is the tuple of chain, sender and nonce. The second identifies the approved business instruction. The third identifies a particular signed transaction candidate. Keep the relationship between them visible in the operator's view. A hash belongs to a candidate. The instruction can outlive one hash if the operating policy authorizes a replacement. Conversely, two identical looking payouts can have different intent references if the business explicitly authorized both.
For example, a wallet service could reserve nonce 41 for instruction W-630. An operator later inspecting nonce 41 needs to see that instruction even if the dispatch job has been requeued. A revision to the instruction's destination or amount is a business change. It cannot inherit the existing approval merely because its worker wants to use the same lane. Record the proposed revision separately and leave the original case with its own evidence.
The chain identifier here is an application routing key. Verify it for every signing and observation path. Account details copied across environments make it easy to mistake a test observation for evidence about a live signer. A network name in a log line is weaker than an explicit, validated association with the signing and RPC configuration. Keep environment, signer identity and chain visible beside every result.
Separate the worker lease from the nonce reservation
A worker lease answers who is allowed to handle a record now. A reservation answers which instruction owns the proposed use of a nonce. The lifetime of an authorization to work on the record can be short. The lifetime of the record's reservation depends on observations about signing, submission and inclusion.
Consider an allocator that takes an exclusive lock on the defined signer lane while it checks for an existing reservation and inserts the next allocation. Back the allocation with a durable uniqueness rule over the signing scope and nonce. Assigning a new worker should update the lease generation on that reservation rather than insert another reservation for the same key. PostgreSQL's explicit-locking documentation describes row lock behavior. Lock ownership still has to be mapped to a consistent application boundary.
Use the same transaction for decisions that must stand or fail together. If the worker marks an instruction reserved but a crash prevents the associated record from being written, later work can have a false impression of safety. Add the link from the instruction to the nonce reservation when the allocation commits. Make the allocation operation idempotent for the exact approved instruction, so a caller that loses the response can retrieve its own reservation without consuming another nonce.
Keep the database transaction short. An RPC lookup or a long signing operation inside the critical section can make queue timing depend on the provider. Refresh chain observations separately and label their age and source. The allocator needs a clear rule about which observations it may use, when those observations are too old and what it does when they disagree. A process that cannot read current reservation state should leave the instruction queued for review.
A lease generation only helps if the service enforcing the next change actually checks it. The signing service and dispatch path must respect the currently authorized generation or an equivalent durable authorization reference. A worker that already obtained a signed transaction could still have a copy, regardless of whether a write to the lease database now fails. Design the boundary through which signing and dispatch occur to make that condition observable. No recycled lease should be presented as proof that old signed material cannot be sent.The reservation survives a change of worker. The next handler must reconcile the named candidate.
Keep the N-630 reservation readable during an incident
The record below illustrates what the receiving operator must recover after a worker disappears. Preserve the authoritative transaction fields in an access-controlled store. The shared record needs enough detail to trace the approved instruction and locate evidence without embedding a reusable payload.
Signing scope. Network identifier, sender reference and reserved nonce. Show a human-readable environment label with the validated scope. Include the basis for the initial sequence observation and when it was recorded.
Approved intent. Stable instruction reference, approval revision and scope fingerprint. Give reviewers a way to compare the approved operation with the candidate before they consider any further action. Keep the business data behind its existing access boundary.
Current handler. Worker or team reference, lease generation and expiry. Keep a previous generation in the history even after another worker accepts the investigation. Its expiry means subsequent state changes require a valid handler.
Candidate journal. Candidate hash, creation time, authorization reference and custody pointer. Store a separate observation for each dispatch attempt. A journal entry must identify which candidate was involved and whether dispatch certainty was established.
Chain observations. Query kind, provider, time, block context if applicable and result. A lookup that returned no transaction and one that could not complete are different observations. Neither should overwrite evidence that a candidate was seen.
Decision and handoff. Current state, evidence required to change it, receiving owner and next review time. A transition should explain which references justified the change. Keep earlier reasons intact if the case is later reopened.
The lane may point to a source of truth for other jobs waiting behind the reservation. That information is operationally useful, especially if a gap in the nonce sequence prevents progress. It does not give the owners of the later jobs authority over N-630. Show backlog age and the blocking reservation separately so the receiving operator can prioritize the repair without changing the instruction.
A small team can begin with these fields in an exception record linked to its transaction store. A larger team may express the same record as a database view fed from a reservation ledger and an append-only evidence log. In both cases the handoff needs to survive the loss of a worker's ephemeral log and the expiration of temporary RPC access.
Move state only when the record has new evidence
Reserved. There is an approved instruction and a committed allocation. A worker can prepare the approved candidate. If the job is abandoned before signing, releasing the reservation requires evidence that no signed artifact exists and no valid handler can still obtain one from the retired authorization. A missing log alone is weak evidence.
Signed. A known candidate has a retained identity and authorization. Check that its scope still agrees with the reservation before permitting normal dispatch. Once the signed artifact exists, a timeout in the signing response should be treated as uncertainty about custody until the signing service can account for what it produced.
Submission uncertain. The RPC attempt began, but the journal cannot establish its outcome. Keep the reservation. Look up the candidate and record the results with endpoint and time. Review the status of the signing and dispatch records before deciding whether any further write is appropriate. A single negative observation cannot close this state.
Observed pending. A trusted observation source can identify the candidate without showing durable inclusion. Record who saw it and under which scope. Pending is an observation that can become stale. Do not treat a fresh positive result as an assurance that all other endpoints will see the same transaction.
Included, awaiting acceptance. A receipt can associate a candidate with a block. Record the block identity as well as the height and check the execution result separately. The team's acceptance policy determines when that observation is sufficiently stable for its operation. If the receipt disappears or its block changes before acceptance, preserve the old evidence and reopen the case.
Reconciled. The receiving owner has explained which candidate, if any, consumed the sequence position and how the outcome relates to the approved instruction. An included execution failure still requires a decision about the business instruction. A reconciled reservation remains in history. The allocator must not bring an already consumed nonce back into its free set.
Held for repair. Observations conflict, signer scope is uncertain or a candidate appears that the journal cannot account for. Prevent automated allocation from making a new commitment through that unresolved boundary. The hold needs a named owner and a narrow next evidence request. A blanket red status that masks the missing link is difficult to operate.
Model these changes as explicit transitions rather than as updates to a label that different services can interpret independently. A receipt collector can append a fact. The policy assigning authority for a reconciliation decision can be kept elsewhere, but the record must say which authority was used. If later observations invalidate a decision, an operator should see both the original rationale and the trigger for reconsideration.
Work the interrupted submission in order
Suppose N-630 is on lease generation 7. The journal names candidate C-630-A and gives the time of the last attempt. The job timeout arrives before the positive dispatch result. A successor receives lease generation 8 and sees a missing receipt. At that point, the new handler owns the inquiry. The nonce stays reserved.
Begin by verifying the scope of the observation. Ethereum's JSON-RPC documentation distinguishes transaction count from receipt lookup. Read a suitable confirmed transaction count for the account and compare it with the last observations that informed allocation. Where the chosen interface supports pending observations, record them as scoped evidence about that provider. Do not assume they describe every node's queue.
Then compare results for the exact candidate. If one provider sees the hash and another returns nothing, write down both observations. Provider policy, lack of a shared mempool view or an observation taken at different times can affect what is visible. Geth's transaction-pool documentation describes a node-local view with pending and queued entries. A managed endpoint may not expose the same evidence.
If a confirmed count suggests the sequence has advanced past the reservation, ask which included transaction consumed the position. A count is useful as a reconciliation signal but does not identify the instruction or establish its execution result. Look for verifiable evidence tied to the account, nonce and a canonical block under your acceptance policy. When access only supports partial evidence, leave the exception open and tell the next operator exactly what is missing.
In the fictional trace, the second observation identifies C-630-A as pending. No decision about a replacement is warranted by the missing receipt alone. The handler records the positive observation and the outstanding inclusion check. The system retains the reservation and can display the waiting jobs without issuing another approved instruction for nonce 41. The source of uncertainty is now narrow enough for the next shift to continue.
Later, consider a hypothetical receipt for C-630-A in block B-630. Verify that its chain and signer context match, then apply the documented acceptance check for that environment. If the receipt reports a failure, record both the consumed sequence position and the unresolved business outcome. Reallocating the same nonce would conflate those conclusions. If support needs to tell a user what happened, its wording should follow the approved business status rather than a single RPC response.
Decide what a replacement is allowed to preserve
There are two decisions that can be confused when a transaction appears slow. One concerns which candidate can express the same approved instruction. The other concerns whether to abandon or alter the instruction. Require independent authorization for a change of business scope. A candidate journal with all named hashes gives operators a place to record that review.
EIP-1559 describes the fee fields of its transaction type. A provider's replacement acceptance policy is a separate concern. Avoid a universal percentage or time limit. Record what the tested provider accepts, which approval binds the candidate to the same intended effect and which operator can approve further steps. Distinguish an operational intent to cancel from evidence that any candidate won inclusion.
Keep both hashes if a reviewed successor candidate is ever created in your system. Mark which one was proposed as a replacement and why. A later receipt for the earlier candidate can settle the sequence position even when an operator expected the newer one to prevail. The case history should explain the resulting business outcome without pretending that a proposed replacement reversed earlier inclusion.
A dropped classification also needs a definition. A candidate may no longer be visible to the provider on which it was previously observed, while another part of the system retains it. Record the boundaries of observation and whether another authorized dispatch channel could still hold a copy. When the record cannot establish the candidate's status, retain the hold. Shifting a case to a queue named repair does not erase the uncertainty.
Give the receiving operator a bounded runbook
Start from the instruction reference provided by the incident or support case. Read the durable reservation and copy its scope, current handler and exact candidate references into the exception record. Identify which observation is missing. A case described only as a nonce problem invites responders to try unrelated fixes.
Confirm that new work stops where the uncertainty matters. The signer owner should know which reservations may still proceed and which decision would require a wider pause. A team running many independent signer lanes may isolate one lane. A service sharing an upstream approval or dispatch boundary may need more investigation before it can promise isolation.
Gather read-only observations for the named scope. Record the evidence as returned while writing an interpretation in a separate field. Include two independently identified observations when the available interfaces and operational policy justify the comparison. If team permissions stop a responder at one endpoint, hand the question to the owner who can obtain the missing observation.
Pick a narrow disposition. Leave the case pending with a review deadline, submit an evidence request to the signer owner or reconcile the observed candidate against the defined chain and business acceptance rules. Assign a person or on-call role that can make the selected decision. Avoid a route that only notifies an interested observer.
Before closing, make the handoff reproducible. The case should identify the winning or otherwise resolved candidate, any remaining uncertainty, the business instruction's status and the condition that would reopen the case. If the format can carry only one status label, add a linked decision record so that a confirmed receipt does not hide an unresolved payment or withdrawal instruction.
Decide whether the lane is ready to resume
The signing service should expose the scope and reason of a hold to the scheduler. Operators should be able to distinguish an unresolved earlier reservation from a quiet lane with no work. When evidence supports reopening allocation, reconcile the proposed next nonce against the durable reservations as well as the chain observation used for the decision. A new allocation should never hide evidence about an earlier one.
When handing the lane back, record the last reviewed reservation and the reason new work can proceed. If the decision relies on a temporary exception, give it an expiry and an owner. Leave waiting work intact so the next scheduler can resume from a known instruction rather than infer the backlog from recent dispatch logs.
Rehearse the states before moving real work
Design controlled acceptance exercises around failure boundaries. Use synthetic instructions and test credentials meant for the exercise. The following are proposed cases. None was executed for this article.
- Concurrent allocation. Two authorized workers request a nonce for different instructions on the same signer lane. Recover the durable records and check that no nonce is reserved for both purposes. Include a separate chain lane to prove the uniqueness rule has the intended scope.
- Lost response. Interrupt the worker after a proposed dispatch begins. Record what the successor can learn about the candidate without issuing another business instruction. A passing observation identifies the original reservation before the new worker attempts any recovery action.
- Stale lease. Let one handler lose its authority while another takes over. Check where the old generation is rejected and what evidence survives if the earlier handler retained a signed artifact. A passing result identifies the limit of the lease mechanism.
- Conflicting observations. Present one missing result and one pending result for the same candidate. The runbook should keep both observations and name the receiver. A later change should add a decision to the history without overwriting the conflicting inputs.
- Earlier candidate included. Present a receipt for the first of two named candidates sharing a reservation. Verify that the case follows the actual result rather than the operator's expectation about the second candidate.
- Receipt invalidated. Remove a provisional receipt in the controlled environment before acceptance. Review whether the record keeps the earlier observation and reopens the correct investigation instead of silently reverting to an available nonce.
Document provider differences discovered during that rehearsal. Write the endpoint behavior, test date, candidate evidence and acceptance outcome beside each operational assumption. Changes to an execution client, signing service or routing layer may invalidate part of the prior result. A generic statement that blockchain requests were tested gives a receiving team little to work with.
For teams scoping blockchain development and transaction signing architecture at Pharos Production, ask for a demonstration starting with one deliberately interrupted fixture. Give the receiving operator access to its reservation and evidence, then ask them to explain who can act, what happened to the candidate and why the nonce is still held or considered reconciled. Keep any missing answer in the acceptance record.
More insights to read
- Export Recovery Acceptance: Checkpoints and Discrepancy Decisions
- Architecture Decision Records: A Receipt-Worker Review
- Proof-of-stake finality
- Making retries safe with idempotent APIs
- Test a Support Runbook With a Restricted Receiving Account
About the author
Dmytro Nasyrov. Photo supplied by the author.
Written by Dmytro Nasyrov PhD, software architect with 24 years of production experience. Dmytro is the founder and CTO of Pharos Production. He works on production software architecture for FinTech, AI, Web3 and blockchain systems.