Conversation
|
...eum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/storage/flat/FlatDbStrategy.java
Fixed
Show fixed
Hide fixed
13da7d2 to
4eb1ed6
Compare
| // Only ourNearest is present | ||
| return ourNearest; | ||
| } else { | ||
| // Either both are not present, or only parentNearest is present |
There was a problem hiding this comment.
| // Either both are not present, or only parentNearest is present |
There was a problem hiding this comment.
I think it took me longer to parse this comment than the line of code
There was a problem hiding this comment.
does this end up being Optional.empty if neither are present? What happens then?
There was a problem hiding this comment.
yes, if neither are present there was nothing at or before the requested key and we return empty. Callers should expect to handle the optional empty return
There was a problem hiding this comment.
does this end up being Optional.empty if neither are present? What happens then?
This question made me add another case that checks we correctly return Optional.empty(). Though the rocksdb nearestTo would behave that way, the In-memory comparators are not. I added a test for this and a filter to the in-memory streaming implementation. 👍
| final Hash accountHash, | ||
| final Hash slotHash) { | ||
| transaction.remove( | ||
| ACCOUNT_STORAGE_STORAGE, Bytes.concatenate(accountHash, slotHash).toArrayUnsafe()); |
There was a problem hiding this comment.
why is it called ACCOUNT_STORAGE_STORAGE ? there's no ACCOUNT_STORAGE, right?
There was a problem hiding this comment.
yeah, not my favorite name, but it is what the segment enum calls it. It is the underlying storage for account storage, but makes for a weird name. I am all for renaming the flat segments to ACCOUNT_INFO_FLAT, ACCOUNT_STORAGE_FLAT, and CODE_STORAGE_FLAT or something else that is more meaningful. I'd rather do that in another PR though since it would touch a lot of places
.../java/org/hyperledger/besu/ethereum/bonsai/storage/flat/ArchiveFlatDbReaderStrategyTest.java
Outdated
Show resolved
Hide resolved
...ices/kvstore/src/main/java/org/hyperledger/besu/services/kvstore/LayeredKeyValueStorage.java
Outdated
Show resolved
Hide resolved
...re/src/main/java/org/hyperledger/besu/services/kvstore/SegmentedInMemoryKeyValueStorage.java
Show resolved
Hide resolved
21a3368 to
dd4e2b4
Compare
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…es the same Signed-off-by: garyschulte <garyschulte@gmail.com>
dd4e2b4 to
850c4ca
Compare
* move FlatDbReader to FlatDbStrategy (including writes), add getNearestTo Signed-off-by: garyschulte <garyschulte@gmail.com> Signed-off-by: Justin Florentine <justin+github@florentine.us>
* move FlatDbReader to FlatDbStrategy (including writes), add getNearestTo Signed-off-by: garyschulte <garyschulte@gmail.com>
PR description
This is a prerequisite PR for #5865 and #5887.
It:
This PR will allow for parallel progress on SnapServer server and Bonsai Archive, and mitigate merge conflicts that would otherwise arise
Fixed Issue(s)
related to #3165 and #5864