Skip to content
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

feat(indexer): bridge process pre-bedrock blocks #7119

Merged
merged 9 commits into from
Sep 11, 2023

Conversation

hamdiallam
Copy link
Contributor

@hamdiallam hamdiallam commented Sep 6, 2023

This adds support for pre-bedrock blocks for op-mainnet and op-goerli.

  1. Bedrock starting heights added only via preset for mainnet/goerli. CTC contracts also added
  2. Bridge processor runs the legacy pathway and switches once reaching bedrock

Closes ethereum-optimism/devx#67

@hamdiallam
Copy link
Contributor Author

hamdiallam commented Sep 6, 2023

@hamdiallam hamdiallam changed the title feat(indexer): process pre-bedrock blocks feat(indexer): bridge process pre-bedrock blocks Sep 6, 2023
@mergify mergify bot added the A-indexer Area: indexer label Sep 6, 2023
@mergify mergify bot requested a review from roninjin10 September 6, 2023 16:38
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch 2 times, most recently from 85a3c89 to 6a46df7 Compare September 6, 2023 18:34
Base automatically changed from indexer.bridge.bugfix to develop September 6, 2023 18:44
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from 9414f76 to 8dba43c Compare September 8, 2023 16:54
@hamdiallam hamdiallam changed the base branch from develop to indexer.bridge.l2.start September 8, 2023 22:11
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from 8dba43c to 685658e Compare September 8, 2023 22:11
@semgrep-app
Copy link
Contributor

semgrep-app bot commented Sep 8, 2023

Semgrep found 1 gorm-hardcoded-secret finding:

  • indexer/database/db.go: L41-48

A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM).

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

    subgraph File0["<b>indexer/database/db.go</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0("<b>[Line: 39]</b> #quot; password=%s#quot;")
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2("<b>[Line: 39]</b> dsn")
        end
        %% Sink

        subgraph Sink
            direction LR

            v1("<b>[Line: 41]</b> gorm.Open(postgres.Open(dsn), &gorm.Config{<br>		// The indexer will explicitly manage the transactions<br>		SkipDefaultTransaction: true,<br><br>		// We may choose to create an adapter such that the<br>		// logger emits to the geth logger when on DEBUG mode<br>		Logger: logger.Default.LogMode(logger.Silent),<br>	})")
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

    %% Clickable

    click v0 href "https://github.com/ethereum-optimism/optimism/blob/685658ee5f8237a0ccf18d69bc141dabd0b1d08d/indexer/database/db.go#L39" "View in source" _blank
    click v1 href "https://github.com/ethereum-optimism/optimism/blob/685658ee5f8237a0ccf18d69bc141dabd0b1d08d/indexer/database/db.go#L41" "View in source" _blank
    click v2 href "https://github.com/ethereum-optimism/optimism/blob/685658ee5f8237a0ccf18d69bc141dabd0b1d08d/indexer/database/db.go#L39" "View in source" _blank
Loading
Ignore this finding from gorm-hardcoded-secret.

Semgrep found 1 gorm-empty-password finding:

  • indexer/database/db.go: L41-48

The application uses an empty credential. This can lead to unauthorized access by either an internal or external malicious actor. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM).

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

    subgraph File0["<b>indexer/database/db.go</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0("<b>[Line: 39]</b> #quot; password=%s#quot;")
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2("<b>[Line: 39]</b> dsn")
        end
        %% Sink

        subgraph Sink
            direction LR

            v1("<b>[Line: 41]</b> gorm.Open(postgres.Open(dsn), &gorm.Config{<br>		// The indexer will explicitly manage the transactions<br>		SkipDefaultTransaction: true,<br><br>		// We may choose to create an adapter such that the<br>		// logger emits to the geth logger when on DEBUG mode<br>		Logger: logger.Default.LogMode(logger.Silent),<br>	})")
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

    %% Clickable

    click v0 href "https://github.com/ethereum-optimism/optimism/blob/685658ee5f8237a0ccf18d69bc141dabd0b1d08d/indexer/database/db.go#L39" "View in source" _blank
    click v1 href "https://github.com/ethereum-optimism/optimism/blob/685658ee5f8237a0ccf18d69bc141dabd0b1d08d/indexer/database/db.go#L41" "View in source" _blank
    click v2 href "https://github.com/ethereum-optimism/optimism/blob/685658ee5f8237a0ccf18d69bc141dabd0b1d08d/indexer/database/db.go#L39" "View in source" _blank
Loading
Ignore this finding from gorm-empty-password.

@hamdiallam hamdiallam force-pushed the indexer.bridge.l2.start branch from bf1ff55 to 299b61d Compare September 9, 2023 20:10
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from 685658e to 76b2f5d Compare September 9, 2023 20:10
@hamdiallam hamdiallam force-pushed the indexer.bridge.l2.start branch from 299b61d to 0baf7a3 Compare September 9, 2023 20:35
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from 76b2f5d to aa3853a Compare September 9, 2023 20:35
@hamdiallam hamdiallam marked this pull request as ready for review September 9, 2023 20:43
@hamdiallam hamdiallam requested a review from a team as a code owner September 9, 2023 20:43
@hamdiallam hamdiallam force-pushed the indexer.bridge.l2.start branch from 0baf7a3 to 26da6b7 Compare September 9, 2023 22:16
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from aa3853a to 9df2a60 Compare September 9, 2023 22:16
@hamdiallam hamdiallam force-pushed the indexer.bridge.l2.start branch from 26da6b7 to 4c50792 Compare September 9, 2023 22:23
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from 9df2a60 to 05171fa Compare September 9, 2023 23:31
Base automatically changed from indexer.bridge.l2.start to develop September 10, 2023 13:16
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch 2 times, most recently from d8c42b0 to b0a656a Compare September 11, 2023 16:15
@hamdiallam hamdiallam force-pushed the indexer.legacy.blocks branch from b0a656a to 536a00a Compare September 11, 2023 17:10
@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify mergify bot added the S-on-merge-train Status: This PR is in the merge queue label Sep 11, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify mergify bot removed the S-on-merge-train Status: This PR is in the merge queue label Sep 11, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

Hey @hamdiallam, this pull request failed to merge and has been dequeued from the merge train. If you believe your PR failed in the merge train because of a flaky test, requeue it by commenting with @mergifyio requeue.
More details can be found on the Queue: Embarked in merge train check-run.

@hamdiallam
Copy link
Contributor Author

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@OptimismBot OptimismBot merged commit 467e6f8 into develop Sep 11, 2023
6 of 7 checks passed
@OptimismBot OptimismBot deleted the indexer.legacy.blocks branch September 11, 2023 18:45
@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify mergify bot added the S-on-merge-train Status: This PR is in the merge queue label Sep 11, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify mergify bot removed the S-on-merge-train Status: This PR is in the merge queue label Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-indexer Area: indexer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants