Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[W-2] Unsynchronized w.mints map mutation can crash tollgate-wrt (fatal concurrent map write)

Open
#801 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
backend, payments

Research direction

Start by checking whether w.mints is still accessed without w.mu on current upstream main: look at AddMint in wallet/wallet.go around line 209, the 60s payout ticker iteration around line 224, and getActiveKeyset in keyset.go around lines 248 and 259. Done means either confirming that the unguarded access is gone, or guarding all of these accesses with w.mu and showing that a concurrent test passes under go test -race.

Written by the indexing model from the issue text.

Description

Migrated from Amperstrand/tollgate-module-basic-go#71 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: #758.]


Fatal concurrent map write panic in tollgate-wrt. The w.mints map is mutated without lock protection in wallet/wallet.go:209 (AddMint) and keyset.go:248,259 (getActiveKeyset) while the 60s payout ticker iterates it at wallet.go:224 and concurrent receives read it. This triggers fatal error: concurrent map iteration and map write, which is unrecoverable and crashes the daemon.

Trigger: two clients paying different mints concurrently, or payment racing keyset rotation.

Fix: Guard with existing w.mu mutex.

Evidence: /home/ubuntu/src/tollgate_audit_report_2026-08-26.md §7, line 120
File references: wallet/wallet.go:209, keyset.go:248,259, wallet.go:224


Migrated 2026-10-09. Applicability to current upstream main (4614ac2, post-rc1) was not re-verified during migration — confirming whether the finding still reproduces upstream is this issue's first task.

Dominant language
Go
Stars
12
Forks
14
Avg merge
1d 5h
Merged PRs (30d)
240

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTollGate/tollgate-module-basic-go

All issues in OpenTollGate/tollgate-module-basic-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.