-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Tendermint version (use tendermint version or git rev-parse --verify HEAD if installed from source):
develop
What happened:
Manual code review of the BoltDB backend.
Anything else we need to know:
Per the documentation: "The returned value is only valid for the life of the transaction.". Failure to honor this constraint will result in crashes, as boltdb unmaps the backing pages.
Line 69 in 96e132b
| value = b.Get(key) |
This constraint also applies to key/value returned from the various boltdb Cursor calls, that are currently also returned directly from the boltdb backend's db.Iterator implementation. The db.Iterator interface documentation only specifies that the Key() and Value() methods return read-only slices, and not that the returned slices will be invalidated the moment Close() is called.