Skip to content

Commit 7f8b74d

Browse files
committed
📝 fix batcher intradoc links
📝 batcher doc-links indexer: Fix startup errors - The block locator was being initialized with a zero hash, which caused `Update` return `nil` and crash the process. - Adds an L2 conf depth parameter, since L2 can now reorg. update changesets to latest version op-node: Turn down log level of enode filtering This was spamming ~12 log lines every 2 seconds, so I turned down the log level. deletes old changeset patches check-changed: Add additional patterns to force total rebuild Adds a bunch of patterns that should trigger a rebuild of all dependencies. Mostly related to build stuff. fix(bmon): Fix balance monitor name Version Packages indexer: changeset Version Packages creates indexer docker build cci configs feat(ctb): commit prod Goerli config Commits the production Goerli configuration for Bedrock. Add vault recipients Remove coinbase feat(ctb): Goerli deployment artifacts Commits deployment artifacts for Goerli ✨ typo fix 📝 update specs link for bedrock 🔨 fix: batcher doc line lengths fix: batcher doc aliasing? nit: remove doc link alias hyphen
1 parent e8c5eac commit 7f8b74d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+9543
-449
lines changed

.circleci/config.yml

+14
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,20 @@ workflows:
10451045
- oplabs-gcr
10461046
requires:
10471047
- op-heartbeat-docker-build
1048+
- docker-build:
1049+
name: indexer-docker-build
1050+
docker_file: indexer/Dockerfile
1051+
docker_name: indexer
1052+
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
1053+
docker_context: .
1054+
- docker-publish:
1055+
name: indexer-docker-publish
1056+
docker_name: indexer
1057+
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
1058+
context:
1059+
- oplabs-gcr
1060+
requires:
1061+
- indexer-docker-build
10481062
- hive-test:
10491063
name: hive-test-rpc
10501064
version: <<pipeline.git.revision>>

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ There are plenty of ways to contribute, in particular we appreciate support in t
88
- Fixing and responding to existing issues. You can start off with those tagged ["good first issue"](https://github.com/ethereum-optimism/optimism/contribute) which are meant as introductory issues for external contributors.
99
- Improving the [community site](https://community.optimism.io/), [documentation](https://github.com/ethereum-optimism/community-hub) and [tutorials](https://github.com/ethereum-optimism/optimism-tutorial).
1010
- Become an "Optimizer" and answer questions in the [Optimism Discord](https://discord.optimism.io).
11-
- Get involved in the protocol design process by proposing changes or new features or write parts of the spec yourself in the [optimistic-specs repo](https://github.com/ethereum-optimism/optimistic-specs).
11+
- Get involved in the protocol design process by proposing changes or new features or write parts of the spec yourself in the [specs subdirectory](./specs/).
1212

1313
Note that we have a [Code of Conduct](https://github.com/ethereum-optimism/.github/blob/master/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
1414

indexer/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @eth-optimism/indexer
22

3+
## 0.7.0
4+
5+
### Minor Changes
6+
7+
- ed50bd5b4: Bump indexer
8+
9+
## 0.6.0
10+
11+
### Minor Changes
12+
13+
- ecf0cc59b: Fix startup issues, add L2 conf depth
14+
315
## 0.5.0
416

517
### Minor Changes

indexer/config.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ type Config struct {
6565
// L1StartBlockNumber is the block number to start indexing L1 from.
6666
L1StartBlockNumber uint64
6767

68-
// ConfDepth is the number of confirmations after which headers are
69-
// considered confirmed.
70-
ConfDepth uint64
68+
// L1ConfDepth is the number of confirmations after which headers are
69+
// considered confirmed on L1.
70+
L1ConfDepth uint64
71+
72+
// L2ConfDepth is the number of confirmations after which headers are
73+
// considered confirmed on L2.
74+
L2ConfDepth uint64
7175

7276
// MaxHeaderBatchSize is the maximum number of headers to request as a
7377
// batch.
@@ -122,7 +126,8 @@ func NewConfig(ctx *cli.Context) (Config, error) {
122126
LogLevel: ctx.GlobalString(flags.LogLevelFlag.Name),
123127
LogTerminal: ctx.GlobalBool(flags.LogTerminalFlag.Name),
124128
L1StartBlockNumber: ctx.GlobalUint64(flags.L1StartBlockNumberFlag.Name),
125-
ConfDepth: ctx.GlobalUint64(flags.ConfDepthFlag.Name),
129+
L1ConfDepth: ctx.GlobalUint64(flags.L1ConfDepthFlag.Name),
130+
L2ConfDepth: ctx.GlobalUint64(flags.L2ConfDepthFlag.Name),
126131
MaxHeaderBatchSize: ctx.GlobalUint64(flags.MaxHeaderBatchSizeFlag.Name),
127132
MetricsServerEnable: ctx.GlobalBool(flags.MetricsServerEnableFlag.Name),
128133
RESTHostname: ctx.GlobalString(flags.RESTHostnameFlag.Name),

indexer/flags/flags.go

+12-5
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,17 @@ var (
137137
Value: 0,
138138
EnvVar: prefixEnvVar("START_BLOCK_NUMBER"),
139139
}
140-
ConfDepthFlag = cli.Uint64Flag{
141-
Name: "conf-depth",
142-
Usage: "The number of confirmations after which headers are considered confirmed",
140+
L1ConfDepthFlag = cli.Uint64Flag{
141+
Name: "l1-conf-depth",
142+
Usage: "The number of confirmations after which headers are considered confirmed on L1",
143143
Value: 20,
144-
EnvVar: prefixEnvVar("CONF_DEPTH"),
144+
EnvVar: prefixEnvVar("L1_CONF_DEPTH"),
145+
}
146+
L2ConfDepthFlag = cli.Uint64Flag{
147+
Name: "l2-conf-depth",
148+
Usage: "The number of confirmations after which headers are considered confirmed on L1",
149+
Value: 24,
150+
EnvVar: prefixEnvVar("L2_CONF_DEPTH"),
145151
}
146152
MaxHeaderBatchSizeFlag = cli.Uint64Flag{
147153
Name: "max-header-batch-size",
@@ -203,7 +209,8 @@ var optionalFlags = []cli.Flag{
203209
SentryEnableFlag,
204210
SentryDsnFlag,
205211
SentryTraceRateFlag,
206-
ConfDepthFlag,
212+
L1ConfDepthFlag,
213+
L2ConfDepthFlag,
207214
MaxHeaderBatchSizeFlag,
208215
L1StartBlockNumberFlag,
209216
RESTHostnameFlag,

indexer/indexer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func NewIndexer(cfg Config) (*Indexer, error) {
164164
ChainID: new(big.Int).SetUint64(cfg.ChainID),
165165
AddressManager: addrManager,
166166
DB: db,
167-
ConfDepth: cfg.ConfDepth,
167+
ConfDepth: cfg.L1ConfDepth,
168168
MaxHeaderBatchSize: cfg.MaxHeaderBatchSize,
169169
StartBlockNumber: cfg.L1StartBlockNumber,
170170
Bedrock: cfg.Bedrock,
@@ -179,7 +179,7 @@ func NewIndexer(cfg Config) (*Indexer, error) {
179179
L2RPC: l2RPC,
180180
L2Client: l2Client,
181181
DB: db,
182-
ConfDepth: cfg.ConfDepth,
182+
ConfDepth: cfg.L2ConfDepth,
183183
MaxHeaderBatchSize: cfg.MaxHeaderBatchSize,
184184
StartBlockNumber: uint64(0),
185185
Bedrock: cfg.Bedrock,

indexer/integration_tests/bedrock_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ func TestBedrockIndexer(t *testing.T) {
7373
LogLevel: "info",
7474
LogTerminal: true,
7575
L1StartBlockNumber: 0,
76-
ConfDepth: 1,
76+
L1ConfDepth: 1,
77+
L2ConfDepth: 1,
7778
MaxHeaderBatchSize: 2,
7879
RESTHostname: "127.0.0.1",
7980
RESTPort: 7980,

indexer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eth-optimism/indexer",
3-
"version": "0.5.0",
3+
"version": "0.7.0",
44
"private": true,
55
"license": "MIT"
66
}

indexer/services/l1/service.go

+35-21
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type Service struct {
7171
batchScanner *scc.StateCommitmentChainFilterer
7272
latestHeader uint64
7373
headerSelector *ConfirmedHeaderSelector
74+
l1Client *ethclient.Client
7475

7576
metrics *metrics.Metrics
7677
tokenCache map[common.Address]*db.Token
@@ -143,6 +144,7 @@ func NewService(cfg ServiceConfig) (*Service, error) {
143144
ZeroAddress: db.ETHL1Token,
144145
},
145146
isBedrock: cfg.Bedrock,
147+
l1Client: cfg.L1Client,
146148
}
147149
service.wg.Add(1)
148150
return service, nil
@@ -202,16 +204,22 @@ func (s *Service) loop() {
202204
}
203205

204206
func (s *Service) Update(newHeader *types.Header) error {
205-
var lowest = db.BlockLocator{
206-
Number: s.cfg.StartBlockNumber,
207-
}
207+
var lowest db.BlockLocator
208208
highestConfirmed, err := s.cfg.DB.GetHighestL1Block()
209209
if err != nil {
210210
return err
211211
}
212-
if highestConfirmed != nil {
213-
lowest = *highestConfirmed
212+
if highestConfirmed == nil {
213+
startHeader, err := s.l1Client.HeaderByNumber(s.ctx, new(big.Int).SetUint64(s.cfg.StartBlockNumber))
214+
if err != nil {
215+
return fmt.Errorf("error fetching header by number: %w", err)
216+
}
217+
highestConfirmed = &db.BlockLocator{
218+
Number: s.cfg.StartBlockNumber,
219+
Hash: startHeader.Hash(),
220+
}
214221
}
222+
lowest = *highestConfirmed
215223

216224
headers, err := s.headerSelector.NewHead(s.ctx, lowest.Number, newHeader, s.cfg.RawL1Client)
217225
if err != nil {
@@ -260,22 +268,28 @@ func (s *Service) Update(newHeader *types.Header) error {
260268
bridgeDepositsCh <- deposits
261269
}(bridgeImpl)
262270
}
263-
go func() {
264-
provenWithdrawals, err := s.portal.GetProvenWithdrawalsByBlockRange(s.ctx, startHeight, endHeight)
265-
if err != nil {
266-
errCh <- err
267-
return
268-
}
269-
provenWithdrawalsCh <- provenWithdrawals
270-
}()
271-
go func() {
272-
finalizedWithdrawals, err := s.portal.GetFinalizedWithdrawalsByBlockRange(s.ctx, startHeight, endHeight)
273-
if err != nil {
274-
errCh <- err
275-
return
276-
}
277-
finalizedWithdrawalsCh <- finalizedWithdrawals
278-
}()
271+
272+
if s.isBedrock {
273+
go func() {
274+
provenWithdrawals, err := s.portal.GetProvenWithdrawalsByBlockRange(s.ctx, startHeight, endHeight)
275+
if err != nil {
276+
errCh <- err
277+
return
278+
}
279+
provenWithdrawalsCh <- provenWithdrawals
280+
}()
281+
go func() {
282+
finalizedWithdrawals, err := s.portal.GetFinalizedWithdrawalsByBlockRange(s.ctx, startHeight, endHeight)
283+
if err != nil {
284+
errCh <- err
285+
return
286+
}
287+
finalizedWithdrawalsCh <- finalizedWithdrawals
288+
}()
289+
} else {
290+
provenWithdrawalsCh <- make(bridge.ProvenWithdrawalsMap)
291+
finalizedWithdrawalsCh <- make(bridge.FinalizedWithdrawalsMap)
292+
}
279293

280294
var receives int
281295
for {

op-node/p2p/discovery.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,17 @@ func FilterEnodes(log log.Logger, cfg *rollup.Config) func(node *enode.Node) boo
216216
err := node.Load(&dat)
217217
// if the entry does not exist, or if it is invalid, then ignore the node
218218
if err != nil {
219-
log.Debug("discovered node record has no opstack info", "node", node.ID(), "err", err)
219+
log.Trace("discovered node record has no opstack info", "node", node.ID(), "err", err)
220220
return false
221221
}
222222
// check chain ID matches
223223
if cfg.L2ChainID.Uint64() != dat.chainID {
224-
log.Debug("discovered node record has no matching chain ID", "node", node.ID(), "got", dat.chainID, "expected", cfg.L2ChainID.Uint64())
224+
log.Trace("discovered node record has no matching chain ID", "node", node.ID(), "got", dat.chainID, "expected", cfg.L2ChainID.Uint64())
225225
return false
226226
}
227227
// check version matches
228228
if dat.version != 0 {
229-
log.Debug("discovered node record has no matching version", "node", node.ID(), "got", dat.version, "expected", 0)
229+
log.Trace("discovered node record has no matching version", "node", node.ID(), "got", dat.version, "expected", 0)
230230
return false
231231
}
232232
return true

ops/check-changed/main.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
from github import Github
88

9+
REBUILD_ALL_PATTERNS = [
10+
r'^\.circleci/\.*',
11+
r'^\.github/\.*',
12+
r'^package\.json',
13+
r'^yarn\.lock',
14+
r'ops/check-changed/.*'
15+
]
16+
917
WHITELISTED_BRANCHES = {
1018
'master',
1119
'develop'
@@ -42,7 +50,7 @@
4250

4351
def main():
4452
patterns = sys.argv[1].split(',')
45-
patterns.append(r'^\.circleci/\.*')
53+
patterns = patterns + REBUILD_ALL_PATTERNS
4654

4755
fp = os.path.realpath(__file__)
4856
monorepo_path = os.path.realpath(os.path.join(fp, '..', '..'))

ops/docker/Dockerfile.packages

+14-14
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ FROM ethereumoptimism/foundry:latest as foundry
66
FROM node:16-alpine3.14 as base
77

88
RUN apk --no-cache add curl \
9-
jq \
10-
python3 \
11-
ca-certificates \
12-
git \
13-
make \
14-
gcc \
15-
musl-dev \
16-
linux-headers \
17-
bash \
18-
build-base \
19-
gcompat
9+
jq \
10+
python3 \
11+
ca-certificates \
12+
git \
13+
make \
14+
gcc \
15+
musl-dev \
16+
linux-headers \
17+
bash \
18+
build-base \
19+
gcompat
2020

2121
ENV GLIBC_KEY=https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
2222
ENV GLIBC_KEY_FILE=/etc/apk/keys/sgerrand.rsa.pub
2323
ENV GLIBC_RELEASE=https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk
2424

2525
RUN wget -q -O ${GLIBC_KEY_FILE} ${GLIBC_KEY} \
26-
&& wget -O glibc.apk ${GLIBC_RELEASE} \
27-
&& apk add glibc.apk --force
26+
&& wget -O glibc.apk ${GLIBC_RELEASE} \
27+
&& apk add glibc.apk --force
2828

2929
COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge
3030
COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast
@@ -108,6 +108,6 @@ FROM base as drippie-mon
108108
WORKDIR /opt/optimism/packages/drippie-mon
109109
ENTRYPOINT ["npm", "run", "start"]
110110

111-
FROM base as drippie-mon
111+
FROM base as balance-monitor
112112
WORKDIR /opt/optimism/packages/balance-monitor
113113
ENTRYPOINT ["yarn", "run", "start:prod"]

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"typescript": "^4.9.3"
9393
},
9494
"dependencies": {
95-
"@changesets/cli": "^2.16.0",
95+
"@changesets/cli": "^2.26.0",
9696
"@codechecks/client": "^0.1.11",
9797
"@ethersproject/abstract-provider": "^5.7.0"
9898
}

packages/balance-monitor/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @eth-optimism/balance-monitor
22

3+
## 0.0.4
4+
5+
### Patch Changes
6+
7+
- 013bd456f: Fixed the name in Dockerfile.packages
8+
39
## 0.0.3
410

511
### Patch Changes

packages/balance-monitor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eth-optimism/balance-monitor",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "[Optimism] Forta Agent that reports whether certain accounts have fallen below some balance",
55
"main": "dist/index",
66
"types": "dist/index",

0 commit comments

Comments
 (0)