Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-parrots-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/teleportr': patch
---

Fix panic
5 changes: 5 additions & 0 deletions .changeset/eighty-countries-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/common-ts': patch
---

Log server messages to logger instead of stdout
5 changes: 5 additions & 0 deletions .changeset/weak-needles-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/common-ts': patch
---

Include default options in metadata metric
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,19 @@ jobs:
SEMGREP_BASELINE_REF: << parameters.diff_branch >>
SEMGREP_REPO_URL: << pipeline.project.git_url >>
SEMGREP_BRANCH: << pipeline.git.branch >>
SEMGREP_COMMIT: << pipeline.git.revision >>

# Change job timeout (default is 1800 seconds; set to 0 to disable)
SEMGREP_TIMEOUT: 3000

docker:
- image: returntocorp/semgrep
resource_class: xlarge
steps:
- checkout
- run:
name: "Set environment variables" # for PR comments and in-app hyperlinks to findings
command: |
echo 'export SEMGREP_COMMIT=$CIRCLE_SHA1' >> $BASH_ENV
echo 'export SEMGREP_PR_ID=${CIRCLE_PULL_REQUEST##*/}' >> $BASH_ENV
echo 'export SEMGREP_JOB_URL=$CIRCLE_BUILD_URL' >> $BASH_ENV
echo 'export SEMGREP_REPO_NAME=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV
Expand Down
2 changes: 1 addition & 1 deletion .semgrepignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ tests/

l2geth/
packages/*/node_modules
packages/*/test
packages/*/test
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ test-integration:
./packages/contracts-bedrock/deployments/devnetL1
.PHONY: test-integration

# Remove the baseline-commit to generate a base reading & show all issues
semgrep:
$(eval DEV_REF := $(shell git rev-parse develop))
SEMGREP_REPO_NAME=ethereum-optimism/optimism semgrep ci --baseline-commit=$(DEV_REF)
.PHONY: semgrep

devnet-genesis:
bash ./ops-bedrock/devnet-genesis.sh
.PHONY: devnet-genesis
4 changes: 3 additions & 1 deletion op-e2e/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ func TestL2OutputSubmitter(t *testing.T) {

// Wait for batch submitter to update L2 output oracle.
timeoutCh := time.After(15 * time.Second)
ticker := time.NewTicker(1 * time.Second)
defer ticker.Stop()
for {
l2ooTimestamp, err := l2OutputOracle.LatestBlockTimestamp(&bind.CallOpts{})
require.Nil(t, err)
Expand Down Expand Up @@ -205,7 +207,7 @@ func TestL2OutputSubmitter(t *testing.T) {
select {
case <-timeoutCh:
t.Fatalf("State root oracle not updated")
case <-time.After(time.Second):
case <-ticker.C:
}
}

Expand Down
30 changes: 23 additions & 7 deletions packages/common-ts/src/base-service/base-service-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ export abstract class BaseServiceV2<
this.loop = params.loop !== undefined ? params.loop : true
this.state = {} as TServiceState

// Add default options to options spec.
;(params.optionsSpec as any) = {
...(params.optionsSpec || {}),

// Users cannot set these options.
const stdOptionsSpec: OptionsSpec<StandardOptions> = {
loopIntervalMs: {
validator: validators.num,
desc: 'Loop interval in milliseconds',
Expand All @@ -177,6 +173,12 @@ export abstract class BaseServiceV2<
},
}

// Add default options to options spec.
;(params.optionsSpec as any) = {
...(params.optionsSpec || {}),
...stdOptionsSpec,
}

// List of options that can safely be logged.
const publicOptionNames = Object.entries(params.optionsSpec)
.filter(([, spec]) => {
Expand Down Expand Up @@ -348,7 +350,11 @@ export abstract class BaseServiceV2<
name: params.name,
version: params.version,
...publicOptionNames.reduce((acc, key) => {
acc[key] = config.str(key)
if (key in stdOptionsSpec) {
acc[key] = this.options[key].toString()
} else {
acc[key] = config.str(key)
}
return acc
}, {}),
},
Expand All @@ -375,7 +381,17 @@ export abstract class BaseServiceV2<
app.use(bodyParser.urlencoded({ extended: true }))

// Logging.
app.use(morgan('short'))
app.use(
morgan('short', {
stream: {
write: (str: string) => {
this.logger.info(`server log`, {
log: str,
})
},
},
})
)

// Metrics.
// Will expose a /metrics endpoint by default.
Expand Down
3 changes: 3 additions & 0 deletions teleportr/drivers/disburser/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ func (d *Driver) SendTransaction(
subCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
err := d.cfg.L2Client.SendTransaction(subCtx, tx)
if err == nil {
return err
}
if !IsRetryableError(err) {
d.metrics.FailedTXSubmissions.WithLabelValues("permanent").Inc()
return backoff.Permanent(err)
Expand Down