-
Notifications
You must be signed in to change notification settings - Fork 325
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
[actpool] persistent storage for actions #4366
Conversation
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.
the others look good to me
actpool/blobstore.go
Outdated
@@ -0,0 +1,245 @@ | |||
package actpool |
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.
this is not a blobstore, but a general store
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.
renamed to actionstore
00cc771
to
e276d52
Compare
as discussed, a general comment is we should only enable this for blob tx, b/c each tx is 128kB and each block can take only 2 blobs, leading to a potential backlog of such txs. |
actpool/actionstore.go
Outdated
var defaultBlobStoreConfig = blobStoreConfig{ | ||
Datadir: "blobpool", | ||
var defaultActionStoreConfig = actionStoreConfig{ | ||
Datadir: "actionstore", | ||
Datacap: 10 * 1024 * 1024 * 1024, |
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 10GB?
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.
ok, maybe 1GB(around 5000 blob tx) is enough
actpool/actpool.go
Outdated
@@ -412,6 +458,21 @@ func (ap *actPool) validate(ctx context.Context, selp *action.SealedEnvelope) er | |||
return nil | |||
} | |||
|
|||
func (ap *actPool) removeReplacedActs(acts []*action.SealedEnvelope) { |
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.
this is same as removeInvalidActs
, see comment below?
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.
as discussed, will delete the removeReplacedActs
actpool/actpool.go
Outdated
@@ -153,6 +158,33 @@ func NewActPool(g genesis.Genesis, sf protocol.StateReader, cfg Config, opts ... | |||
return ap, nil | |||
} | |||
|
|||
func (ap *actPool) Start(ctx context.Context) error { | |||
// open action store and load all actions | |||
if ap.store != 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.
early return
Quality Gate passedIssues Measures |
Description
Now actions in actpool will be persistent on disk. There are three main functionalities:
Based on #4362
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: