-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: l1/l2 indexer service #2001
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
Closed
tuxcanfly
wants to merge
107
commits into
ethereum-optimism:develop
from
tuxcanfly:tux/optimism-indexer
Closed
Changes from 101 commits
Commits
Show all changes
107 commits
Select commit
Hold shift + click to select a range
5fd9c03
feat: indexer service to replace etherscan dependency
tuxcanfly 70019f9
feat: indexer - use batchsubmitter scaffold
tuxcanfly f079689
fix: rm unused event loop, tx mgr; cleanup
tuxcanfly 69dd9f2
fix: rename to l1IndexingService
tuxcanfly f01cd72
feat: implement chainSync - check local height
tuxcanfly 89edbc7
fix: cleanup refs to db
tuxcanfly 1a0df4c
feat: add postgres db and data layer
tuxcanfly 96d940a
fix: cleanup; add l1 indexer driver
tuxcanfly 37989dc
fix: rm driver, just use service
tuxcanfly dac6394
fix: rewrite service as indexer
tuxcanfly 03fc66e
fix (flags): add conf-depth, max-batch-header-size
tuxcanfly f21d9be
fix: log header as log15 var
tuxcanfly a6abe40
fix: increase default rpc timeout
tuxcanfly b5773fb
fix: use flag for start block number, hash
tuxcanfly df51738
fix: bindings
tuxcanfly 44a6eb4
fix: pass ctc address to service config
tuxcanfly 03c007e
changelog: update
tuxcanfly 2386738
fix: avoid panics in db, service
tuxcanfly ec42fdc
fix: update env
tuxcanfly e2cd29a
fix (metrics): rm unused guages, add placeholder
tuxcanfly 27aedf2
fix (indexer): avoid potentially leaking defer
tuxcanfly 4dcc24d
fix (indexer): rm txmgr
tuxcanfly 158cc90
fix (indexer): use log instead of fmt
tuxcanfly a3dbbb2
fix (indexer): add tx amount to indexed fields
tuxcanfly 5fcc9ff
fix (minor): add tx hash to deposit log
tuxcanfly d48ca8d
fix (indexer): store amount as text
tuxcanfly cabd3cb
feat (indexer): deposits - index from address
tuxcanfly 4702850
feat (indexer): get deposits by address API
tuxcanfly 3585f34
feat (indexer): use TokenBridgeMessage for API
tuxcanfly a23f801
feat (indexer): add block number/timestamp
tuxcanfly 12132b4
feat (indexer): add /v1/status API endpoint
tuxcanfly 4ef8909
feat (indexer): calculate sync progress
tuxcanfly 9d8717f
feat (indexer): split l1/l2 indexer services
tuxcanfly 7db0dd1
feat (indexer): fix log errs
tuxcanfly 3ab055a
feat (indexer): update withdraw schema; fix addr
tuxcanfly 89270e7
fix (indexer): include from, amount in withdrawals
tuxcanfly c7baa80
feat (indexer): paginate deposits/withdrawals
tuxcanfly fd9f732
fix (indexer): nits
tuxcanfly c5061fd
fix (indexer): index all withdrawal data
tuxcanfly 97277f4
fix (indexer): switch ctc chain to l1 bridge
tuxcanfly 95d2e74
fix (indexer): fix l1 standard bridge bindings
tuxcanfly 03e5197
fix (indexer): add bridge address flags; cleanup
tuxcanfly 4b8383b
fix (indexer): flags cleanup
tuxcanfly b92dc04
fix (indexer): cleanup unused args
tuxcanfly c2c2392
fix (indexer): rename l2 bridge addr var
tuxcanfly 518ee67
feat (indexer): add l2 genesis block hash flag
tuxcanfly 2e71416
fix (indexer): cleanup flags
tuxcanfly 283aede
fix (indexer): add log index to indexed fields
tuxcanfly 2f7bb3f
Add Dockerfile
mslipper 16e6f20
fix (flags): add log-terminal flag
tuxcanfly 2673c59
fix (indexer): fix confirmed block number log
tuxcanfly 49d39bf
fix (indexer): skip header validation - l1 service
tuxcanfly 47da875
fix (indexer): update env
tuxcanfly 84fe387
fix (indexer): fix issue with skipping in kovan
tuxcanfly 604119f
fix (indexer): revert kovan workaround
tuxcanfly 07072a9
fix (indexer): scan eth/erc20 l1 deposits
tuxcanfly fa740cc
refactor (indexer): use raw hash; don't compute
tuxcanfly 9096019
fix (indexer): index l1 tokens by address
tuxcanfly 7ffbf50
fix (indexer): fetch token along with deposit
tuxcanfly 9d0ee0c
fix (indexer): upsert eth l1 token fixture
tuxcanfly 539a447
fix (indexer): fix typo - l1 -> l2 token
tuxcanfly 4b22e52
Update env var prefix, poll rather than using newheads
mslipper 4539cc1
Add fast sync mode when far behind
mslipper 4f46234
Show which service logs what
mslipper c858b7b
Handle empty index case
mslipper ec0086b
Use queryRow in l1 too
mslipper a6e93a7
Allow indexer to be conditionally disabled
mslipper b39ed4c
Add http logging
mslipper 17c6c4a
Add healthz
mslipper 3c354b7
Add CORS
mslipper 34cf1cb
fix (indexer): fix erc20 vm execution err handling
tuxcanfly 99c5d6e
fix (indexer): l2 - index withdrawal erc20 tokens
tuxcanfly 7954aeb
fix (indexer): l2 - cleanup
tuxcanfly a93e59b
fix (indexer): l2 - include token data in API
tuxcanfly 1f6fc2e
feat (indexer): init custom bridge support
tuxcanfly 932edb4
fix (indexer): l1 - add eth filter in std bridge
tuxcanfly 4fdf6f7
feat (indexer): add bridge addrs
tuxcanfly 0387614
fix (indexer): l1 - use standard / eth bridges
tuxcanfly 31a5e71
fix (indexer): l1 - use bridge instead of contract
tuxcanfly b7b3296
fix (indexer): l1 - restore index erc20; cleanup
tuxcanfly a5d404c
fix (indexer): use same docker image bss
tuxcanfly b49ac02
feat (indexer): l1 - support bitbtc, usx bridges
tuxcanfly 2f77a7a
feat (indexer): l2 custom bridges
tuxcanfly d8d702b
fix (indexer): update l2 chainids
tuxcanfly 8290489
fix (indexer): l2 - only use standard bridge
tuxcanfly 0a376e7
fix (indexer): l1 fetch header - retry on err
tuxcanfly ddb0136
fix (indexer): l2 fetch header - retry on err
tuxcanfly 1a9ce92
fix (indexer): add l1/l2 dai bridge
tuxcanfly 61e3ec7
fix (indexer): bridge - handle err with retry
tuxcanfly a715e4e
Update DB
mslipper 5408306
fix (indexer): API - fetch l1, l2 token details
tuxcanfly 807104b
Add metrics
mslipper 9c18259
Clean up, fix path
mslipper 549bd3a
Use correct current head, add sync progress metrics
mslipper 100999a
Add metrics namespace
mslipper 29a2d8f
Add objectives
mslipper e320030
rename metric
mslipper dc12ac6
Log duration
mslipper 5aac874
Record withdrawal time, add indexes to DB
mslipper 3c0aac6
fix (indexer): fix missing tx due to invalid token
tuxcanfly 9e3f269
fix (indexer): create index - rm concurrently
tuxcanfly 70a574f
feat (indexer): add StateCommitmentChain bindings
tuxcanfly 3b15930
feat (indexer): add state batch schema
tuxcanfly 4b41c4c
feat (indexer): db - add state batch index
tuxcanfly 42e3fb3
feat (indexer): add state batch appended filter
tuxcanfly 438e76f
feat (indexer): scan and index state batches
tuxcanfly cb05e16
feat (indexer): add withdrawal batch details
tuxcanfly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # @eth-optimism/indexer-service | ||
|
|
||
| ## 0.0.0 | ||
| ### Patch Changes | ||
|
|
||
| - 44a6eb4ce: Draft | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| GITCOMMIT := $(shell git rev-parse HEAD) | ||
| GITDATE := $(shell git show -s --format='%ct') | ||
| GITVERSION := $(shell cat package.json | jq .version) | ||
|
|
||
| LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT) | ||
| LDFLAGSSTRING +=-X main.GitDate=$(GITDATE) | ||
| LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION) | ||
| LDFLAGS := -ldflags "$(LDFLAGSSTRING)" | ||
|
|
||
| L1BRIDGE_ABI_ARTIFACT = ../../packages/contracts/artifacts/contracts/L1/messaging/L1StandardBridge.sol/L1StandardBridge.json | ||
| L2BRIDGE_ABI_ARTIFACT = ../../packages/contracts/artifacts/contracts/L2/messaging/L2StandardBridge.sol/L2StandardBridge.json | ||
|
|
||
| ERC20_ABI_ARTIFACT = ./contracts/ERC20.sol/ERC20.json | ||
|
|
||
| indexer: | ||
| env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/indexer | ||
|
|
||
| clean: | ||
| rm indexer | ||
|
|
||
| test: | ||
| go test -v ./... | ||
|
|
||
| lint: | ||
| golangci-lint run ./... | ||
|
|
||
| bindings: bindings-l1bridge bindings-l2bridge bindings-l1erc20 bindings-l2erc20 | ||
|
|
||
| bindings-l1bridge: | ||
| $(eval temp := $(shell mktemp)) | ||
|
|
||
| cat $(L1BRIDGE_ABI_ARTIFACT) \ | ||
| | jq -r .bytecode > $(temp) | ||
|
|
||
| cat $(L1BRIDGE_ABI_ARTIFACT) \ | ||
| | jq .abi \ | ||
| | abigen --pkg l1bridge \ | ||
| --abi - \ | ||
| --out bindings/l1bridge/l1_standard_bridge.go \ | ||
| --type L1StandardBridge \ | ||
| --bin $(temp) | ||
|
|
||
| rm $(temp) | ||
|
|
||
| bindings-l2bridge: | ||
| $(eval temp := $(shell mktemp)) | ||
|
|
||
| cat $(L2BRIDGE_ABI_ARTIFACT) \ | ||
| | jq -r .bytecode > $(temp) | ||
|
|
||
| cat $(L2BRIDGE_ABI_ARTIFACT) \ | ||
| | jq .abi \ | ||
| | ../../l2geth/build/bin/abigen --pkg l2bridge \ | ||
| --abi - \ | ||
| --out bindings/l2bridge/l2_standard_bridge.go \ | ||
| --type L2StandardBridge \ | ||
| --bin $(temp) | ||
|
|
||
| rm $(temp) | ||
|
|
||
| bindings-l1erc20: | ||
| $(eval temp := $(shell mktemp)) | ||
|
|
||
| cat $(ERC20_ABI_ARTIFACT) \ | ||
| | jq -r .bytecode > $(temp) | ||
|
|
||
| cat $(ERC20_ABI_ARTIFACT) \ | ||
| | jq .abi \ | ||
| | abigen --pkg l1erc20 \ | ||
| --abi - \ | ||
| --out bindings/l1erc20/l1erc20.go \ | ||
| --type L1ERC20 \ | ||
| --bin $(temp) | ||
|
|
||
| rm $(temp) | ||
|
|
||
| bindings-l2erc20: | ||
| $(eval temp := $(shell mktemp)) | ||
|
|
||
| cat $(ERC20_ABI_ARTIFACT) \ | ||
| | jq -r .bytecode > $(temp) | ||
|
|
||
| cat $(ERC20_ABI_ARTIFACT) \ | ||
| | jq .abi \ | ||
| | ../../l2geth/build/bin/abigen --pkg l2erc20 \ | ||
| --abi - \ | ||
| --out bindings/l2erc20/l2erc20.go \ | ||
| --type L2ERC20 \ | ||
| --bin $(temp) | ||
|
|
||
| rm $(temp) | ||
|
|
||
| .PHONY: \ | ||
| indexer \ | ||
| bindings \ | ||
| bindings-l1bridge \ | ||
| bindings-l2bridge \ | ||
| clean \ | ||
| test \ | ||
| lint |
1,124 changes: 1,124 additions & 0 deletions
1,124
go/indexer/bindings/l1bridge/l1_standard_bridge.go
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
|
|
||
| "github.com/ethereum/go-ethereum/log" | ||
| "github.com/ethereum/go-ethereum/params" | ||
| "github.com/urfave/cli" | ||
|
|
||
| "github.com/ethereum-optimism/optimism/go/indexer" | ||
| "github.com/ethereum-optimism/optimism/go/indexer/flags" | ||
| ) | ||
|
|
||
| var ( | ||
| GitVersion = "" | ||
| GitCommit = "" | ||
| GitDate = "" | ||
| ) | ||
|
|
||
| func main() { | ||
| // Set up logger with a default INFO level in case we fail to parse flags. | ||
| // Otherwise the final crtiical log won't show what the parsing error was. | ||
| log.Root().SetHandler( | ||
| log.LvlFilterHandler( | ||
| log.LvlInfo, | ||
| log.StreamHandler(os.Stdout, log.TerminalFormat(true)), | ||
|
tuxcanfly marked this conversation as resolved.
|
||
| ), | ||
| ) | ||
|
|
||
| app := cli.NewApp() | ||
| app.Flags = flags.Flags | ||
| app.Version = fmt.Sprintf("%s-%s", GitVersion, params.VersionWithCommit(GitCommit, GitDate)) | ||
| app.Name = "indexer" | ||
| app.Usage = "Indexer Service" | ||
| app.Description = "Service for indexing deposits and withdrawals " + | ||
| "by account on L1 and L2" | ||
|
|
||
| app.Action = indexer.Main(GitVersion) | ||
| err := app.Run(os.Args) | ||
| if err != nil { | ||
| log.Crit("Application failed", "message", err) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| package indexer | ||
|
|
||
| import ( | ||
| "errors" | ||
| "time" | ||
|
|
||
| "github.com/ethereum/go-ethereum/log" | ||
| "github.com/urfave/cli" | ||
|
|
||
| "github.com/ethereum-optimism/optimism/go/indexer/flags" | ||
| ) | ||
|
|
||
| var ( | ||
| // ErrSentryDSNNotSet signals that not Data Source Name was provided | ||
| // with which to configure Sentry logging. | ||
| ErrSentryDSNNotSet = errors.New("sentry-dsn must be set if use-sentry " + | ||
| "is true") | ||
| ) | ||
|
|
||
| type Config struct { | ||
| /* Required Params */ | ||
|
|
||
| // BuildEnv identifies the environment this binary is intended for, i.e. | ||
| // production, development, etc. | ||
| BuildEnv string | ||
|
|
||
| // EthNetworkName identifies the intended Ethereum network. | ||
| EthNetworkName string | ||
|
|
||
| // L1EthRpc is the HTTP provider URL for L1. | ||
| L1EthRpc string | ||
|
|
||
| // L2EthRpc is the HTTP provider URL for L1. | ||
| L2EthRpc string | ||
|
|
||
| // L1StandardBridgeAddress is the l1 standard bridge contract address. | ||
| L1StandardBridgeAddress string | ||
|
|
||
| // L2StandardBridgeAddress is the l2 standard bridge contract address. | ||
| L2StandardBridgeAddress string | ||
|
|
||
| // L2GenesisBlockHash is the l2 genesis block hash. | ||
| L2GenesisBlockHash string | ||
|
|
||
| // PollInterval is the delay between querying L2 for more transaction | ||
| // and creating a new batch. | ||
| PollInterval time.Duration | ||
|
|
||
| // Hostname of the database connection. | ||
| DBHost string | ||
|
|
||
| // Port of the database connection. | ||
| DBPort uint64 | ||
|
|
||
| // Username of the database connection. | ||
| DBUser string | ||
|
|
||
| // Password of the database connection. | ||
| DBPassword string | ||
|
|
||
| // Database name of the database connection. | ||
| DBName string | ||
|
|
||
| /* Optional Params */ | ||
|
|
||
| // LogLevel is the lowest log level that will be output. | ||
| LogLevel string | ||
|
|
||
| // LogTerminal if true, prints to stdout in terminal format, otherwise | ||
| // prints using JSON. If SentryEnable is true this flag is ignored, and logs | ||
| // are printed using JSON. | ||
| LogTerminal bool | ||
|
|
||
| // SentryEnable if true, logs any error messages to sentry. SentryDsn | ||
| // must also be set if SentryEnable is true. | ||
| SentryEnable bool | ||
|
|
||
| // SentryDsn is the sentry Data Source Name. | ||
| SentryDsn string | ||
|
|
||
| // SentryTraceRate the frequency with which Sentry should flush buffered | ||
| // events. | ||
| SentryTraceRate time.Duration | ||
|
|
||
| // StartBlockNumber is the block number to start indexing from. | ||
| StartBlockNumber uint64 | ||
|
|
||
| // StartBlockHash is the block hash to start indexing from. | ||
| StartBlockHash string | ||
|
|
||
| // ConfDepth is the number of confirmations after which headers are | ||
| // considered confirmed. | ||
| ConfDepth uint64 | ||
|
|
||
| // MaxHeaderBatchSize is the maximum number of headers to request as a | ||
| // batch. | ||
| MaxHeaderBatchSize uint64 | ||
|
|
||
| // MetricsServerEnable if true, will create a metrics client and log to | ||
| // Prometheus. | ||
| MetricsServerEnable bool | ||
|
|
||
| // MetricsHostname is the hostname at which the metrics server is running. | ||
| MetricsHostname string | ||
|
|
||
| // MetricsPort is the port at which the metrics server is running. | ||
| MetricsPort uint64 | ||
|
|
||
| // DisableIndexer enables/disables the indexer. | ||
| DisableIndexer bool | ||
| } | ||
|
|
||
| // NewConfig parses the Config from the provided flags or environment variables. | ||
| // This method fails if ValidateConfig deems the configuration to be malformed. | ||
| func NewConfig(ctx *cli.Context) (Config, error) { | ||
| cfg := Config{ | ||
| /* Required Flags */ | ||
| BuildEnv: ctx.GlobalString(flags.BuildEnvFlag.Name), | ||
| EthNetworkName: ctx.GlobalString(flags.EthNetworkNameFlag.Name), | ||
| L1EthRpc: ctx.GlobalString(flags.L1EthRpcFlag.Name), | ||
| L2EthRpc: ctx.GlobalString(flags.L2EthRpcFlag.Name), | ||
| L1StandardBridgeAddress: ctx.GlobalString(flags.L1StandardBridgeAddressFlag.Name), | ||
| L2StandardBridgeAddress: ctx.GlobalString(flags.L2StandardBridgeAddressFlag.Name), | ||
| L2GenesisBlockHash: ctx.GlobalString(flags.L2GenesisBlockHashFlag.Name), | ||
| DBHost: ctx.GlobalString(flags.DBHostFlag.Name), | ||
| DBPort: ctx.GlobalUint64(flags.DBPortFlag.Name), | ||
| DBUser: ctx.GlobalString(flags.DBUserFlag.Name), | ||
| DBPassword: ctx.GlobalString(flags.DBPasswordFlag.Name), | ||
| DBName: ctx.GlobalString(flags.DBNameFlag.Name), | ||
| /* Optional Flags */ | ||
| DisableIndexer: ctx.GlobalBool(flags.DisableIndexer.Name), | ||
| LogLevel: ctx.GlobalString(flags.LogLevelFlag.Name), | ||
| LogTerminal: ctx.GlobalBool(flags.LogTerminalFlag.Name), | ||
| SentryEnable: ctx.GlobalBool(flags.SentryEnableFlag.Name), | ||
| SentryDsn: ctx.GlobalString(flags.SentryDsnFlag.Name), | ||
| SentryTraceRate: ctx.GlobalDuration(flags.SentryTraceRateFlag.Name), | ||
| StartBlockNumber: ctx.GlobalUint64(flags.StartBlockNumberFlag.Name), | ||
| StartBlockHash: ctx.GlobalString(flags.StartBlockHashFlag.Name), | ||
| ConfDepth: ctx.GlobalUint64(flags.ConfDepthFlag.Name), | ||
| MaxHeaderBatchSize: ctx.GlobalUint64(flags.MaxHeaderBatchSizeFlag.Name), | ||
| MetricsServerEnable: ctx.GlobalBool(flags.MetricsServerEnableFlag.Name), | ||
| MetricsHostname: ctx.GlobalString(flags.MetricsHostnameFlag.Name), | ||
| MetricsPort: ctx.GlobalUint64(flags.MetricsPortFlag.Name), | ||
| } | ||
|
|
||
| err := ValidateConfig(&cfg) | ||
| if err != nil { | ||
| return Config{}, err | ||
| } | ||
|
|
||
| return cfg, nil | ||
| } | ||
|
|
||
| // ValidateConfig ensures additional constraints on the parsed configuration to | ||
| // ensure that it is well-formed. | ||
| func ValidateConfig(cfg *Config) error { | ||
| // Sanity check log level. | ||
| if cfg.LogLevel == "" { | ||
| cfg.LogLevel = "debug" | ||
| } | ||
|
|
||
| _, err := log.LvlFromString(cfg.LogLevel) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| // Ensure the Sentry Data Source Name is set when using Sentry. | ||
| if cfg.SentryEnable && cfg.SentryDsn == "" { | ||
| return ErrSentryDSNNotSet | ||
| } | ||
|
|
||
| return nil | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package indexer_test | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "testing" | ||
|
|
||
| indexer "github.com/ethereum-optimism/optimism/go/indexer" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| var validateConfigTests = []struct { | ||
| name string | ||
| cfg indexer.Config | ||
| expErr error | ||
| }{ | ||
| { | ||
| name: "bad log level", | ||
| cfg: indexer.Config{ | ||
| LogLevel: "unknown", | ||
| }, | ||
| expErr: fmt.Errorf("unknown level: unknown"), | ||
| }, | ||
| } | ||
|
|
||
| // TestValidateConfig asserts the behavior of ValidateConfig by testing expected | ||
| // error and success configurations. | ||
| func TestValidateConfig(t *testing.T) { | ||
| for _, test := range validateConfigTests { | ||
| t.Run(test.name, func(t *testing.T) { | ||
| err := indexer.ValidateConfig(&test.cfg) | ||
| require.Equal(t, err, test.expErr) | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../build-info/d8a0f286587dfbd9a9d1e4f1e98e7119.json" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for a changelog - instead define a
package.jsonand our changeset system will take care of it.