aleksraiden/mt-manager ? reverse-engineered prompt
Reverse engineered prompt
Build me a Go library for managing multiple Merkle trees in memory, with a single manager that can create, look up, and update separate trees for things like accounts and orders.
I want fast concurrent reads and writes, batch insert and delete support, and a way to compute each tree’s root plus one global root across all trees. It should support snapshotting the full state to disk so I can save and restore later, and I’d like both synchronous and async snapshot creation. Use a clean design that keeps memory use low and avoids blocking as much as possible.
Please include a small example app or simple main file that shows how to define a data type with a key and serialization, add records, fetch them back, and print the root hash. Add tests and a few benchmarks too, and if you need to check anything about the latest Go or storage docs online, go ahead and look it up.
Are you gonna build this?
make sure you review the code using coderabbit