Skip to content

using block playlod cache#46

Open
FineKe wants to merge 21 commits intodevfrom
kf/block_cache
Open

using block playlod cache#46
FineKe wants to merge 21 commits intodevfrom
kf/block_cache

Conversation

@FineKe
Copy link

@FineKe FineKe commented Sep 22, 2025

No description provided.

- Added support for a payload cache to optimize block execution by avoiding re-execution of transactions.
- Introduced new flags for enabling and configuring the payload cache in the miner.
- Updated the blockchain to utilize the payload cache for processing blocks, improving efficiency.
- Enhanced logging to track cache usage and performance metrics.

This change aims to improve the overall performance of the mining process by leveraging cached results.
- Introduced a cache hit status to track the effectiveness of the payload cache during block processing.
- Updated logging levels to provide clearer information on cache usage, including detailed logs for cache hits and misses.
- Enhanced metrics to include a counter for cache hits, improving performance tracking and analysis.
- Updated documentation to reflect changes in logging and cache usage, providing clearer guidance for users.

These improvements aim to optimize block processing efficiency and enhance the observability of the caching mechanism.
- Removed unused fields from the CachedPayloadResult struct, specifically Sidecars and Witness, to streamline the cache data structure.
- Updated the payload cache design documentation to reflect changes in the caching mechanism and its performance implications.
- Deleted the outdated payload-cache-usage.md file to consolidate documentation and avoid redundancy.

These changes aim to enhance the clarity and efficiency of the payload caching system, ensuring it aligns with the current implementation and usage patterns.
… store

- Updated the blockchain and metrics modules to utilize a local instance of log statistics for each block insertion, improving isolation of metrics.
- Introduced a new StatsStore for managing propose stats snapshots keyed by block hash, allowing for better tracking and cleanup of metrics.
- Refactored the log statistics methods to support snapshot and merge functionalities, enhancing the overall metrics reporting during block processing.
- Removed the global singleton for log statistics in favor of instance-based management to prevent interference between different metrics collections.
… handling

- Updated the blockchain and metrics modules to replace the CombinedSummaryCheckpoint method with a more direct CombinedSummary method, enhancing performance and clarity.
- Removed unused methods related to snapshot merging and checkpointing, simplifying the log statistics interface.
- Improved the handling of propose statistics by directly accessing durations from the Statistics interface, reducing unnecessary complexity.
- Added support for a payload cache to optimize block execution by avoiding re-execution of transactions.
- Introduced new flags for enabling and configuring the payload cache in the miner.
- Updated the blockchain to utilize the payload cache for processing blocks, improving efficiency.
- Enhanced logging to track cache usage and performance metrics.

This change aims to improve the overall performance of the mining process by leveraging cached results.
- Introduced a cache hit status to track the effectiveness of the payload cache during block processing.
- Updated logging levels to provide clearer information on cache usage, including detailed logs for cache hits and misses.
- Enhanced metrics to include a counter for cache hits, improving performance tracking and analysis.
- Updated documentation to reflect changes in logging and cache usage, providing clearer guidance for users.

These improvements aim to optimize block processing efficiency and enhance the observability of the caching mechanism.
- Removed unused fields from the CachedPayloadResult struct, specifically Sidecars and Witness, to streamline the cache data structure.
- Updated the payload cache design documentation to reflect changes in the caching mechanism and its performance implications.
- Deleted the outdated payload-cache-usage.md file to consolidate documentation and avoid redundancy.

These changes aim to enhance the clarity and efficiency of the payload caching system, ensuring it aligns with the current implementation and usage patterns.
# Conflicts:
#	core/blockchain.go
#	metrics/log_statistics.go
#	miner/miner.go
#	miner/worker.go
# Conflicts:
#	core/blockchain.go
#	eth/backend.go
#	metrics/log_statistics.go
#	miner/miner.go
#	miner/worker.go
- Introduced a new file `blockchain_okx.go` to manage logging statistics and cache handling for block processing.
- Added a function to log various metrics related to block execution, including cache hit status and timing for different operations.
- Enhanced the `fetchCachedBlock` method to utilize cached results, improving efficiency and performance tracking.

These changes aim to optimize block processing and provide better observability of the caching mechanism.
- Introduced a new method `SetPayloadCache` to set the payload cache for the blockchain.
- Updated `fetchCachedBlock` to remove the cache hit return value, simplifying its interface.
- Adjusted logging in `processBlock` to reflect the presence of a cached state instead of a cache hit status.

These changes aim to streamline the caching mechanism and improve code clarity in the blockchain module.
- Simplified variable declarations in the `processBlock` method by removing redundant error declarations and using existing variables for caching results.
- Enhanced readability by restructuring the assignment of cached results and processing errors.

These changes aim to streamline the block processing flow and improve code maintainability in the blockchain module.
Comment on lines +1 to +15
// Copyright 2024 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

Choose a reason for hiding this comment

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

I think we should delete these.

Comment on lines +1 to +15
// Copyright 2024 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

Choose a reason for hiding this comment

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

Same problem

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.

3 participants