You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Missing Logging The initialization of the Miner component should be logged with all relevant configurations to ensure proper traceability and debugging.
Missing Span Fields The reset function is instrumented with tracing::info_span, but no identifiers are recorded as span fields. Consider adding relevant fields for better traceability.
Dynamic Fields in Tracing Avoid formatting dynamic fields in tracing events. Instead, add these dynamic fields as tracing fields. For example, in the tracing::debug! and tracing::error! calls.
Unwrap Usage The code uses unwrap which can cause a panic. Consider using expect with a meaningful message to handle potential errors gracefully.
Wrap the timed function call in a closure to ensure proper execution order
The timed function call should be wrapped in a closure to ensure that the metrics::inc_storage_reset function is called only after the reset operation completes.
Why: Wrapping the timed function call in a closure ensures that the metrics are updated only after the reset operation completes, which is a good practice for ensuring accurate metrics.
8
Performance
Use a more relaxed memory ordering for atomic operations if strict ordering is not necessary
Instead of using Ordering::SeqCst for the atomic store operation, consider using Ordering::Relaxed if the strictest memory ordering is not required. This can improve performance.
Why: The suggestion is valid and can improve performance by using a more relaxed memory ordering. However, it should be verified that strict ordering is indeed not necessary in this context.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Other
Description
enable-genesis
flag and related logic from miner configuration.reset_to_genesis
method toStratusStorage
and updated related calls.DebugAsJson
derive toBlock
struct.Changes walkthrough 📝
10 files
miner_config.rs
Refactor miner configuration and genesis block handling
src/eth/miner/miner_config.rs
enable-genesis
flag and related logic.can_mine_new_blocks
method toMinerMode
.block.rs
Add DebugAsJson derive to Block struct
src/eth/primitives/block.rs
DebugAsJson
derive toBlock
struct.rpc_server.rs
Update stratus_reset to use reset_to_genesis
src/eth/rpc/rpc_server.rs
stratus_reset
to usereset_to_genesis
method.inmemory_permanent.rs
Simplify in-memory storage reset method
src/eth/storage/inmemory/inmemory_permanent.rs
reset
method to reset all state to default.permanent_storage.rs
Update permanent storage reset method signature
src/eth/storage/permanent_storage.rs
reset
method to no longer take a block number.redis_permanent.rs
Update Redis storage reset method signature
src/eth/storage/redis/redis_permanent.rs
reset
method to no longer take a block number.rocks_permanent.rs
Simplify RocksDB permanent storage reset method
src/eth/storage/rocks/rocks_permanent.rs
reset
method to reset all state to default.rocks_state.rs
Simplify RocksDB state reset method
src/eth/storage/rocks/rocks_state.rs
reset
method to clear all state.stratus_storage.rs
Add reset_to_genesis method to StratusStorage
src/eth/storage/stratus_storage.rs
reset
method toreset_to_genesis
.justfile
Simplify justfile commands and remove enable-genesis flag
justfile
--enable-genesis
flag from various commands.4 files
unix_time.rs
Update imports in unix_time module
src/eth/primitives/unix_time.rs
UnixTime
andUtc
.contracts-test.sh
Update log messages in contracts-test.sh
e2e/cloudwalk-contracts/contracts-test.sh
block-time-check.sh
Update earliest block parameter in block-time-check.sh
utils/block-time-check.sh
0x1
.justfile_helpers
Update log message in justfile_helpers
justfile_helpers
1 files
rocks_cf.rs
Remove unused methods in RocksDB column family
src/eth/storage/rocks/rocks_cf.rs