Skip to content

Conversation

@protolambda
Copy link
Contributor

Description

Implement cross-safe and cross-unsafe resolution.

Not integrated fully into op-supervisor yet, meant to function as encapsulated routines, and then instantiate under a worker routine, which is then managed by the backend.

Based on #12450 : once we integrate, we'll need to instantiate a cross-safe and cross-unsafe worker per chain in the dependency set, regardless of RPC connectivity.

Tests

Work in progress.

Additional context

  • Cover derived-from edge-cases for valid incremental (w.r.t. L1 block scope) L2 cross-safe updates.
  • Cover partial-validity edge-case: block as a whole is tested
  • Cover intra-block cycle edge-case

Metadata

Fix #12075

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 15, 2024

Semgrep found 3 sol-style-require-reason findings:

require() must include a reason string

Ignore this finding from sol-style-require-reason.

Semgrep found 2 golang_fmt_errorf_no_params findings:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Semgrep found 15 err-todo findings:

TODO in error handling code

Ignore this finding from err-todo.

@protolambda protolambda added this to the Interop: Devnet 1 milestone Oct 15, 2024
@protolambda protolambda force-pushed the interop-dependency-set branch from 962730f to e7fb182 Compare October 15, 2024 19:41
@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 15, 2024

Semgrep found 6 sol-style-input-arg-fmt findings:

Inputs to functions must be prepended with an underscore (_)

Ignore this finding from sol-style-input-arg-fmt.

Base automatically changed from interop-dependency-set to develop October 15, 2024 23:33
@ghost ghost force-pushed the cross-safe-updates branch from ac862df to 2e889c9 Compare October 16, 2024 18:27
@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 16, 2024

Semgrep found 3 golang_fmt_errorf_no_params findings:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.


var (
ErrChainIndexNotFound = fmt.Errorf("no index found for chain ID")
ErrChainIDNotFound = fmt.Errorf("no chain ID found for index")
Copy link
Contributor

@semgrep-app semgrep-app bot Oct 16, 2024

Choose a reason for hiding this comment

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

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

)

var (
ErrChainIndexNotFound = fmt.Errorf("no index found for chain ID")
Copy link
Contributor

@semgrep-app semgrep-app bot Oct 16, 2024

Choose a reason for hiding this comment

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

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Dependencies map[types.ChainID]*StaticConfigDependency `json:"dependencies"`
}

func (ds *StaticConfigDependencySet) MarshalJSON() ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

MarshalJSON with a pointer receiver has surprising results: golang/go#22967

Ignore this finding from marshal-json-pointer-receiver.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 18, 2024

Semgrep found 2 err-todo findings:

  • op-supervisor/supervisor/backend/cross/unsafe_update.go
  • op-supervisor/supervisor/backend/cross/safe_frontier.go

TODO in error handling code

Ignore this finding from err-todo.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 18, 2024

Semgrep found 1 golang_fmt_errorf_no_params finding:

  • op-deployer/pkg/deployer/bootstrap/bootstrap.go

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 21, 2024

Semgrep found 1 sol-style-notice-over-dev-natspec finding:

  • packages/contracts-bedrock/src/cannon/interfaces/IPreimageOracle.sol

Prefer @notice over @dev in natspec comments

Ignore this finding from sol-style-notice-over-dev-natspec.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 22, 2024

Semgrep found 1 sol-style-require-reason finding:

  • packages/contracts-bedrock/src/L2/SuperchainWETH.sol

require() must include a reason string

Ignore this finding from sol-style-require-reason.

Semgrep found 5 sol-style-input-arg-fmt findings:

Inputs to functions must be prepended with an underscore (_)

Ignore this finding from sol-style-input-arg-fmt.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 23, 2024

Semgrep found 1 no-direct-write-to-responsewriter finding:

  • op-challenger/game/fault/trace/prestates/multi_test.go

Detected directly writing or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package and render data using 'template.Execute()'.

Ignore this finding from no-direct-write-to-responsewriter.

Semgrep found 1 no-direct-write-to-responsewriter-taint finding:

  • op-challenger/game/fault/trace/prestates/multi_test.go

Untrusted input could be used to tamper with a web page rendering, which can lead to a Cross-site scripting (XSS) vulnerability. XSS vulnerabilities occur when untrusted input executes malicious JavaScript code, leading to issues such as account compromise and sensitive information leakage. To prevent this vulnerability, validate the user input, perform contextual output encoding or sanitize the input. For more information, see: Go XSS prevention.

View Dataflow Graph
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>op-challenger/game/fault/trace/prestates/multi_test.go</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/ethereum-optimism/optimism/blob/4e80661c00e4fb3ab2d0d8fc2921e05b6abee2f2/op-challenger/game/fault/trace/prestates/multi_test.go#L194 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 194] r.URL</a>"]
        end
        %% Intermediate

        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/ethereum-optimism/optimism/blob/4e80661c00e4fb3ab2d0d8fc2921e05b6abee2f2/op-challenger/game/fault/trace/prestates/multi_test.go#L194 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 194] w.Write([]byte(r.URL.Path))</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    File0:::invis

    %% Connections

    Source --> Sink

Loading
Ignore this finding from no-direct-write-to-responsewriter-taint.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2024


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 23, 2024

Semgrep found 1 ban_non_wraparound_modifiers finding:

  • packages/contracts-bedrock/src/L2/SuperchainERC20.sol

Modifiers that don't do something before and after execution are banned.

Ignore this finding from ban_non_wraparound_modifiers.

@semgrep-app
Copy link
Contributor

semgrep-app bot commented Oct 24, 2024

Semgrep found 3 sol-style-require-reason findings:

require() must include a reason string

Ignore this finding from sol-style-require-reason.

@protolambda
Copy link
Contributor Author

Closing in favor of #12624

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.

Interop: cross-safe head verification

3 participants