Skip to content

Automatically cache Transaction Log Bloom Filters#413

Merged
shemnon merged 5 commits into
besu-eth:release-1.4from
shemnon:autocache14
Feb 19, 2020
Merged

Automatically cache Transaction Log Bloom Filters#413
shemnon merged 5 commits into
besu-eth:release-1.4from
shemnon:autocache14

Conversation

@shemnon
Copy link
Copy Markdown
Contributor

@shemnon shemnon commented Feb 19, 2020

Add a new option --auto-logs-bloom-indexing-enabled which defaults to true. This performs the equivalent of the operator generate-log-bloom-cache CLI task or admin_generateLogBloomCache RPC call for each block as it arrives, in addition to caching older logs on first startup.

AbdelStark and others added 5 commits February 18, 2020 22:13
* First iteration. Draft PR.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* fix SPDX header

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Use block broadcaster to index log bloom.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Remove useless toString method

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* spotless apply

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* cacheLogsBloomForBlockHeader

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* spotless apply

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* ensurePreviousSegmentsArePresent

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Added CLI flag to enable / disable automatic logs bloom indexing.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Create cache directory and cache file if not exist.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Fix acceptance test

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Write cache for block only if block is new canonical head.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Handling of chain reorg.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* fix

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* sportless apply

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Address PR comments.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Remove unused constant.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* spotless apply

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
(cherry picked from commit 6677362)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
…-eth#401)

Changes class names, variables, and CLI flags as needed.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
(cherry picked from commit 20664f9)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
besu-eth#407)

* Don't use pending file.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>

* Don't use pending file.

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
(cherry picked from commit c38152a)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Make sure we cache the current cache segment with all of the data from
the beginning of the segment.  Use a flip file approach since it will be
 a partial file until done.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Copy link
Copy Markdown
Contributor

@AbdelStark AbdelStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@shemnon shemnon merged commit b952731 into besu-eth:release-1.4 Feb 19, 2020
@shemnon shemnon deleted the autocache14 branch February 19, 2020 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants