-
Notifications
You must be signed in to change notification settings - Fork 38
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
Performance fixes - speed and memory #1567
Conversation
…s after they are fetched the first time. 2. Set maximum memory for cache. 3. Reduce cache memory consumption by caching a mapping between a batch hash and a batch sequence
"github.com/obscuronet/go-obscuro/go/enclave/limiters" | ||
|
||
gethcommon "github.com/ethereum/go-ethereum/common" | ||
"github.com/obscuronet/go-obscuro/go/enclave/core" | ||
) | ||
|
||
// rollupProducerImpl encapsulates the logic of decoding rollup transactions submitted to the L1 and resolving them | ||
// to rollups that the enclave can process. | ||
type rollupProducerImpl struct { |
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.
there were a bunch of unused fields, and the comment was out of date
return newRollup, nil | ||
} | ||
|
||
// createNextRollup - based on a previous rollup and batches will create a new rollup that encapsulate the state |
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.
outdated comment, and the method had no clear responsibility
// todo - double-check that this signing approach is secure, and it properly includes the entire payload | ||
if err := s.signRollup(rollup); err != nil { | ||
if err := s.signRollup(extRollup); err != nil { |
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.
makes more logical sense to sign over the external rollup
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 - minor comment
@@ -80,7 +80,7 @@ type BatchExecutor interface { | |||
|
|||
type BatchRegistry interface { | |||
// BatchesAfter - Given a hash, will return batches following it until the head batch | |||
BatchesAfter(batchSeqNo uint64, upToL1Height uint64, rollupLimiter limiters.RollupLimiter) ([]*core.Batch, error) | |||
BatchesAfter(batchSeqNo uint64, upToL1Height uint64, rollupLimiter limiters.RollupLimiter) ([]*core.Batch, []*types.Block, error) |
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.
should update the comment on this probably
Why this change is needed
What changes were made as part of this PR
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks