diff --git a/.circleci/config.yml b/.circleci/config.yml index 604b8c42071b3..b64e6c0af5274 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/.semgrepignore b/.semgrepignore index a273ce80be93a..ad3a29a9c2885 100644 --- a/.semgrepignore +++ b/.semgrepignore @@ -20,4 +20,4 @@ tests/ l2geth/ packages/*/node_modules -packages/*/test \ No newline at end of file +packages/*/test diff --git a/op-e2e/geth.go b/op-e2e/geth.go index b849e8f3a6811..ee92217f24806 100644 --- a/op-e2e/geth.go +++ b/op-e2e/geth.go @@ -27,8 +27,6 @@ import ( func waitForTransaction(hash common.Hash, client *ethclient.Client, timeout time.Duration) (*types.Receipt, error) { timeoutCh := time.After(timeout) - ticker := time.NewTicker(100 * time.Millisecond) - defer ticker.Stop() ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() for { @@ -42,7 +40,7 @@ func waitForTransaction(hash common.Hash, client *ethclient.Client, timeout time select { case <-timeoutCh: return nil, errors.New("timeout") - case <-ticker.C: + case <-time.After(100 * time.Millisecond): } } } diff --git a/op-proposer/service.go b/op-proposer/service.go index af0fdd549b9b8..530d30e69dfb2 100644 --- a/op-proposer/service.go +++ b/op-proposer/service.go @@ -101,12 +101,10 @@ func (s *Service) eventLoop() { defer s.wg.Done() name := s.cfg.Driver.Name() - ticker := time.NewTicker(s.cfg.PollInterval) - defer ticker.Stop() for { select { - case <-ticker.C: + case <-time.After(s.cfg.PollInterval): // Determine the range of L2 blocks that the submitter has not // processed, and needs to take action on. s.l.Info(name + " fetching current block range") diff --git a/op-proposer/txmgr/txmgr.go b/op-proposer/txmgr/txmgr.go index d41b064fb2e9a..f09b94dacbee6 100644 --- a/op-proposer/txmgr/txmgr.go +++ b/op-proposer/txmgr/txmgr.go @@ -205,15 +205,12 @@ func (m *SimpleTxManager) Send( wg.Add(1) go sendTxAsync() - ticker := time.NewTicker(m.cfg.ResubmissionTimeout) - defer ticker.Stop() - for { select { // Whenever a resubmission timeout has elapsed, bump the gas // price and publish a new transaction. - case <-ticker.C: + case <-time.After(m.cfg.ResubmissionTimeout): // Avoid republishing if we are waiting for confirmation on an // existing tx. This is primarily an optimization to reduce the // number of API calls we make, but also reduces the chances of