-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Additional fix for externalCL integration (prevent MDBX_MAP_FULL) #12922
base: main
Are you sure you want to change the base?
Conversation
@@ -37,7 +37,7 @@ func NewTemporaryMdbx(ctx context.Context, tempdir string) (kv.RwDB, error) { | |||
return &TemporaryMdbx{}, err | |||
} | |||
|
|||
db, err := New(kv.ChainDB, log.Root()).InMem(path).GrowthStep(64 * datasize.MB).Open(ctx) |
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 reverts the change from the previous PR
@@ -164,10 +162,11 @@ func (e *EngineBlockDownloader) waitForEndOfHeadersDownload(ctx context.Context) | |||
} | |||
|
|||
// waitForEndOfHeadersDownload waits until the download of headers ends and returns the outcome. | |||
func (e *EngineBlockDownloader) loadDownloadedHeaders(tx kv.RwTx) (fromBlock uint64, toBlock uint64, fromHash libcommon.Hash, err 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.
return value fromHash
will not be used, the function was changed accordingly
@@ -238,66 +237,3 @@ func saveHeader(db kv.RwTx, header *types.Header, hash libcommon.Hash) error { | |||
} | |||
return nil | |||
} | |||
|
|||
func (e *EngineBlockDownloader) insertHeadersAndBodies(ctx context.Context, tx kv.Tx, fromBlock uint64, fromHash libcommon.Hash, toBlock uint64) 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.
This function was removed, as its functionality was moved to the function downloadAndLoadBodiesSyncronously
which now inserts blocks via the same API as Caplin, without the need to accumulate them in the tempDb (and potentially cause MDBX_MAP_FULL
)
@@ -102,11 +102,6 @@ func (e *EngineBlockDownloader) download(ctx context.Context, hashToDownload lib | |||
return | |||
} | |||
tx.Rollback() // Discard the original db tx | |||
if err := e.insertHeadersAndBodies(ctx, tmpTx, startBlock, startHash, endBlock); 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.
Call is removed, since insertion of blocks was performed in the call to downloadAndLoadBodiesSyncronously
Fixes #12225