Repository navigation
op-devstack,op-acceptance-tests: cover the production proofs init path with backfill #23429
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
Closed
einar-oplabs
wants to merge
3
commits into
einar/23383-proofs-reorg-reexec
from
einar/23389-proofs-init-path
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
2080ccc
op-devstack,op-acceptance-tests: cover the proofs init path with back…
einar-oplabs cfc1c02
op-acceptance-tests: drive the proofs init guard tests past reth's fi…
einar-oplabs f4bf9f5
op-devstack,op-acceptance-tests: address review of the proofs init se…
einar-oplabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
421 changes: 421 additions & 0 deletions
421
op-acceptance-tests/tests/proofs_history_init/proofs_history_init_test.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package stack | ||
|
|
||
| import "time" | ||
|
|
||
| // ProofsHistoryInit is one run of `op-reth proofs init` against a node's datadir: it anchors a | ||
| // proofs-history store at the datadir's tip, backfills the store Window blocks behind the anchor, | ||
| // and makes the node run with proofs history from its next Start on. The zero value is the | ||
| // operator's plain invocation. | ||
| type ProofsHistoryInit struct { | ||
| // PlainBackfill reads every backfilled block's changes from reth's database instead of going | ||
| // through the trie-state snapshot op-reth builds by default. | ||
| PlainBackfill bool | ||
| // Window is the number of blocks the backfill extends behind the anchor and the window the | ||
| // node keeps once proofs history is on. Zero keeps the window the node was configured with. | ||
| Window uint64 | ||
| } | ||
|
|
||
| // ProofsHistoryInitReport is what a proofs-history init run produced. | ||
| type ProofsHistoryInitReport struct { | ||
| // Duration is how long the subcommand ran, backfill included. | ||
| Duration time.Duration | ||
| // Output is the subcommand's combined stdout and stderr. | ||
| Output string | ||
| } | ||
|
|
||
| // ProofsHistoryInitializer is implemented by execution-layer nodes whose proofs-history store can | ||
| // be seeded from their datadir after they were built, the way an operator seeds one for a node | ||
| // that has synced without proofs history. | ||
| type ProofsHistoryInitializer interface { | ||
| // InitProofsHistory runs the init against the node's datadir, whether or not the node is | ||
| // running, and enables proofs history on the node's next Start when it succeeds. The error of | ||
| // a failed run carries the subcommand's output. | ||
| InitProofsHistory(init ProofsHistoryInit) (ProofsHistoryInitReport, error) | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
OS Command Injection (CWE-78)
More Details
OS command injection is a critical vulnerability that allows an attacker to execute arbitrary commands on the system. This can lead to a full system compromise, as the attacker can potentially gain complete control over the application and the underlying system.
The vulnerability arises when user input is used to construct commands or command arguments that are then executed by the application. This can occur when user-supplied data is passed directly to functions that execute OS commands, such as exec.Command, exec.CommandContext, syscall.ForkExec, or syscall.StartProcess.
If an attacker can inject malicious code into these commands, they can potentially execute any command on the system, including installing malware, stealing data, or causing a denial of service. This vulnerability can have severe consequences, including data breaches, system compromise, and unauthorized access to sensitive information.
To avoid this vulnerability, user input should never be used directly in constructing commands or command arguments. Instead, the application should use a hardcoded set of arguments and validate any user input to ensure it does not contain malicious code.
Remediation
OS command injection is a critical vulnerability that allows an attacker to execute arbitrary commands on the system. This can lead to a full system compromise, as the attacker can potentially gain complete control over the application and the underlying system. The vulnerability arises when user input is used to construct commands or command arguments that are then executed by the application.
To fix this issue, user input should never be used directly in constructing commands or command arguments. Instead, the application should use a hardcoded set of arguments and validate any user input to ensure it does not contain malicious code. Additionally, it is recommended to use language-specific facilities for executing commands, which provide better input validation and sanitization.
Code examples
Additional recommendations
To ignore this finding as an exception, reply to this conversation with
#wiz_ignore reasonIf you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).
To get more details on how to remediate this issue using AI, reply to this conversation with
#wiz remediate