-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrieLogFactory plugin support #5440
TrieLogFactory plugin support #5440
Conversation
|
521c1ca
to
3587329
Compare
plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogProvider.java
Fixed
Show fixed
Hide fixed
plugin-api/src/main/java/org/hyperledger/besu/plugin/services/trielogs/TrieLogProvider.java
Fixed
Show fixed
Hide fixed
c9fd7af
to
273bd53
Compare
/** | ||
* Block and TrieLog layer composition, used for returning a range of TrieLog layers. | ||
* | ||
* @param blockNumber the block number |
Check notice
Code scanning / CodeQL
Spurious Javadoc @param tags
* Block and TrieLog layer composition, used for returning a range of TrieLog layers. | ||
* | ||
* @param blockNumber the block number | ||
* @param trieLog the associated TrieLog layer |
Check notice
Code scanning / CodeQL
Spurious Javadoc @param tags
…inea until merge of hyperledger#5440) Signed-off-by: garyschulte <garyschulte@gmail.com>
/** | ||
* Block and TrieLog layer composition, used for returning a range of TrieLog layers. | ||
* | ||
* @param blockHash the block hash |
Check notice
Code scanning / CodeQL
Spurious Javadoc @param tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this alert because it's a record? javadoc not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is not clear what the linter wants here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so many tiny changes! a few comments
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/trielog/TrieLogLayer.java
Outdated
Show resolved
Hide resolved
@@ -43,11 +43,13 @@ | |||
* <p>In this particular formulation only the "Leaves" are tracked" Future layers may track patrica |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* <p>In this particular formulation only the "Leaves" are tracked" Future layers may track patrica | |
* <p>In this particular formulation only the "Leaves" are tracked Future layers may track patricia |
/** | ||
* Block and TrieLog layer composition, used for returning a range of TrieLog layers. | ||
* | ||
* @param blockHash the block hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this alert because it's a record? javadoc not needed?
71cf24e
to
bfe7876
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm few minor questions
.../core/src/main/java/org/hyperledger/besu/ethereum/bonsai/trielog/AbstractTrieLogManager.java
Outdated
Show resolved
Hide resolved
import dagger.Provides; | ||
|
||
/** | ||
* A dagger module that know how to create the BesuCommand, which collects all configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think this was copied over the BesuCommand module, if so could we adjust the description to keep docs coherent.
} | ||
|
||
Stream<Long> rangeAsStream(final long fromBlockNumber, final long toBlockNumber) { | ||
if (Math.abs(toBlockNumber - fromBlockNumber) > 1000L) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this limit number coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there isn't a use for this feature other than the shomei plugin currently, 1k is a compromise between shomei batch sync sizes and a reasonable upper bound on an corresponding rpc payload size. The payload size can vary based on the chain's gas limit and operations performed during the range. Using linea as a guidepost, an rpc request for blocks 0-1k weighs in at 510kb, whereas blocks 600k->601k are ~60mb.
I will add a class level constant for this rather than a 'magic number' however. 👍
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…Observer to AbstractTrieLogManager Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…ees fit Signed-off-by: garyschulte <garyschulte@gmail.com>
…ll slot key Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…og, add blockHeader to trielogaddedevent 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>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
… TrieLog Plugin Service 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>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
… for getTrieLogByRange return 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>
Signed-off-by: garyschulte <garyschulte@gmail.com>
bfe7876
to
402caec
Compare
Signed-off-by: garyschulte <garyschulte@gmail.com>
* TrieLogs in plugin data * adds dagger-wired plugincontext and TrieLogService * add getTrieLogByRange, TrieLogRangeTuple composition --------- Signed-off-by: garyschulte <garyschulte@gmail.com>
* TrieLogs in plugin data * adds dagger-wired plugincontext and TrieLogService * add getTrieLogByRange, TrieLogRangeTuple composition --------- Signed-off-by: garyschulte <garyschulte@gmail.com>
PR description
PR does some plumbing to get TrieLogs and TrieLogFactory into the plugin-api, such that we can have a pluggable TrieLog serializer/deserializer and event observer. Having trielogs in plugin-api also facilitates trielog push and pull to remote services.
notable changes/rearrangement:
in plugin-api/services
in data types:
writeRlp and writeInnerRlp moved from BonsaiValue into TrieLogFactory
TrieLog now exposes the account, code, and storage maps directly rather than only via stream
Fixed Issue(s)
fixes protocol-misc # 756