Commit c6e58a5c authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge pull request #2756 from ethereum-optimism/develop

Develop -> Master
parents e2a3fa47 050859fd
---
'@eth-optimism/teleportr': patch
---
Fix panic
---
'@eth-optimism/common-ts': patch
---
Log server messages to logger instead of stdout
---
'@eth-optimism/common-ts': patch
---
Include default options in metadata metric
......@@ -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
......
......@@ -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
......@@ -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)
......@@ -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:
}
}
......
......@@ -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',
......@@ -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]) => {
......@@ -348,7 +350,11 @@ export abstract class BaseServiceV2<
name: params.name,
version: params.version,
...publicOptionNames.reduce((acc, key) => {
if (key in stdOptionsSpec) {
acc[key] = this.options[key].toString()
} else {
acc[key] = config.str(key)
}
return acc
}, {}),
},
......@@ -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.
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment