From efa650beef0ef926f8e72129094dd5d691a32fb2 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 8 Aug 2023 17:51:49 +0530 Subject: [PATCH 001/126] Bold integration --- .gitmodules | 3 + Dockerfile | 2 + bold | 1 + go.mod | 6 +- go.sum | 1 + staker/challenge-cache/cache.go | 224 ++++++++ staker/challenge-cache/cache_test.go | 321 +++++++++++ staker/manager.go | 81 +++ staker/state_provider.go | 666 ++++++++++++++++++++++ system_tests/manager_test.go | 408 +++++++++++++ system_tests/validation_mock_test.go | 10 + validator/interface.go | 3 + validator/server_api/valiation_api.go | 26 + validator/server_api/validation_client.go | 22 + validator/server_arb/execution_run.go | 83 ++- 15 files changed, 1835 insertions(+), 22 deletions(-) create mode 160000 bold create mode 100644 staker/challenge-cache/cache.go create mode 100644 staker/challenge-cache/cache_test.go create mode 100644 staker/manager.go create mode 100644 staker/state_provider.go create mode 100644 system_tests/manager_test.go diff --git a/.gitmodules b/.gitmodules index 7c78791c78..c3cb5fc5fe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,3 +20,6 @@ [submodule "nitro-testnode"] path = nitro-testnode url = https://github.com/OffchainLabs/nitro-testnode.git +[submodule "bold"] + path = bold + url = https://github.com/OffchainLabs/bold.git diff --git a/Dockerfile b/Dockerfile index 367d76d4b1..08613c6d74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,6 +74,7 @@ COPY ./contracts/package.json ./contracts/yarn.lock ./contracts/ COPY ./solgen/gen.go ./solgen/ COPY ./fastcache ./fastcache COPY ./go-ethereum ./go-ethereum +COPY ./bold ./bold COPY --from=brotli-wasm-export / target/ COPY --from=contracts-builder workspace/contracts/build/contracts/src/precompiles/ contracts/build/contracts/src/precompiles/ COPY --from=contracts-builder workspace/.make/ .make/ @@ -176,6 +177,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ COPY go.mod go.sum ./ COPY go-ethereum/go.mod go-ethereum/go.sum go-ethereum/ COPY fastcache/go.mod fastcache/go.sum fastcache/ +COPY bold/go.mod bold/go.sum bold/ RUN go mod download COPY . ./ COPY --from=contracts-builder workspace/contracts/build/ contracts/build/ diff --git a/bold b/bold new file mode 160000 index 0000000000..35a2079d67 --- /dev/null +++ b/bold @@ -0,0 +1 @@ +Subproject commit 35a2079d67ac20aa1e1019f777c714fe2da2df59 diff --git a/go.mod b/go.mod index 509dec9a5b..8c39c17b65 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,8 @@ replace github.com/VictoriaMetrics/fastcache => ./fastcache replace github.com/ethereum/go-ethereum => ./go-ethereum +replace github.com/OffchainLabs/bold => ./bold + require ( github.com/alicebob/miniredis/v2 v2.21.0 github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 @@ -18,7 +20,7 @@ require ( github.com/cavaliergopher/grab/v3 v3.0.1 github.com/codeclysm/extract/v3 v3.0.2 github.com/dgraph-io/badger/v3 v3.2103.2 - github.com/ethereum/go-ethereum v1.10.26 + github.com/ethereum/go-ethereum v1.12.0 github.com/google/go-cmp v0.5.9 github.com/hashicorp/golang-lru/v2 v2.0.1 github.com/ipfs/go-cid v0.3.2 @@ -31,7 +33,7 @@ require ( github.com/multiformats/go-multihash v0.2.1 github.com/spf13/pflag v1.0.5 github.com/wealdtech/go-merkletree v1.0.0 - golang.org/x/term v0.5.0 + golang.org/x/term v0.6.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) diff --git a/go.sum b/go.sum index 304f7cc4aa..719e2a7729 100644 --- a/go.sum +++ b/go.sum @@ -1956,6 +1956,7 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go new file mode 100644 index 0000000000..3ca6a5f657 --- /dev/null +++ b/staker/challenge-cache/cache.go @@ -0,0 +1,224 @@ +/* +* Package challengecache stores validator state roots for L2 states within +challenges in text files using a directory hierarchy structure for efficient lookup. Each file +contains a list of state roots (32 byte hashes), concatenated together as bytes. +Using this structure, we can namespace state roots by message number and big step challenge. + +Once a validator computes the set of machine state roots for a given challenge move the first time, +it will write the roots to this filesystem hierarchy for fast access next time these roots are needed. + +Use cases: +- State roots for a big step challenge from message N to N+1 +- State roots 0 to M for a big step challenge from message N to N+1 +- State roots for a small step challenge from message N to N+1, and big step M to M+1 +- State roots 0 to P for a small step challenge from message N to N+1, and big step M to M+1 + + wavm-module-root-0xab/ + message-num-70/ + roots.txt + big-step-100/ + roots.txt + +We namespace top-level block challenges by wavm module root. Then, we can retrieve +the state roots for any data within a challenge or associated subchallenge based on the hierarchy above. +*/ + +package challengecache + +import ( + "bufio" + "errors" + "fmt" + "io" + "os" + "path/filepath" + + protocol "github.com/OffchainLabs/bold/chain-abstraction" + "github.com/OffchainLabs/bold/containers/option" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" +) + +var ( + ErrNotFoundInCache = errors.New("no found in challenge cache") + ErrFileAlreadyExists = errors.New("file already exists") + ErrNoStateRoots = errors.New("no state roots being written") + stateRootsFileName = "state-roots" + wavmModuleRootPrefix = "wavm-module-root" + messageNumberPrefix = "message-num" + bigStepPrefix = "big-step" +) + +// HistoryCommitmentCacher can retrieve history commitment state roots given lookup keys. +type HistoryCommitmentCacher interface { + Get(lookup *Key, readUpTo protocol.Height) ([]common.Hash, error) + Put(lookup *Key, stateRoots []common.Hash) error +} + +// Cache for history commitments on disk. +type Cache struct { + baseDir string +} + +// New cache from a base directory path. +func New(baseDir string) *Cache { + return &Cache{ + baseDir: baseDir, + } +} + +// Key for cache lookups includes the wavm module root of a challenge, as well +// as the heights for messages and big steps as needed. +type Key struct { + WavmModuleRoot common.Hash + MessageHeight protocol.Height + BigStepHeight option.Option[protocol.Height] +} + +// Get a list of state roots from the cache up to a certain index. State roots are saved as files in the directory +// hierarchy for the cache. If a file is not present, ErrNotFoundInCache +// is returned. +func (c *Cache) Get( + lookup *Key, + readUpTo protocol.Height, +) ([]common.Hash, error) { + fName, err := determineFilePath(c.baseDir, lookup) + if err != nil { + return nil, err + } + if _, err := os.Stat(fName); err != nil { + return nil, ErrNotFoundInCache + } + f, err := os.Open(fName) + if err != nil { + return nil, err + } + defer func() { + if err := f.Close(); err != nil { + log.Error("Could not close file after reading", "err", err, "file", fName) + } + }() + return readStateRoots(f, readUpTo) +} + +// Put a list of state roots into the cache. +// State roots are saved as files in a directory hierarchy for the cache. +// This function first creates a temporary file, writes the state roots to it, and then renames the file +// to the final directory to ensure atomic writes. +func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { + // We should error if trying to put 0 state roots to disk. + if len(stateRoots) == 0 { + return ErrNoStateRoots + } + fName, err := determineFilePath(c.baseDir, lookup) + if err != nil { + return err + } + // We create a tmp file to write our state roots to first. If writing fails, + // we don't want to leave a half-written file in our cache directory. + // Once writing succeeds, we rename in an atomic operation to the correct file name + // in the cache directory hierarchy. + tmp := os.TempDir() + tmpFName := filepath.Join(tmp, fName) + dir := filepath.Dir(tmpFName) + if err := os.MkdirAll(dir, os.ModePerm); err != nil { + return fmt.Errorf("could not make tmp directory %s: %w", dir, err) + } + f, err := os.Create(tmpFName) + if err != nil { + return err + } + defer func() { + if err := f.Close(); err != nil { + log.Error("Could not close file after writing", "err", err, "file", fName) + } + }() + if err := writeStateRoots(f, stateRoots); err != nil { + return err + } + if err := os.MkdirAll(filepath.Dir(fName), os.ModePerm); err != nil { + return fmt.Errorf("could not make file directory %s: %w", fName, err) + } + // If the file writing was successful, we rename the file from the tmp directory + // into our cache directory. This is an atomic operation. + // For more information on this atomic write pattern, see: + // https://stackoverflow.com/questions/2333872/how-to-make-file-creation-an-atomic-operation + return os.Rename(tmpFName /* old */, fName /* new */) +} + +// Reads 32 bytes at a time from a reader up to a specified height. If none, then read all. +func readStateRoots(r io.Reader, readUpTo protocol.Height) ([]common.Hash, error) { + br := bufio.NewReader(r) + stateRoots := make([]common.Hash, 0) + buf := make([]byte, 0, 32) + totalRead := uint64(0) + for { + n, err := br.Read(buf[:cap(buf)]) + if err != nil { + // If we try to read but reach EOF, we break out of the loop. + if err == io.EOF { + break + } + return nil, err + } + buf = buf[:n] + if n != 32 { + return nil, fmt.Errorf("expected to read 32 bytes, got %d bytes", n) + } + stateRoots = append(stateRoots, common.BytesToHash(buf)) + if totalRead >= uint64(readUpTo) { + return stateRoots, nil + } + totalRead++ + } + if readUpTo >= protocol.Height(len(stateRoots)) { + return nil, fmt.Errorf( + "wanted to read up to %d, but only read %d state roots", + readUpTo, + len(stateRoots), + ) + } + return stateRoots, nil +} + +func writeStateRoots(w io.Writer, stateRoots []common.Hash) error { + for i, rt := range stateRoots { + n, err := w.Write(rt[:]) + if err != nil { + return err + } + if n != len(rt) { + return fmt.Errorf( + "for state root %d, wrote %d bytes, expected to write %d bytes", + i, + n, + len(rt), + ) + } + } + return nil +} + +/* +* +When provided with a cache lookup struct, this function determines the file path +for the data requested within the cache directory hierarchy. The folder structure +for a given filesystem challenge cache will look as follows: + + wavm-module-root-0xab/ + message-num-70/ + roots.txt + big-step-100/ + roots.txt +*/ +func determineFilePath(baseDir string, lookup *Key) (string, error) { + key := make([]string, 0) + key = append(key, fmt.Sprintf("%s-%s", wavmModuleRootPrefix, lookup.WavmModuleRoot.Hex())) + key = append(key, fmt.Sprintf("%s-%d", messageNumberPrefix, lookup.MessageHeight)) + if !lookup.BigStepHeight.IsNone() { + bigStepHeight := lookup.BigStepHeight.Unwrap() + key = append(key, fmt.Sprintf("%s-%d", bigStepPrefix, bigStepHeight)) + } + key = append(key, stateRootsFileName) + return filepath.Join(baseDir, filepath.Join(key...)), nil +} diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go new file mode 100644 index 0000000000..3e433dbe41 --- /dev/null +++ b/staker/challenge-cache/cache_test.go @@ -0,0 +1,321 @@ +package challengecache + +import ( + "bytes" + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "strings" + "testing" + + protocol "github.com/OffchainLabs/bold/chain-abstraction" + "github.com/OffchainLabs/bold/containers/option" + "github.com/ethereum/go-ethereum/common" +) + +var _ HistoryCommitmentCacher = (*Cache)(nil) + +func TestCache(t *testing.T) { + basePath := t.TempDir() + if err := os.MkdirAll(basePath, os.ModePerm); err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + if err := os.RemoveAll(basePath); err != nil { + t.Fatal(err) + } + }) + cache := New(basePath) + key := &Key{ + WavmModuleRoot: common.BytesToHash([]byte("foo")), + MessageHeight: 0, + BigStepHeight: option.Some(protocol.Height(0)), + } + t.Run("Not found", func(t *testing.T) { + _, err := cache.Get(key, protocol.Height(0)) + if !errors.Is(err, ErrNotFoundInCache) { + t.Fatal(err) + } + }) + t.Run("Putting empty root fails", func(t *testing.T) { + if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { + t.Fatalf("Unexpected error: %v", err) + } + }) + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + err := cache.Put(key, want) + if err != nil { + t.Fatal(err) + } + got, err := cache.Get(key, protocol.Height(2)) + if err != nil { + t.Fatal(err) + } + if len(got) != len(want) { + t.Fatalf("Wrong number of roots. Expected %d, got %d", len(want), len(got)) + } + for i, rt := range got { + if rt != want[i] { + t.Fatalf("Wrong root. Expected %#x, got %#x", want[i], rt) + } + } +} + +func TestReadWriteStateRoots(t *testing.T) { + t.Run("read up to, but had empty reader", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + _, err := readStateRoots(b, protocol.Height(100)) + if err == nil { + t.Fatal("Wanted error") + } + if !strings.Contains(err.Error(), "only read 0 state roots") { + t.Fatal("Unexpected error") + } + }) + t.Run("read single root", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + want := common.BytesToHash([]byte("foo")) + b.Write(want.Bytes()) + roots, err := readStateRoots(b, protocol.Height(0)) + if err != nil { + t.Fatal(err) + } + if len(roots) == 0 { + t.Fatal("Got no roots") + } + if roots[0] != want { + t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) + } + }) + t.Run("Three roots exist, want to read only two", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + foo := common.BytesToHash([]byte("foo")) + bar := common.BytesToHash([]byte("bar")) + baz := common.BytesToHash([]byte("baz")) + b.Write(foo.Bytes()) + b.Write(bar.Bytes()) + b.Write(baz.Bytes()) + roots, err := readStateRoots(b, protocol.Height(1)) + if err != nil { + t.Fatal(err) + } + if len(roots) != 2 { + t.Fatalf("Expected two roots, got %d", len(roots)) + } + if roots[0] != foo { + t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) + } + if roots[1] != bar { + t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) + } + }) + t.Run("Fails to write enough data to writer", func(t *testing.T) { + m := &mockWriter{wantErr: true} + err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) + if err == nil { + t.Fatal("Wanted error") + } + m = &mockWriter{wantErr: false, numWritten: 16} + err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) + if err == nil { + t.Fatal("Wanted error") + } + if !strings.Contains(err.Error(), "expected to write 32 bytes") { + t.Fatalf("Got wrong error kind: %v", err) + } + }) +} + +type mockWriter struct { + wantErr bool + numWritten int +} + +func (m *mockWriter) Write(_ []byte) (n int, err error) { + if m.wantErr { + return 0, errors.New("something went wrong") + } + return m.numWritten, nil +} + +type mockReader struct { + wantErr bool + err error + roots []common.Hash + readIdx int + bytesRead int +} + +func (m *mockReader) Read(out []byte) (n int, err error) { + if m.wantErr { + return 0, m.err + } + if m.readIdx == len(m.roots) { + return 0, io.EOF + } + copy(out, m.roots[m.readIdx].Bytes()) + m.readIdx++ + return m.bytesRead, nil +} + +func Test_readStateRoots(t *testing.T) { + t.Run("Unexpected error", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: true, roots: want, err: errors.New("foo")} + _, err := readStateRoots(m, protocol.Height(1)) + if err == nil { + t.Fatal(err) + } + if !strings.Contains(err.Error(), "foo") { + t.Fatalf("Unexpected error: %v", err) + } + }) + t.Run("EOF, but did not read as much as was expected", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: true, roots: want, err: io.EOF} + _, err := readStateRoots(m, protocol.Height(100)) + if err == nil { + t.Fatal(err) + } + if !strings.Contains(err.Error(), "wanted to read up to 100, but only read 0 state roots") { + t.Fatalf("Unexpected error: %v", err) + } + }) + t.Run("Reads wrong number of bytes", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: false, roots: want, bytesRead: 16} + _, err := readStateRoots(m, protocol.Height(2)) + if err == nil { + t.Fatal(err) + } + if !strings.Contains(err.Error(), "expected to read 32 bytes, got 16") { + t.Fatalf("Unexpected error: %v", err) + } + }) + t.Run("Reads all until EOF", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: false, roots: want, bytesRead: 32} + got, err := readStateRoots(m, protocol.Height(2)) + if err != nil { + t.Fatal(err) + } + if len(want) != len(got) { + t.Fatal("Wrong number of roots") + } + for i, rt := range got { + if rt != want[i] { + t.Fatal("Wrong root") + } + } + }) +} + +func Test_determineFilePath(t *testing.T) { + type args struct { + baseDir string + key *Key + } + tests := []struct { + name string + args args + want string + wantErr bool + errContains string + }{ + { + name: "OK", + args: args{ + baseDir: "", + key: &Key{ + MessageHeight: 100, + BigStepHeight: option.Some(protocol.Height(50)), + }, + }, + want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := determineFilePath(tt.args.baseDir, tt.args.key) + if (err != nil) != tt.wantErr { + t.Logf("got: %v, and key %+v, got %s", err, tt.args.key, got) + if !strings.Contains(err.Error(), tt.errContains) { + t.Fatalf("Expected %s, got %s", tt.errContains, err.Error()) + } + t.Errorf("determineFilePath() error = %v, wantErr %v", err, tt.wantErr) + return + } + if got != tt.want { + t.Errorf( + "determineFilePath() = %v, want %v", + got, + tt.want, + ) + } + }) + } +} + +func BenchmarkCache_Read_32Mb(b *testing.B) { + b.StopTimer() + basePath, err := ioutil.TempDir("", "*") + if err != nil { + b.Fatal(err) + } + if err := os.MkdirAll(basePath, os.ModePerm); err != nil { + b.Fatal(err) + } + b.Cleanup(func() { + if err := os.RemoveAll(basePath); err != nil { + b.Fatal(err) + } + }) + cache := New(basePath) + key := &Key{ + WavmModuleRoot: common.BytesToHash([]byte("foo")), + MessageHeight: 0, + BigStepHeight: option.Some(protocol.Height(0)), + } + numRoots := 1 << 20 + roots := make([]common.Hash, numRoots) + for i := range roots { + roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) + } + if err = cache.Put(key, roots); err != nil { + b.Fatal(err) + } + b.StartTimer() + for i := 0; i < b.N; i++ { + readUpTo := protocol.Height(1 << 20) + roots, err := cache.Get(key, readUpTo) + if err != nil { + b.Fatal(err) + } + if len(roots) != numRoots { + b.Fatalf("Wrong number of roots. Expected %d, got %d", numRoots, len(roots)) + } + } +} diff --git a/staker/manager.go b/staker/manager.go new file mode 100644 index 0000000000..5c220ede5e --- /dev/null +++ b/staker/manager.go @@ -0,0 +1,81 @@ +package staker + +import ( + "context" + solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + challengemanager "github.com/OffchainLabs/bold/challenge-manager" + "github.com/OffchainLabs/bold/challenge-manager/types" + "github.com/OffchainLabs/bold/solgen/go/challengeV2gen" + "github.com/OffchainLabs/bold/solgen/go/rollupgen" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + + "github.com/offchainlabs/nitro/arbutil" +) + +func NewManager( + ctx context.Context, + rollupAddress common.Address, + txOpts *bind.TransactOpts, + callOpts bind.CallOpts, + client arbutil.L1Interface, + statelessBlockValidator *StatelessBlockValidator, + historyCacheBaseDir string, +) (*challengemanager.Manager, error) { + chain, err := solimpl.NewAssertionChain( + ctx, + rollupAddress, + txOpts, + client, + ) + if err != nil { + return nil, err + } + userLogic, err := rollupgen.NewRollupUserLogic( + rollupAddress, client, + ) + if err != nil { + return nil, err + } + challengeManagerAddr, err := userLogic.RollupUserLogicCaller.ChallengeManager( + &bind.CallOpts{Context: ctx}, + ) + if err != nil { + return nil, err + } + managerBinding, err := challengeV2gen.NewEdgeChallengeManager(challengeManagerAddr, client) + if err != nil { + return nil, err + } + bigStepEdgeHeight, err := managerBinding.LAYERZEROBIGSTEPEDGEHEIGHT(&callOpts) + if err != nil { + return nil, err + } + smallStepEdgeHeight, err := managerBinding.LAYERZEROSMALLSTEPEDGEHEIGHT(&callOpts) + if err != nil { + return nil, err + } + stateManager, err := NewStateManager( + statelessBlockValidator, + nil, + smallStepEdgeHeight.Uint64(), + bigStepEdgeHeight.Uint64()*smallStepEdgeHeight.Uint64(), + historyCacheBaseDir, + ) + if err != nil { + return nil, err + } + manager, err := challengemanager.New( + ctx, + chain, + client, + stateManager, + rollupAddress, + challengemanager.WithMode(types.MakeMode), + ) + if err != nil { + return nil, err + } + return manager, nil +} diff --git a/staker/state_provider.go b/staker/state_provider.go new file mode 100644 index 0000000000..3d3eb43390 --- /dev/null +++ b/staker/state_provider.go @@ -0,0 +1,666 @@ +package staker + +import ( + "context" + "errors" + "fmt" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + + protocol "github.com/OffchainLabs/bold/chain-abstraction" + "github.com/OffchainLabs/bold/containers/option" + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/solgen/go/rollupgen" + commitments "github.com/OffchainLabs/bold/state-commitments/history" + prefixproofs "github.com/OffchainLabs/bold/state-commitments/prefix-proofs" + + "github.com/offchainlabs/nitro/arbutil" + challengecache "github.com/offchainlabs/nitro/staker/challenge-cache" + "github.com/offchainlabs/nitro/validator" +) + +var _ l2stateprovider.Provider = (*StateManager)(nil) + +// Defines the ABI encoding structure for submission of prefix proofs to the protocol contracts +var ( + b32Arr, _ = abi.NewType("bytes32[]", "", nil) + // ProofArgs for submission to the protocol. + ProofArgs = abi.Arguments{ + {Type: b32Arr, Name: "prefixExpansion"}, + {Type: b32Arr, Name: "prefixProof"}, + } +) + +var ErrChainCatchingUp = errors.New("chain catching up") + +type StateManager struct { + validator *StatelessBlockValidator + blockValidator *BlockValidator + numOpcodesPerBigStep uint64 + maxWavmOpcodes uint64 + historyCache challengecache.HistoryCommitmentCacher +} + +func NewStateManager(val *StatelessBlockValidator, blockValidator *BlockValidator, numOpcodesPerBigStep uint64, maxWavmOpcodes uint64, cacheBaseDir string) (*StateManager, error) { + historyCache := challengecache.New(cacheBaseDir) + return &StateManager{ + validator: val, + blockValidator: blockValidator, + numOpcodesPerBigStep: numOpcodesPerBigStep, + maxWavmOpcodes: maxWavmOpcodes, + historyCache: historyCache, + }, nil +} + +// ExecutionStateMsgCount If the state manager locally has this validated execution state. +// Returns ErrNoExecutionState if not found, or ErrChainCatchingUp if not yet +// validated / syncing. +func (s *StateManager) ExecutionStateMsgCount(ctx context.Context, state *protocol.ExecutionState) (uint64, error) { + if state.GlobalState.PosInBatch != 0 { + return 0, fmt.Errorf("position in batch must be zero, but got %d", state.GlobalState.PosInBatch) + } + if state.GlobalState.Batch == 1 && state.GlobalState.PosInBatch == 0 { + // TODO: 1 is correct? + return 1, nil + } + batch := state.GlobalState.Batch - 1 + messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) + if err != nil { + return 0, err + } + validatedExecutionState, err := s.executionStateAtMessageNumberImpl(ctx, uint64(messageCount)-1) + if err != nil { + return 0, err + } + if validatedExecutionState.GlobalState.Batch < batch { + return 0, ErrChainCatchingUp + } + res, err := s.validator.streamer.ResultAtCount(messageCount) + if err != nil { + return 0, err + } + if res.BlockHash != state.GlobalState.BlockHash || res.SendRoot != state.GlobalState.SendRoot { + return 0, l2stateprovider.ErrNoExecutionState + } + return uint64(messageCount), nil +} + +// ExecutionStateAtMessageNumber Produces the l2 state to assert at the message number specified. +// Makes sure that PosInBatch is always 0 +func (s *StateManager) ExecutionStateAtMessageNumber(ctx context.Context, messageNumber uint64) (*protocol.ExecutionState, error) { + executionState, err := s.executionStateAtMessageNumberImpl(ctx, messageNumber) + if err != nil { + return nil, err + } + if executionState.GlobalState.PosInBatch != 0 { + executionState.GlobalState.Batch++ + executionState.GlobalState.PosInBatch = 0 + } + return executionState, nil +} + +func (s *StateManager) executionStateAtMessageNumberImpl(ctx context.Context, messageNumber uint64) (*protocol.ExecutionState, error) { + batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(messageNumber)) + if err != nil { + return &protocol.ExecutionState{}, err + } + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) + if err != nil { + return &protocol.ExecutionState{}, err + } + if batchMsgCount <= arbutil.MessageIndex(messageNumber) { + batch++ + } + globalState, err := s.getInfoAtMessageCountAndBatch(arbutil.MessageIndex(messageNumber), batch) + if err != nil { + return &protocol.ExecutionState{}, err + } + return &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState(globalState), + MachineStatus: protocol.MachineStatusFinished, // TODO: Why hardcode? + }, nil +} + +// HistoryCommitmentAtMessage Produces a block history commitment of messageCount. +func (s *StateManager) HistoryCommitmentAtMessage(ctx context.Context, messageNumber uint64) (commitments.History, error) { + batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(messageNumber)) + if err != nil { + return commitments.History{}, err + } + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(messageNumber) + if err != nil { + return commitments.History{}, err + } + if batchMsgCount <= arbutil.MessageIndex(messageNumber) { + batch++ + } + stateRoot, err := s.getHashAtMessageCountAndBatch(ctx, arbutil.MessageIndex(messageNumber), batch) + if err != nil { + return commitments.History{}, err + } + return commitments.New([]common.Hash{stateRoot}) +} + +func (s *StateManager) HistoryCommitmentAtBatch(ctx context.Context, batchNumber uint64) (commitments.History, error) { + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchNumber) + if err != nil { + return commitments.History{}, err + } + res, err := s.validator.streamer.ResultAtCount(batchMsgCount - 1) + if err != nil { + return commitments.History{}, err + } + state := validator.GoGlobalState{ + BlockHash: res.BlockHash, + SendRoot: res.SendRoot, + Batch: batchNumber, + PosInBatch: 0, + } + machineHash := crypto.Keccak256Hash([]byte("Machine finished:"), state.Hash().Bytes()) + return commitments.New([]common.Hash{machineHash}) +} + +// BigStepCommitmentUpTo Produces a big step history commitment from big step 0 to toBigStep within block +// challenge heights blockHeight and blockHeight+1. +func (s *StateManager) BigStepCommitmentUpTo(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, toBigStep uint64) (commitments.History, error) { + result, err := s.intermediateBigStepLeaves(ctx, wasmModuleRoot, messageNumber, toBigStep) + if err != nil { + return commitments.History{}, err + } + return commitments.New(result) +} + +// SmallStepCommitmentUpTo Produces a small step history commitment from small step 0 to N between +// big steps bigStep to bigStep+1 within block challenge heights blockHeight to blockHeight+1. +func (s *StateManager) SmallStepCommitmentUpTo(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, bigStep uint64, toSmallStep uint64) (commitments.History, error) { + result, err := s.intermediateSmallStepLeaves(ctx, wasmModuleRoot, messageNumber, bigStep, toSmallStep) + if err != nil { + return commitments.History{}, err + } + return commitments.New(result) +} + +// HistoryCommitmentUpToBatch Produces a block challenge history commitment in a certain inclusive block range, +// but padding states with duplicates after the first state with a batch count of at least the specified max. +func (s *StateManager) HistoryCommitmentUpToBatch(ctx context.Context, messageNumberStart uint64, messageNumberEnd uint64, nextBatchCount uint64) (commitments.History, error) { + stateRoots, err := s.statesUpTo(messageNumberStart, messageNumberEnd, nextBatchCount) + if err != nil { + return commitments.History{}, err + } + return commitments.New(stateRoots) +} + +// BigStepLeafCommitment Produces a big step history commitment for all big steps within block +// challenge heights blockHeight to blockHeight+1. +func (s *StateManager) BigStepLeafCommitment(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64) (commitments.History, error) { + // Number of big steps between assertion heights A and B will be + // fixed. It is simply the max number of opcodes + // per block divided by the size of a big step. + numBigSteps := s.maxWavmOpcodes / s.numOpcodesPerBigStep + return s.BigStepCommitmentUpTo(ctx, wasmModuleRoot, messageNumber, numBigSteps) +} + +// SmallStepLeafCommitment Produces a small step history commitment for all small steps between +// big steps bigStep to bigStep+1 within block challenge heights blockHeight to blockHeight+1. +func (s *StateManager) SmallStepLeafCommitment(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, bigStep uint64) (commitments.History, error) { + return s.SmallStepCommitmentUpTo( + ctx, + wasmModuleRoot, + messageNumber, + bigStep, + s.numOpcodesPerBigStep, + ) +} + +// PrefixProofUpToBatch Produces a prefix proof in a block challenge from height A to B, +// but padding states with duplicates after the first state with a batch count of at least the specified max. +func (s *StateManager) PrefixProofUpToBatch( + ctx context.Context, + startHeight, + fromMessageNumber, + toMessageNumber, + batchCount uint64, +) ([]byte, error) { + if toMessageNumber > batchCount { + return nil, errors.New("toMessageNumber should not be greater than batchCount") + } + states, err := s.statesUpTo(startHeight, toMessageNumber, batchCount) + if err != nil { + return nil, err + } + loSize := fromMessageNumber + 1 - startHeight + hiSize := toMessageNumber + 1 - startHeight + return s.getPrefixProof(loSize, hiSize, states) +} + +// BigStepPrefixProof Produces a big step prefix proof from height A to B for heights fromBlockChallengeHeight to H+1 +// within a block challenge. +func (s *StateManager) BigStepPrefixProof( + ctx context.Context, + wasmModuleRoot common.Hash, + messageNumber uint64, + fromBigStep uint64, + toBigStep uint64, +) ([]byte, error) { + prefixLeaves, err := s.intermediateBigStepLeaves(ctx, wasmModuleRoot, messageNumber, toBigStep) + if err != nil { + return nil, err + } + loSize := fromBigStep + 1 + hiSize := toBigStep + 1 + return s.getPrefixProof(loSize, hiSize, prefixLeaves) +} + +// SmallStepPrefixProof Produces a small step prefix proof from height A to B for big step S to S+1 and +// block challenge height heights H to H+1. +func (s *StateManager) SmallStepPrefixProof(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, bigStep uint64, fromSmallStep uint64, toSmallStep uint64) ([]byte, error) { + prefixLeaves, err := s.intermediateSmallStepLeaves(ctx, wasmModuleRoot, messageNumber, bigStep, toSmallStep) + if err != nil { + return nil, err + } + loSize := fromSmallStep + 1 + hiSize := toSmallStep + 1 + return s.getPrefixProof(loSize, hiSize, prefixLeaves) +} + +// Like abi.NewType but panics if it fails for use in constants +func newStaticType(t string, internalType string, components []abi.ArgumentMarshaling) abi.Type { + ty, err := abi.NewType(t, internalType, components) + if err != nil { + panic(err) + } + return ty +} + +var bytes32Type = newStaticType("bytes32", "", nil) +var uint64Type = newStaticType("uint64", "", nil) +var uint8Type = newStaticType("uint8", "", nil) + +var WasmModuleProofAbi = abi.Arguments{ + { + Name: "lastHash", + Type: bytes32Type, + }, + { + Name: "assertionExecHash", + Type: bytes32Type, + }, + { + Name: "inboxAcc", + Type: bytes32Type, + }, +} + +var ExecutionStateAbi = abi.Arguments{ + { + Name: "b1", + Type: bytes32Type, + }, + { + Name: "b2", + Type: bytes32Type, + }, + { + Name: "u1", + Type: uint64Type, + }, + { + Name: "u2", + Type: uint64Type, + }, + { + Name: "status", + Type: uint8Type, + }, +} + +func (s *StateManager) OneStepProofData( + ctx context.Context, + wasmModuleRoot common.Hash, + postState rollupgen.ExecutionState, + messageNumber, + bigStep, + smallStep uint64, +) (*protocol.OneStepData, []common.Hash, []common.Hash, error) { + endCommit, err := s.SmallStepCommitmentUpTo( + ctx, + wasmModuleRoot, + messageNumber, + bigStep, + smallStep+1, + ) + if err != nil { + return nil, nil, nil, err + } + startCommit, err := s.SmallStepCommitmentUpTo( + ctx, + wasmModuleRoot, + messageNumber, + bigStep, + smallStep, + ) + if err != nil { + return nil, nil, nil, err + } + + step := bigStep*s.numOpcodesPerBigStep + smallStep + + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(messageNumber)) + if err != nil { + return nil, nil, nil, err + } + input, err := entry.ToInput() + if err != nil { + return nil, nil, nil, err + } + execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + if err != nil { + return nil, nil, nil, err + } + + oneStepProofPromise := execRun.GetProofAt(step) + oneStepProof, err := oneStepProofPromise.Await(ctx) + if err != nil { + return nil, nil, nil, err + } + + machineStepPromise := execRun.GetStepAt(step) + machineStep, err := machineStepPromise.Await(ctx) + if err != nil { + return nil, nil, nil, err + } + beforeHash := machineStep.Hash + if beforeHash != startCommit.LastLeaf { + return nil, nil, nil, fmt.Errorf("machine executed to start step %v hash %v but expected %v", step, beforeHash, startCommit.LastLeaf) + } + + machineStepPromise = execRun.GetStepAt(step + 1) + machineStep, err = machineStepPromise.Await(ctx) + if err != nil { + return nil, nil, nil, err + } + afterHash := machineStep.Hash + if afterHash != endCommit.LastLeaf { + return nil, nil, nil, fmt.Errorf("machine executed to end step %v hash %v but expected %v", step+1, beforeHash, endCommit.LastLeaf) + } + + data := &protocol.OneStepData{ + BeforeHash: startCommit.LastLeaf, + Proof: oneStepProof, + } + return data, startCommit.LastLeafProof, endCommit.LastLeafProof, nil +} + +func (s *StateManager) AgreesWithHistoryCommitment( + ctx context.Context, + wasmModuleRoot common.Hash, + assertionInboxMaxCount uint64, + parentAssertionAfterStateBatch uint64, + edgeType protocol.EdgeType, + heights protocol.OriginHeights, + history l2stateprovider.History, +) (bool, error) { + var localCommit commitments.History + var err error + switch edgeType { + case protocol.BlockChallengeEdge: + localCommit, err = s.HistoryCommitmentUpToBatch(ctx, parentAssertionAfterStateBatch, parentAssertionAfterStateBatch+history.Height, assertionInboxMaxCount) + if err != nil { + return false, err + } + case protocol.BigStepChallengeEdge: + localCommit, err = s.BigStepCommitmentUpTo( + ctx, + wasmModuleRoot, + uint64(heights.BlockChallengeOriginHeight), + history.Height, + ) + if err != nil { + return false, err + } + case protocol.SmallStepChallengeEdge: + localCommit, err = s.SmallStepCommitmentUpTo( + ctx, + wasmModuleRoot, + uint64(heights.BlockChallengeOriginHeight), + uint64(heights.BigStepChallengeOriginHeight), + history.Height, + ) + if err != nil { + return false, err + } + default: + return false, errors.New("unsupported edge type") + } + return localCommit.Height == history.Height && localCommit.Merkle == history.MerkleRoot, nil +} + +func (s *StateManager) getPrefixProof(loSize uint64, hiSize uint64, leaves []common.Hash) ([]byte, error) { + prefixExpansion, err := prefixproofs.ExpansionFromLeaves(leaves[:loSize]) + if err != nil { + return nil, err + } + prefixProof, err := prefixproofs.GeneratePrefixProof( + loSize, + prefixExpansion, + leaves[loSize:hiSize], + prefixproofs.RootFetcherFromExpansion, + ) + if err != nil { + return nil, err + } + _, numRead := prefixproofs.MerkleExpansionFromCompact(prefixProof, loSize) + onlyProof := prefixProof[numRead:] + return ProofArgs.Pack(&prefixExpansion, &onlyProof) +} + +func (s *StateManager) intermediateBigStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, toBigStep uint64) ([]common.Hash, error) { + cacheKey := &challengecache.Key{ + WavmModuleRoot: wasmModuleRoot, + MessageHeight: protocol.Height(blockHeight), + BigStepHeight: option.None[protocol.Height](), + } + cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toBigStep)) + if err == nil { + return cachedRoots, nil + } + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) + if err != nil { + return nil, err + } + input, err := entry.ToInput() + if err != nil { + return nil, err + } + execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + if err != nil { + return nil, err + } + bigStepLeaves := execRun.GetBigStepLeavesUpTo(toBigStep, s.numOpcodesPerBigStep) + result, err := bigStepLeaves.Await(ctx) + if err != nil { + return nil, err + } + // TODO: Hacky workaround to avoid saving a history commitment to height 0. + if len(result) > 1 { + if err := s.historyCache.Put(cacheKey, result); err != nil { + if !errors.Is(err, challengecache.ErrFileAlreadyExists) { + return nil, err + } + } + } + return result, nil +} + +func (s *StateManager) intermediateSmallStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, bigStep uint64, toSmallStep uint64) ([]common.Hash, error) { + cacheKey := &challengecache.Key{ + WavmModuleRoot: wasmModuleRoot, + MessageHeight: protocol.Height(blockHeight), + BigStepHeight: option.Some[protocol.Height](protocol.Height(bigStep)), + } + cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toSmallStep)) + if err == nil { + return cachedRoots, nil + } + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) + if err != nil { + return nil, err + } + input, err := entry.ToInput() + if err != nil { + return nil, err + } + execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + if err != nil { + return nil, err + } + smallStepLeaves := execRun.GetSmallStepLeavesUpTo(bigStep, toSmallStep, s.numOpcodesPerBigStep) + result, err := smallStepLeaves.Await(ctx) + if err != nil { + return nil, err + } + // TODO: Hacky workaround to avoid saving a history commitment to height 0. + if len(result) > 1 { + if err := s.historyCache.Put(cacheKey, result); err != nil { + if !errors.Is(err, challengecache.ErrFileAlreadyExists) { + return nil, err + } + } + } + return result, nil +} + +// TODO: Rename block to message. +func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchCount uint64) ([]common.Hash, error) { + if blockEnd < blockStart { + return nil, fmt.Errorf("end block %v is less than start block %v", blockEnd, blockStart) + } + batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(blockStart)) + if err != nil { + return nil, err + } + // TODO: Document why we cannot validate genesis. + if batch == 0 { + batch += 1 + } + // The size is the number of elements being committed to. For example, if the height is 7, there will + // be 8 elements being committed to from [0, 7] inclusive. + desiredStatesLen := int(blockEnd - blockStart + 1) + var stateRoots []common.Hash + var lastStateRoot common.Hash + + // TODO: Document why we cannot validate genesis. + if blockStart == 0 { + blockStart += 1 + } + for i := blockStart; i <= blockEnd; i++ { + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) + if err != nil { + return nil, err + } + if batchMsgCount <= arbutil.MessageIndex(i) { + batch++ + } + gs, err := s.getInfoAtMessageCountAndBatch(arbutil.MessageIndex(i), batch) + if err != nil { + return nil, err + } + if gs.Batch >= nextBatchCount { + if gs.Batch > nextBatchCount || gs.PosInBatch > 0 { + return nil, fmt.Errorf("overran next batch count %v with global state batch %v position %v", nextBatchCount, gs.Batch, gs.PosInBatch) + } + break + } + stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) + stateRoots = append(stateRoots, stateRoot) + lastStateRoot = stateRoot + } + for len(stateRoots) < desiredStatesLen { + stateRoots = append(stateRoots, lastStateRoot) + } + return stateRoots, nil +} + +func (s *StateManager) findBatchAfterMessageCount(msgCount arbutil.MessageIndex) (uint64, error) { + if msgCount == 0 { + return 0, nil + } + low := uint64(0) + batchCount, err := s.validator.inboxTracker.GetBatchCount() + if err != nil { + return 0, err + } + high := batchCount + for { + // Binary search invariants: + // - messageCount(high) >= msgCount + // - messageCount(low-1) < msgCount + // - high >= low + if high < low { + return 0, fmt.Errorf("when attempting to find batch for message count %v high %v < low %v", msgCount, high, low) + } + mid := (low + high) / 2 + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(mid) + if err != nil { + // TODO: There is a circular dep with the error in inbox_tracker.go, we + // should move it somewhere else and use errors.Is. + if strings.Contains(err.Error(), "accumulator not found") { + high = mid + } else { + return 0, fmt.Errorf("failed to get batch metadata while binary searching: %w", err) + } + } + if batchMsgCount < msgCount { + low = mid + 1 + } else if batchMsgCount == msgCount { + return mid + 1, nil + } else if mid == low { // batchMsgCount > msgCount + return mid, nil + } else { // batchMsgCount > msgCount + high = mid + } + } +} + +func (s *StateManager) getHashAtMessageCountAndBatch(_ context.Context, messageCount arbutil.MessageIndex, batch uint64) (common.Hash, error) { + gs, err := s.getInfoAtMessageCountAndBatch(messageCount, batch) + if err != nil { + return common.Hash{}, err + } + return crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), nil +} + +func (s *StateManager) getInfoAtMessageCountAndBatch(messageCount arbutil.MessageIndex, batch uint64) (validator.GoGlobalState, error) { + globalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, batch) + if err != nil { + return validator.GoGlobalState{}, err + } + return globalState, nil +} + +func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batch uint64) (validator.GoGlobalState, error) { + var prevBatchMsgCount arbutil.MessageIndex + var err error + if batch > 0 { + prevBatchMsgCount, err = s.validator.inboxTracker.GetBatchMessageCount(batch - 1) + if err != nil { + return validator.GoGlobalState{}, err + } + if prevBatchMsgCount > count { + return validator.GoGlobalState{}, errors.New("bad batch provided") + } + } + res, err := s.validator.streamer.ResultAtCount(count) + if err != nil { + return validator.GoGlobalState{}, err + } + return validator.GoGlobalState{ + BlockHash: res.BlockHash, + SendRoot: res.SendRoot, + Batch: batch, + PosInBatch: uint64(count - prevBatchMsgCount), + }, nil +} diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go new file mode 100644 index 0000000000..fd6b417529 --- /dev/null +++ b/system_tests/manager_test.go @@ -0,0 +1,408 @@ +package arbtest + +import ( + "context" + "github.com/offchainlabs/nitro/util/testhelpers" + "math/big" + "reflect" + "strings" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + + "github.com/offchainlabs/nitro/arbnode" + "github.com/offchainlabs/nitro/arbos/l2pricing" + "github.com/offchainlabs/nitro/staker" + "github.com/offchainlabs/nitro/util" + "github.com/offchainlabs/nitro/validator" + "github.com/offchainlabs/nitro/validator/valnode" + + protocol "github.com/OffchainLabs/bold/chain-abstraction" + commitments "github.com/OffchainLabs/bold/state-commitments/history" + prefixproofs "github.com/OffchainLabs/bold/state-commitments/prefix-proofs" +) + +const numOpcodesPerBigStepTest = uint64(4) +const maxWavmOpcodesTest = uint64(20) + +func TestExecutionStateMsgCount(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + res, err := l2node.TxStreamer.ResultAtCount(1) + Require(t, err) + msgCount, err := manager.ExecutionStateMsgCount(ctx, &protocol.ExecutionState{GlobalState: protocol.GoGlobalState{Batch: 1, BlockHash: res.BlockHash}}) + Require(t, err) + if msgCount != 1 { + Fail(t, "Unexpected msg batch", msgCount, "(expected 1)") + } +} + +func TestExecutionStateAtMessageNumber(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + res, err := l2node.TxStreamer.ResultAtCount(1) + Require(t, err) + expectedState := &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState{ + Batch: 1, + BlockHash: res.BlockHash, + }, + MachineStatus: protocol.MachineStatusFinished, + } + executionState, err := manager.ExecutionStateAtMessageNumber(ctx, 1) + Require(t, err) + if !reflect.DeepEqual(executionState, expectedState) { + Fail(t, "Unexpected executionState", executionState, "(expected ", expectedState, ")") + } + Require(t, err) +} + +func TestHistoryCommitmentUpTo(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + res1, err := l2node.TxStreamer.ResultAtCount(1) + Require(t, err) + expectedHistoryCommitment, err := commitments.New( + []common.Hash{ + crypto.Keccak256Hash( + []byte("Machine finished:"), + validator.GoGlobalState{ + BlockHash: res1.BlockHash, + SendRoot: res1.SendRoot, + Batch: 1, + PosInBatch: 0, + }.Hash().Bytes(), + ), + }, + ) + Require(t, err) + historyCommitment, err := manager.HistoryCommitmentAtMessage(ctx, 1) + Require(t, err) + if !reflect.DeepEqual(historyCommitment, expectedHistoryCommitment) { + Fail(t, "Unexpected HistoryCommitment", historyCommitment, "(expected ", expectedHistoryCommitment, ")") + } +} + +func TestBigStepCommitmentUpTo(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + commitment, err := manager.BigStepCommitmentUpTo(ctx, common.Hash{}, 1, 3) + Require(t, err) + if commitment.Height != 3 { + Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", 3, ")") + } +} + +func TestSmallStepCommitmentUpTo(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + commitment, err := manager.SmallStepCommitmentUpTo(ctx, common.Hash{}, 1, 3, 2) + Require(t, err) + if commitment.Height != 2 { + Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", 2, ")") + } +} + +func TestHistoryCommitmentUpToBatch(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + res1, err := l2node.TxStreamer.ResultAtCount(1) + Require(t, err) + expectedHistoryCommitment, err := commitments.New( + []common.Hash{ + crypto.Keccak256Hash( + []byte("Machine finished:"), + validator.GoGlobalState{ + BlockHash: res1.BlockHash, + SendRoot: res1.SendRoot, + Batch: 1, + PosInBatch: 0, + }.Hash().Bytes(), + ), + crypto.Keccak256Hash( + []byte("Machine finished:"), + validator.GoGlobalState{ + BlockHash: res1.BlockHash, + SendRoot: res1.SendRoot, + Batch: 1, + PosInBatch: 0, + }.Hash().Bytes(), + ), + }, + ) + Require(t, err) + historyCommitment, err := manager.HistoryCommitmentUpToBatch(ctx, 1, 2, 2) + Require(t, err) + if !reflect.DeepEqual(historyCommitment, expectedHistoryCommitment) { + Fail(t, "Unexpected HistoryCommitment", historyCommitment, "(expected ", expectedHistoryCommitment, ")") + } +} + +func TestBigStepLeafCommitment(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + commitment, err := manager.BigStepLeafCommitment(ctx, common.Hash{}, 1) + Require(t, err) + numBigSteps := maxWavmOpcodesTest / numOpcodesPerBigStepTest + if commitment.Height != numBigSteps { + Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", numBigSteps, ")") + } +} + +func TestSmallStepLeafCommitment(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + commitment, err := manager.SmallStepLeafCommitment(ctx, common.Hash{}, 1, 3) + Require(t, err) + if commitment.Height != numOpcodesPerBigStepTest { + Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", numOpcodesPerBigStepTest, ")") + } +} + +func TestAllPrefixProofs(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + + from := uint64(1) + to := uint64(3) + + loCommit, err := manager.HistoryCommitmentUpToBatch(ctx, 1, from, 10) + Require(t, err) + hiCommit, err := manager.HistoryCommitmentUpToBatch(ctx, 1, to, 10) + Require(t, err) + packedProof, err := manager.PrefixProofUpToBatch(ctx, 1, from, to, 10) + Require(t, err) + + data, err := staker.ProofArgs.Unpack(packedProof) + Require(t, err) + preExpansion, ok := data[0].([][32]byte) + if !ok { + Fatal(t, "bad output from packedProof") + } + proof, ok := data[1].([][32]byte) + if !ok { + Fatal(t, "bad output from packedProof") + } + + preExpansionHashes := make([]common.Hash, len(preExpansion)) + for i := 0; i < len(preExpansion); i++ { + preExpansionHashes[i] = preExpansion[i] + } + prefixProof := make([]common.Hash, len(proof)) + for i := 0; i < len(proof); i++ { + prefixProof[i] = proof[i] + } + + err = prefixproofs.VerifyPrefixProof(&prefixproofs.VerifyPrefixProofConfig{ + PreRoot: loCommit.Merkle, + PreSize: from, + PostRoot: hiCommit.Merkle, + PostSize: to, + PreExpansion: preExpansionHashes, + PrefixProof: prefixProof, + }) + Require(t, err) + + bigFrom := uint64(1) + + bigCommit, err := manager.BigStepLeafCommitment(ctx, common.Hash{}, from) + Require(t, err) + + bigBisectCommit, err := manager.BigStepCommitmentUpTo(ctx, common.Hash{}, from, bigFrom) + Require(t, err) + if bigFrom != bigBisectCommit.Height { + Fail(t, "Unexpected bigBisectCommit Height", bigBisectCommit.Height, "(expected ", bigFrom, ")") + } + if bigCommit.FirstLeaf != bigBisectCommit.FirstLeaf { + Fail(t, "Unexpected bigBisectCommit FirstLeaf", bigBisectCommit.FirstLeaf, "(expected ", bigCommit.FirstLeaf, ")") + } + + bigProof, err := manager.BigStepPrefixProof(ctx, common.Hash{}, from, bigFrom, bigCommit.Height) + Require(t, err) + + data, err = staker.ProofArgs.Unpack(bigProof) + Require(t, err) + preExpansion, ok = data[0].([][32]byte) + if !ok { + Fatal(t, "bad output from packedProof") + } + proof, ok = data[1].([][32]byte) + if !ok { + Fatal(t, "bad output from packedProof") + } + + preExpansionHashes = make([]common.Hash, len(preExpansion)) + for i := 0; i < len(preExpansion); i++ { + preExpansionHashes[i] = preExpansion[i] + } + prefixProof = make([]common.Hash, len(proof)) + for i := 0; i < len(proof); i++ { + prefixProof[i] = proof[i] + } + + computed, err := prefixproofs.Root(preExpansionHashes) + Require(t, err) + if bigBisectCommit.Merkle != computed { + Fail(t, "Unexpected bigBisectCommit Merkle", bigBisectCommit.Merkle, "(expected ", computed, ")") + } + + err = prefixproofs.VerifyPrefixProof(&prefixproofs.VerifyPrefixProofConfig{ + PreRoot: bigBisectCommit.Merkle, + PreSize: bigFrom + 1, + PostRoot: bigCommit.Merkle, + PostSize: bigCommit.Height + 1, + PreExpansion: preExpansionHashes, + PrefixProof: prefixProof, + }) + Require(t, err) + + smallCommit, err := manager.SmallStepLeafCommitment(ctx, common.Hash{}, from, bigFrom) + Require(t, err) + + smallFrom := uint64(2) + + smallBisectCommit, err := manager.SmallStepCommitmentUpTo(ctx, common.Hash{}, from, bigFrom, smallFrom) + Require(t, err) + if smallBisectCommit.Height != smallFrom { + Fail(t, "Unexpected smallBisectCommit Height", smallBisectCommit.Height, "(expected ", smallFrom, ")") + } + if smallBisectCommit.FirstLeaf != smallCommit.FirstLeaf { + Fail(t, "Unexpected smallBisectCommit FirstLeaf", smallBisectCommit.FirstLeaf, "(expected ", smallCommit.FirstLeaf, ")") + } + + smallProof, err := manager.SmallStepPrefixProof(ctx, common.Hash{}, from, bigFrom, smallFrom, smallCommit.Height) + Require(t, err) + + data, err = staker.ProofArgs.Unpack(smallProof) + Require(t, err) + preExpansion, ok = data[0].([][32]byte) + if !ok { + Fatal(t, "bad output from packedProof") + } + proof, ok = data[1].([][32]byte) + if !ok { + Fatal(t, "bad output from packedProof") + } + + preExpansionHashes = make([]common.Hash, len(preExpansion)) + for i := 0; i < len(preExpansion); i++ { + preExpansionHashes[i] = preExpansion[i] + } + prefixProof = make([]common.Hash, len(proof)) + for i := 0; i < len(proof); i++ { + prefixProof[i] = proof[i] + } + + computed, err = prefixproofs.Root(preExpansionHashes) + Require(t, err) + if smallBisectCommit.Merkle != computed { + Fail(t, "Unexpected smallBisectCommit Merkle", smallBisectCommit.Merkle, "(expected ", computed, ")") + } + + err = prefixproofs.VerifyPrefixProof(&prefixproofs.VerifyPrefixProofConfig{ + PreRoot: smallBisectCommit.Merkle, + PreSize: smallFrom + 1, + PostRoot: smallCommit.Merkle, + PostSize: smallCommit.Height + 1, + PreExpansion: preExpansionHashes, + PrefixProof: prefixProof, + }) + Require(t, err) +} + +func TestPrefixProofUpToBatchInvalidBatchCount(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + l2node, l1stack, manager := setupManger(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + + _, err := manager.PrefixProofUpToBatch(ctx, 0, 0, 2, 1) + if err == nil || !strings.Contains(err.Error(), "toMessageNumber should not be greater than batchCount") { + Fail(t, "batch count", 1, "less than toMessageNumber", 2, "should not be allowed") + } +} +func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, *staker.StateManager) { + var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs + l2chainConfig := params.ArbitrumDevTestChainConfig() + l2info := NewBlockChainTestInfo( + t, + types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), + transferGas, + ) + _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, nil, l2chainConfig, nil, l2info) + execNode := getExecNode(t, l2node) + BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) + l2info.GenerateAccount("BackgroundUser") + balance := big.NewInt(params.Ether) + balance.Mul(balance, big.NewInt(100)) + tx := l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, balance, nil) + err := l2client.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l2client, tx) + Require(t, err) + + for i := uint64(0); i < 10; i++ { + l2info.Accounts["BackgroundUser"].Nonce = i + tx = l2info.PrepareTx("BackgroundUser", "BackgroundUser", l2info.TransferGas, common.Big0, nil) + err = l2client.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l2client, tx) + Require(t, err) + } + + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + stateless, err := staker.NewStatelessBlockValidator( + l2node.InboxReader, + l2node.InboxTracker, + l2node.TxStreamer, + execNode, + l2node.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = stateless.Start(ctx) + Require(t, err) + manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir()) + Require(t, err) + return l2node, l1stack, manager +} + +func Fail(t *testing.T, printables ...interface{}) { + t.Helper() + testhelpers.FailImpl(t, printables...) +} diff --git a/system_tests/validation_mock_test.go b/system_tests/validation_mock_test.go index bfa2d67839..bceea0fd1c 100644 --- a/system_tests/validation_mock_test.go +++ b/system_tests/validation_mock_test.go @@ -115,6 +115,16 @@ func (r *mockExecRun) GetStepAt(position uint64) containers.PromiseInterface[*va }, nil) } +func (r *mockExecRun) GetBigStepLeavesUpTo(toBigStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { + // TODO: Add mock implementation for GetBigStepLeavesUpTo + return containers.NewReadyPromise[[]common.Hash](nil, nil) +} + +func (r *mockExecRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { + // TODO: Add mock implementation for GetSmallStepLeavesUpTo + return containers.NewReadyPromise[[]common.Hash](nil, nil) +} + func (r *mockExecRun) GetLastStep() containers.PromiseInterface[*validator.MachineStepResult] { return r.GetStepAt(mockExecLastPos) } diff --git a/validator/interface.go b/validator/interface.go index 5785ac4de1..385604e9d0 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -4,6 +4,7 @@ import ( "context" "github.com/ethereum/go-ethereum/common" + "github.com/offchainlabs/nitro/util/containers" ) @@ -29,6 +30,8 @@ type ExecutionSpawner interface { type ExecutionRun interface { GetStepAt(uint64) containers.PromiseInterface[*MachineStepResult] + GetBigStepLeavesUpTo(uint64, uint64) containers.PromiseInterface[[]common.Hash] + GetSmallStepLeavesUpTo(uint64, uint64, uint64) containers.PromiseInterface[[]common.Hash] GetLastStep() containers.PromiseInterface[*MachineStepResult] GetProofAt(uint64) containers.PromiseInterface[[]byte] PrepareRange(uint64, uint64) containers.PromiseInterface[struct{}] diff --git a/validator/server_api/valiation_api.go b/validator/server_api/valiation_api.go index 9e5191ec81..31018ef281 100644 --- a/validator/server_api/valiation_api.go +++ b/validator/server_api/valiation_api.go @@ -142,6 +142,32 @@ func (a *ExecServerAPI) GetStepAt(ctx context.Context, execid uint64, position u return MachineStepResultToJson(res), nil } +func (a *ExecServerAPI) GetBigStepLeavesUpTo(ctx context.Context, execid uint64, toBigStep uint64, numOpcodesPerBigStep uint64) ([]common.Hash, error) { + run, err := a.getRun(execid) + if err != nil { + return nil, err + } + bigStepLeavesUpTo := run.GetBigStepLeavesUpTo(toBigStep, numOpcodesPerBigStep) + res, err := bigStepLeavesUpTo.Await(ctx) + if err != nil { + return nil, err + } + return res, nil +} + +func (a *ExecServerAPI) GetSmallStepLeavesUpTo(ctx context.Context, execid uint64, bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) ([]common.Hash, error) { + run, err := a.getRun(execid) + if err != nil { + return nil, err + } + smallStepLeavesUpTo := run.GetSmallStepLeavesUpTo(bigStep, toSmallStep, numOpcodesPerBigStep) + res, err := smallStepLeavesUpTo.Await(ctx) + if err != nil { + return nil, err + } + return res, nil +} + func (a *ExecServerAPI) GetProofAt(ctx context.Context, execid uint64, position uint64) (string, error) { run, err := a.getRun(execid) if err != nil { diff --git a/validator/server_api/validation_client.go b/validator/server_api/validation_client.go index d6143ca917..326cdb8c2f 100644 --- a/validator/server_api/validation_client.go +++ b/validator/server_api/validation_client.go @@ -177,6 +177,28 @@ func (r *ExecutionClientRun) GetStepAt(pos uint64) containers.PromiseInterface[* }) } +func (r *ExecutionClientRun) GetBigStepLeavesUpTo(toBigStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { + var resJson []common.Hash + err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getBigStepLeavesUpTo", r.id, toBigStep, numOpcodesPerBigStep) + if err != nil { + return nil, err + } + return resJson, err + }) +} + +func (r *ExecutionClientRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { + var resJson []common.Hash + err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getSmallStepLeavesUpTo", r.id, bigStep, toSmallStep, numOpcodesPerBigStep) + if err != nil { + return nil, err + } + return resJson, err + }) +} + func (r *ExecutionClientRun) GetProofAt(pos uint64) containers.PromiseInterface[[]byte] { return stopwaiter.LaunchPromiseThread[[]byte](r, func(ctx context.Context) ([]byte, error) { var resString string diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 255d42ab16..0ca939db7c 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -8,6 +8,8 @@ import ( "fmt" "sync" + "github.com/ethereum/go-ethereum/common" + "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" @@ -50,35 +52,76 @@ func (e *executionRun) PrepareRange(start uint64, end uint64) containers.Promise func (e *executionRun) GetStepAt(position uint64) containers.PromiseInterface[*validator.MachineStepResult] { return stopwaiter.LaunchPromiseThread[*validator.MachineStepResult](e, func(ctx context.Context) (*validator.MachineStepResult, error) { - var machine MachineInterface - var err error - if position == ^uint64(0) { - machine, err = e.cache.GetFinalMachine(ctx) - } else { - // todo cache last machine - machine, err = e.cache.GetMachineAt(ctx, position) - } + return e.intermediateGetStepAt(ctx, position) + }) +} + +func (e *executionRun) GetBigStepLeavesUpTo(toBigStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { + var stateRoots []common.Hash + machine, err := e.cache.GetMachineAt(ctx, 0) if err != nil { return nil, err } - machineStep := machine.GetStepCount() - if position != machineStep { - machineRunning := machine.IsRunning() - if machineRunning || machineStep > position { - return nil, fmt.Errorf("machine is in wrong position want: %d, got: %d", position, machine.GetStepCount()) + if !machine.IsRunning() { + return stateRoots, nil + } + for i := uint64(0); i <= toBigStep; i++ { + position := i * numOpcodesPerBigStep + if err = machine.Step(ctx, position); err != nil { + return nil, err } - + stateRoots = append(stateRoots, machine.Hash()) } - result := &validator.MachineStepResult{ - Position: machineStep, - Status: validator.MachineStatus(machine.Status()), - GlobalState: machine.GetGlobalState(), - Hash: machine.Hash(), + return stateRoots, nil + }) +} + +func (e *executionRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { + var stateRoots []common.Hash + fromSmall := bigStep * numOpcodesPerBigStep + toSmall := fromSmall + toSmallStep + for i := fromSmall; i <= toSmall; i++ { + machineStep, err := e.intermediateGetStepAt(ctx, i) + if err != nil { + return nil, err + } + stateRoots = append(stateRoots, machineStep.Hash) } - return result, nil + return stateRoots, nil }) } +func (e *executionRun) intermediateGetStepAt(ctx context.Context, position uint64) (*validator.MachineStepResult, error) { + var machine MachineInterface + var err error + if position == ^uint64(0) { + machine, err = e.cache.GetFinalMachine(ctx) + } else { + // todo cache last machina + machine, err = e.cache.GetMachineAt(ctx, position) + } + if err != nil { + return nil, err + } + machineStep := machine.GetStepCount() + if position != machineStep { + machineRunning := machine.IsRunning() + if machineRunning || machineStep > position { + return nil, fmt.Errorf("machine is in wrong position want: %d, got: %d", position, machine.GetStepCount()) + } + + } + result := &validator.MachineStepResult{ + Position: machineStep, + Status: validator.MachineStatus(machine.Status()), + GlobalState: machine.GetGlobalState(), + Hash: machine.Hash(), + } + return result, nil +} + func (e *executionRun) GetProofAt(position uint64) containers.PromiseInterface[[]byte] { return stopwaiter.LaunchPromiseThread[[]byte](e, func(ctx context.Context) ([]byte, error) { machine, err := e.cache.GetMachineAt(ctx, position) From d5c7d16d39e014d9d73ba53ff0c973bb28dd9f16 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 8 Aug 2023 17:54:35 +0530 Subject: [PATCH 002/126] minor fix --- go.mod | 37 ++++++++++++++--------------- go.sum | 73 +++++++++++++++++++++++++++++++--------------------------- 2 files changed, 58 insertions(+), 52 deletions(-) diff --git a/go.mod b/go.mod index 8c39c17b65..d6d1756e0e 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ replace github.com/ethereum/go-ethereum => ./go-ethereum replace github.com/OffchainLabs/bold => ./bold require ( + github.com/OffchainLabs/bold v0.0.0-00010101000000-000000000000 github.com/alicebob/miniredis/v2 v2.21.0 github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 github.com/andybalholm/brotli v1.0.4 @@ -62,7 +63,7 @@ require ( github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect @@ -226,11 +227,11 @@ require ( github.com/quic-go/webtransport-go v0.5.2 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rhnvrm/simples3 v0.6.1 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/samber/lo v1.36.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/stretchr/testify v1.8.2 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa // indirect @@ -239,6 +240,7 @@ require ( github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel v1.7.0 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.7.0 // indirect @@ -258,8 +260,8 @@ require ( go.uber.org/zap v1.24.0 // indirect go4.org v0.0.0-20200411211856-f5505b9728dd // indirect golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect - golang.org/x/mod v0.7.0 // indirect - golang.org/x/tools v0.3.0 // indirect + golang.org/x/mod v0.8.0 // indirect + golang.org/x/tools v0.6.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect google.golang.org/grpc v1.46.0 // indirect @@ -279,43 +281,42 @@ require ( ) require ( - github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect - github.com/VictoriaMetrics/fastcache v1.6.0 // indirect + github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect - github.com/go-ole/go-ole v1.2.1 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-redis/redis/v8 v8.11.4 github.com/go-stack/stack v1.8.1 // indirect - github.com/golang/snappy v0.0.4 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.0 - github.com/huin/goupnp v1.0.3 // indirect + github.com/holiman/uint256 v1.2.2 + github.com/huin/goupnp v1.1.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect github.com/mitchellh/mapstructure v1.4.2 github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/rs/cors v1.7.0 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/status-im/keycard-go v0.2.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tklauser/go-sysconf v0.3.5 // indirect - github.com/tklauser/numcpus v0.2.2 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect - golang.org/x/crypto v0.6.0 - golang.org/x/net v0.7.0 // indirect + golang.org/x/crypto v0.7.0 + golang.org/x/net v0.8.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.6.0 - golang.org/x/text v0.7.0 // indirect + golang.org/x/sys v0.7.0 + golang.org/x/text v0.8.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect ) diff --git a/go.sum b/go.sum index 719e2a7729..da8a6a3533 100644 --- a/go.sum +++ b/go.sum @@ -61,8 +61,6 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -166,8 +164,8 @@ github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcug github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= -github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= -github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= @@ -378,8 +376,8 @@ github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -472,8 +470,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -602,13 +601,13 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.2 h1:TXKcSGc2WaxPD2+bmzAsVthL4+pEN0YwXcL5qED83vk= +github.com/holiman/uint256 v1.2.2/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= -github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/huin/goupnp v1.1.0 h1:gEe0Dp/lZmPZiDFzJJaOfUpOvv2MKUkoBX8lDrn9vKU= +github.com/huin/goupnp v1.1.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -1171,8 +1170,9 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -1442,6 +1442,9 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rhnvrm/simples3 v0.6.1 h1:H0DJwybR6ryQE+Odi9eqkHuzjYAeJgtGcGtuBwOhsH8= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1465,8 +1468,8 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= @@ -1545,16 +1548,15 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= -github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= @@ -1632,6 +1634,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= @@ -1736,8 +1740,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1773,8 +1777,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1834,8 +1838,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1894,6 +1898,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1933,7 +1938,6 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1950,12 +1954,12 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1966,8 +1970,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2035,8 +2039,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2169,6 +2173,7 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/d4l3k/messagediff.v1 v1.2.1 h1:70AthpjunwzUiarMHyED52mj9UwtAnE89l1Gmrt3EU0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= From 63946a6d5907fbc0bd266d6e9604bf6b3794d3c2 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 8 Aug 2023 18:05:13 +0530 Subject: [PATCH 003/126] Fix test --- system_tests/manager_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index fd6b417529..fdd45ce3f0 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -361,8 +361,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), transferGas, ) - _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, nil, l2chainConfig, nil, l2info) - execNode := getExecNode(t, l2node) + _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, l2chainConfig, nil, l2info) BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) l2info.GenerateAccount("BackgroundUser") balance := big.NewInt(params.Ether) @@ -388,7 +387,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, l2node.InboxReader, l2node.InboxTracker, l2node.TxStreamer, - execNode, + l2node.Execution.Recorder, l2node.ArbDB, nil, StaticFetcherFrom(t, &blockValidatorConfig), From 54371fcf156202c9c12797fd43ca176ebca7bfd5 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 10 Aug 2023 19:38:24 +0530 Subject: [PATCH 004/126] update bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 35a2079d67..a20bb2f17e 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 35a2079d67ac20aa1e1019f777c714fe2da2df59 +Subproject commit a20bb2f17e7deca509eb65619f60014af126ca17 From 96a2b9635fdc5b047b6e4f5459d0a97832c43771 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 16 Aug 2023 16:01:22 +0530 Subject: [PATCH 005/126] Fix --- system_tests/manager_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index fdd45ce3f0..ccf9110104 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -361,7 +361,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), transferGas, ) - _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, l2chainConfig, nil, l2info) + _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, l2chainConfig, nil, nil, l2info) BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) l2info.GenerateAccount("BackgroundUser") balance := big.NewInt(params.Ether) From 746745c3adf48eaffeb01988fc43f832b78d6e8f Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 16 Aug 2023 19:32:57 +0530 Subject: [PATCH 006/126] minor fix --- staker/challenge-cache/cache.go | 2 ++ staker/challenge-cache/cache_test.go | 2 ++ staker/manager.go | 2 ++ staker/state_provider.go | 2 ++ system_tests/manager_test.go | 2 ++ 5 files changed, 10 insertions(+) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 3ca6a5f657..1a79ff507c 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -1,3 +1,5 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE /* * Package challengecache stores validator state roots for L2 states within challenges in text files using a directory hierarchy structure for efficient lookup. Each file diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 3e433dbe41..b9fec74b9c 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -1,3 +1,5 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE package challengecache import ( diff --git a/staker/manager.go b/staker/manager.go index 5c220ede5e..a0a1af0a5a 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -1,3 +1,5 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE package staker import ( diff --git a/staker/state_provider.go b/staker/state_provider.go index 3d3eb43390..8caaaa3bb4 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -1,3 +1,5 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE package staker import ( diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index ccf9110104..9bd72d1578 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -1,3 +1,5 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE package arbtest import ( From d0dc758cd113b53e4bfc76751ce01ff750bf1543 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 16 Aug 2023 19:36:09 +0530 Subject: [PATCH 007/126] Add test for posting assestion of a large number of batches --- ...assertion_on_large_number_of_batch_test.go | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 system_tests/assertion_on_large_number_of_batch_test.go diff --git a/system_tests/assertion_on_large_number_of_batch_test.go b/system_tests/assertion_on_large_number_of_batch_test.go new file mode 100644 index 0000000000..ef51ea1f78 --- /dev/null +++ b/system_tests/assertion_on_large_number_of_batch_test.go @@ -0,0 +1,234 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE + +//go:build assertion_on_large_number_of_batch_test +// +build assertion_on_large_number_of_batch_test + +package arbtest + +import ( + "context" + "encoding/json" + "math" + "math/big" + "os" + "testing" + "time" + + "github.com/OffchainLabs/bold/assertions" + protocol "github.com/OffchainLabs/bold/chain-abstraction" + solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + "github.com/OffchainLabs/bold/solgen/go/mocksgen" + "github.com/OffchainLabs/bold/solgen/go/rollupgen" + challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing/setup" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + + "github.com/offchainlabs/nitro/arbnode" + "github.com/offchainlabs/nitro/cmd/chaininfo" + "github.com/offchainlabs/nitro/staker" + "github.com/offchainlabs/nitro/validator/server_common" + "github.com/offchainlabs/nitro/validator/valnode" +) + +var ( + blockChallengeLeafHeight = uint64(1 << 5) // 32 + bigStepChallengeLeafHeight = uint64(1 << 11) // 2048 + smallStepChallengeLeafHeight = uint64(1 << 20) // 1048576 +) + +// Helps in testing the feasibility of assertion after the protocol upgrade. +func TestAssertionOnLargeNumberOfBatch(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + l2node, assertionChain := setupAndPostBatches(t, ctx) + + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + stateless, err := staker.NewStatelessBlockValidator( + l2node.InboxReader, + l2node.InboxTracker, + l2node.TxStreamer, + l2node.Execution.Recorder, + l2node.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = stateless.Start(ctx) + Require(t, err) + + manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir()) + Require(t, err) + + poster := assertions.NewPoster( + assertionChain, + manager, + "test", + time.Second, + ) + _, err = poster.PostAssertion(ctx) + Require(t, err) +} + +func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, protocol.Protocol) { + glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false))) + glogger.Verbosity(log.LvlInfo) + log.Root().SetHandler(glogger) + + initialBalance := new(big.Int).Lsh(big.NewInt(1), 200) + l1Info := NewL1TestInfo(t) + l1Info.GenerateGenesisAccount("deployer", initialBalance) + l1Info.GenerateGenesisAccount("asserter", initialBalance) + l1Info.GenerateGenesisAccount("sequencer", initialBalance) + l1Info.GenerateGenesisAccount("RollupOwner", initialBalance) + + chainConfig := params.ArbitrumDevTestChainConfig() + l1Info, l1Backend, _, _ := createTestL1BlockChain(t, l1Info) + conf := arbnode.ConfigDefaultL1Test() + conf.BlockValidator.Enable = false + conf.BatchPoster.Enable = false + conf.InboxReader.CheckDelay = time.Second + + var valStack *node.Node + _, valStack = createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + configByValidationNode(t, conf, valStack) + + l1TransactionOpts := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) + stakeToken, tx, tokenBindings, err := mocksgen.DeployTestWETH9( + &l1TransactionOpts, + l1Backend, + "Weth", + "WETH", + ) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + value, _ := new(big.Int).SetString("10000", 10) + l1TransactionOpts.Value = value + tx, err = tokenBindings.Deposit(&l1TransactionOpts) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + l1TransactionOpts.Value = nil + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + rollupAddresses, assertionChain := deployBoldContracts(t, ctx, l1Info, l1Backend, chainConfig.ChainID, stakeToken) + l1Info.SetContract("Bridge", rollupAddresses.Bridge) + l1Info.SetContract("SequencerInbox", rollupAddresses.SequencerInbox) + l1Info.SetContract("Inbox", rollupAddresses.Inbox) + initMessage := getInitMessage(ctx, t, l1Backend, rollupAddresses) + + sequencerTxOpts := l1Info.GetDefaultTransactOpts("sequencer", ctx) + + bridgeAddr, seqInbox, seqInboxAddr := setupSequencerInboxStub(ctx, t, l1Info, l1Backend, chainConfig) + + l2Info, l2Stack, l2ChainDb, l2ArbDb, l2Blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil) + rollupAddresses.Bridge = bridgeAddr + rollupAddresses.SequencerInbox = seqInboxAddr + + fatalErrChan := make(chan error, 10) + l2Node, err := arbnode.CreateNode(ctx, l2Stack, l2ChainDb, l2ArbDb, NewFetcherFromConfig(conf), l2Blockchain, l1Backend, rollupAddresses, nil, nil, nil, fatalErrChan) + Require(t, err) + err = l2Node.Start(ctx) + Require(t, err) + + l2Info.GenerateAccount("Destination") + + rollup, err := rollupgen.NewRollupAdminLogic(l2Node.DeployInfo.Rollup, l1Backend) + Require(t, err) + deployAuth := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) + tx, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(1)) + + for i := 0; i <= int(math.Pow(2, 26)); i++ { + makeBatch(t, l2Node, l2Info, l1Backend, &sequencerTxOpts, seqInbox, seqInboxAddr, -1) + } + return l2Node, assertionChain +} + +func deployBoldContracts( + t *testing.T, + ctx context.Context, + l1info info, + backend *ethclient.Client, + chainId *big.Int, + stakeToken common.Address, +) (*chaininfo.RollupAddresses, *solimpl.AssertionChain) { + l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + locator, err := server_common.NewMachineLocator("") + Require(t, err) + + cfg := challenge_testing.GenerateRollupConfig( + false, + locator.LatestWasmModuleRoot(), + l1TransactionOpts.From, + chainId, + common.Address{}, + big.NewInt(1), + stakeToken, + challenge_testing.WithLevelZeroHeights(&challenge_testing.LevelZeroHeights{ + BlockChallengeHeight: blockChallengeLeafHeight, + BigStepChallengeHeight: bigStepChallengeLeafHeight, + SmallStepChallengeHeight: smallStepChallengeLeafHeight, + }), + ) + config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) + if err != nil { + return nil, nil + } + cfg.ChainConfig = string(config) + + addresses, err := setup.DeployFullRollupStack( + ctx, + backend, + &l1TransactionOpts, + l1info.GetAddress("sequencer"), + cfg, + false, + ) + Require(t, err) + + asserter := l1info.GetDefaultTransactOpts("asserter", ctx) + chain, err := solimpl.NewAssertionChain( + ctx, + addresses.Rollup, + &asserter, + backend, + ) + Require(t, err) + + chalManager, err := chain.SpecChallengeManager(ctx) + Require(t, err) + chalManagerAddr := chalManager.Address() + seed, _ := new(big.Int).SetString("1000", 10) + value, _ := new(big.Int).SetString("10000", 10) + tokenBindings, err := mocksgen.NewTestWETH9(stakeToken, backend) + Require(t, err) + tx, err := tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, asserter.From, seed) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, addresses.Rollup, value) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, chalManagerAddr, value) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + + return &chaininfo.RollupAddresses{ + Bridge: addresses.Bridge, + Inbox: addresses.Inbox, + SequencerInbox: addresses.SequencerInbox, + Rollup: addresses.Rollup, + ValidatorUtils: addresses.ValidatorUtils, + ValidatorWalletCreator: addresses.ValidatorWalletCreator, + DeployedAt: addresses.DeployedAt, + }, chain +} From 153887c8121ff0dfe0eb05f1e7394f7d86d3e591 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 16 Aug 2023 11:37:06 -0400 Subject: [PATCH 008/126] update bold reference --- bold | 2 +- system_tests/assertion_on_large_number_of_batch_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bold b/bold index a20bb2f17e..edfc0156b1 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit a20bb2f17e7deca509eb65619f60014af126ca17 +Subproject commit edfc0156b115b0e679fbb7e2b7f11050165870be diff --git a/system_tests/assertion_on_large_number_of_batch_test.go b/system_tests/assertion_on_large_number_of_batch_test.go index ef51ea1f78..cb59206a02 100644 --- a/system_tests/assertion_on_large_number_of_batch_test.go +++ b/system_tests/assertion_on_large_number_of_batch_test.go @@ -131,7 +131,7 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot bridgeAddr, seqInbox, seqInboxAddr := setupSequencerInboxStub(ctx, t, l1Info, l1Backend, chainConfig) - l2Info, l2Stack, l2ChainDb, l2ArbDb, l2Blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil) + l2Info, l2Stack, l2ChainDb, l2ArbDb, l2Blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil, nil) rollupAddresses.Bridge = bridgeAddr rollupAddresses.SequencerInbox = seqInboxAddr @@ -147,6 +147,7 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot Require(t, err) deployAuth := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) tx, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(1)) + Require(t, err) for i := 0; i <= int(math.Pow(2, 26)); i++ { makeBatch(t, l2Node, l2Info, l1Backend, &sequencerTxOpts, seqInbox, seqInboxAddr, -1) From 1564648894ab34f06e20db91a9618543c62dc0da Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 17 Aug 2023 19:06:23 +0530 Subject: [PATCH 009/126] update execution_run to support Generalized History Provider --- bold | 2 +- staker/state_provider.go | 4 ++-- system_tests/validation_mock_test.go | 5 +++++ validator/interface.go | 1 + validator/server_api/valiation_api.go | 13 +++++++++++++ validator/server_api/validation_client.go | 11 +++++++++++ validator/server_arb/execution_run.go | 21 +++++++++++++++++++++ 7 files changed, 54 insertions(+), 3 deletions(-) diff --git a/bold b/bold index edfc0156b1..5458ebd028 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit edfc0156b115b0e679fbb7e2b7f11050165870be +Subproject commit 5458ebd028a9d012dafa313b3b5111e3c5ddfc5b diff --git a/staker/state_provider.go b/staker/state_provider.go index 8caaaa3bb4..de72193409 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -481,7 +481,7 @@ func (s *StateManager) intermediateBigStepLeaves(ctx context.Context, wasmModule if err != nil { return nil, err } - bigStepLeaves := execRun.GetBigStepLeavesUpTo(toBigStep, s.numOpcodesPerBigStep) + bigStepLeaves := execRun.GetLeavesInRangeWithStepSize(0, toBigStep*s.numOpcodesPerBigStep, s.numOpcodesPerBigStep) result, err := bigStepLeaves.Await(ctx) if err != nil { return nil, err @@ -519,7 +519,7 @@ func (s *StateManager) intermediateSmallStepLeaves(ctx context.Context, wasmModu if err != nil { return nil, err } - smallStepLeaves := execRun.GetSmallStepLeavesUpTo(bigStep, toSmallStep, s.numOpcodesPerBigStep) + smallStepLeaves := execRun.GetLeavesInRangeWithStepSize(bigStep*s.numOpcodesPerBigStep, bigStep*s.numOpcodesPerBigStep+toSmallStep, 1) result, err := smallStepLeaves.Await(ctx) if err != nil { return nil, err diff --git a/system_tests/validation_mock_test.go b/system_tests/validation_mock_test.go index bceea0fd1c..330d03b8c4 100644 --- a/system_tests/validation_mock_test.go +++ b/system_tests/validation_mock_test.go @@ -125,6 +125,11 @@ func (r *mockExecRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, return containers.NewReadyPromise[[]common.Hash](nil, nil) } +func (r *mockExecRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { + // TODO: Add mock implementation for GetLeavesInRangeWithStepSize + return containers.NewReadyPromise[[]common.Hash](nil, nil) +} + func (r *mockExecRun) GetLastStep() containers.PromiseInterface[*validator.MachineStepResult] { return r.GetStepAt(mockExecLastPos) } diff --git a/validator/interface.go b/validator/interface.go index 385604e9d0..b5fdce5cba 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -32,6 +32,7 @@ type ExecutionRun interface { GetStepAt(uint64) containers.PromiseInterface[*MachineStepResult] GetBigStepLeavesUpTo(uint64, uint64) containers.PromiseInterface[[]common.Hash] GetSmallStepLeavesUpTo(uint64, uint64, uint64) containers.PromiseInterface[[]common.Hash] + GetLeavesInRangeWithStepSize(uint64, uint64, uint64) containers.PromiseInterface[[]common.Hash] GetLastStep() containers.PromiseInterface[*MachineStepResult] GetProofAt(uint64) containers.PromiseInterface[[]byte] PrepareRange(uint64, uint64) containers.PromiseInterface[struct{}] diff --git a/validator/server_api/valiation_api.go b/validator/server_api/valiation_api.go index 31018ef281..b4ca8469cf 100644 --- a/validator/server_api/valiation_api.go +++ b/validator/server_api/valiation_api.go @@ -168,6 +168,19 @@ func (a *ExecServerAPI) GetSmallStepLeavesUpTo(ctx context.Context, execid uint6 return res, nil } +func (a *ExecServerAPI) GetLeavesInRangeWithStepSize(ctx context.Context, execid uint64, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { + run, err := a.getRun(execid) + if err != nil { + return nil, err + } + leavesInRange := run.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) + res, err := leavesInRange.Await(ctx) + if err != nil { + return nil, err + } + return res, nil +} + func (a *ExecServerAPI) GetProofAt(ctx context.Context, execid uint64, position uint64) (string, error) { run, err := a.getRun(execid) if err != nil { diff --git a/validator/server_api/validation_client.go b/validator/server_api/validation_client.go index 326cdb8c2f..854e6938cf 100644 --- a/validator/server_api/validation_client.go +++ b/validator/server_api/validation_client.go @@ -199,6 +199,17 @@ func (r *ExecutionClientRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep }) } +func (r *ExecutionClientRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { + var resJson []common.Hash + err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getLeavesInRangeWithStepSize", r.id, fromStep, toStep, stepSize) + if err != nil { + return nil, err + } + return resJson, err + }) +} + func (r *ExecutionClientRun) GetProofAt(pos uint64) containers.PromiseInterface[[]byte] { return stopwaiter.LaunchPromiseThread[[]byte](r, func(ctx context.Context) ([]byte, error) { var resString string diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 0ca939db7c..7aac5bc291 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -93,6 +93,27 @@ func (e *executionRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64 }) } +func (e *executionRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { + var stateRoots []common.Hash + machine, err := e.cache.GetMachineAt(ctx, 0) + if err != nil { + return nil, err + } + if !machine.IsRunning() { + return stateRoots, nil + } + for i := fromStep; i <= toStep; i = i + stepSize { + machineStep, err := e.intermediateGetStepAt(ctx, i) + if err != nil { + return nil, err + } + stateRoots = append(stateRoots, machineStep.Hash) + } + return stateRoots, nil + }) +} + func (e *executionRun) intermediateGetStepAt(ctx context.Context, position uint64) (*validator.MachineStepResult, error) { var machine MachineInterface var err error From f696079ad362336202cbe7ceba7f10a5ad36ccaa Mon Sep 17 00:00:00 2001 From: amsanghi Date: Mon, 21 Aug 2023 16:11:26 +0530 Subject: [PATCH 010/126] Align with latest bold interface --- bold | 2 +- staker/challenge-cache/cache.go | 10 +- staker/challenge-cache/cache_test.go | 8 +- staker/manager.go | 16 ++ staker/state_provider.go | 246 +++++++++++++++++- ...assertion_on_large_number_of_batch_test.go | 2 +- system_tests/manager_test.go | 2 +- 7 files changed, 270 insertions(+), 16 deletions(-) diff --git a/bold b/bold index 5458ebd028..5116fa9253 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 5458ebd028a9d012dafa313b3b5111e3c5ddfc5b +Subproject commit 5116fa9253fa3c7074206c2c00c1d08e868e2178 diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 1a79ff507c..87a11584af 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -36,7 +36,7 @@ import ( "path/filepath" protocol "github.com/OffchainLabs/bold/chain-abstraction" - "github.com/OffchainLabs/bold/containers/option" + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" ) @@ -74,7 +74,7 @@ func New(baseDir string) *Cache { type Key struct { WavmModuleRoot common.Hash MessageHeight protocol.Height - BigStepHeight option.Option[protocol.Height] + StepHeights []l2stateprovider.Height } // Get a list of state roots from the cache up to a certain index. State roots are saved as files in the directory @@ -217,9 +217,9 @@ func determineFilePath(baseDir string, lookup *Key) (string, error) { key := make([]string, 0) key = append(key, fmt.Sprintf("%s-%s", wavmModuleRootPrefix, lookup.WavmModuleRoot.Hex())) key = append(key, fmt.Sprintf("%s-%d", messageNumberPrefix, lookup.MessageHeight)) - if !lookup.BigStepHeight.IsNone() { - bigStepHeight := lookup.BigStepHeight.Unwrap() - key = append(key, fmt.Sprintf("%s-%d", bigStepPrefix, bigStepHeight)) + for _, height := range lookup.StepHeights { + key = append(key, fmt.Sprintf("%s-%d", bigStepPrefix, height)) + } key = append(key, stateRootsFileName) return filepath.Join(baseDir, filepath.Join(key...)), nil diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index b9fec74b9c..5cbe0c2133 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -6,6 +6,7 @@ import ( "bytes" "errors" "fmt" + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "io" "io/ioutil" "os" @@ -13,7 +14,6 @@ import ( "testing" protocol "github.com/OffchainLabs/bold/chain-abstraction" - "github.com/OffchainLabs/bold/containers/option" "github.com/ethereum/go-ethereum/common" ) @@ -33,7 +33,7 @@ func TestCache(t *testing.T) { key := &Key{ WavmModuleRoot: common.BytesToHash([]byte("foo")), MessageHeight: 0, - BigStepHeight: option.Some(protocol.Height(0)), + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, } t.Run("Not found", func(t *testing.T) { _, err := cache.Get(key, protocol.Height(0)) @@ -252,7 +252,7 @@ func Test_determineFilePath(t *testing.T) { baseDir: "", key: &Key{ MessageHeight: 100, - BigStepHeight: option.Some(protocol.Height(50)), + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(50)}, }, }, want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", @@ -299,7 +299,7 @@ func BenchmarkCache_Read_32Mb(b *testing.B) { key := &Key{ WavmModuleRoot: common.BytesToHash([]byte("foo")), MessageHeight: 0, - BigStepHeight: option.Some(protocol.Height(0)), + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, } numRoots := 1 << 20 roots := make([]common.Hash, numRoots) diff --git a/staker/manager.go b/staker/manager.go index a0a1af0a5a..01f7d3b908 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -4,6 +4,8 @@ package staker import ( "context" + "math/big" + solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" challengemanager "github.com/OffchainLabs/bold/challenge-manager" "github.com/OffchainLabs/bold/challenge-manager/types" @@ -58,12 +60,26 @@ func NewManager( if err != nil { return nil, err } + numBigStepLevel, err := managerBinding.NUMBIGSTEPLEVEL(&callOpts) + if err != nil { + return nil, err + } + challengeLeafHeights := make([]uint64, numBigStepLevel.Uint64()+2) + for i := uint64(0); i <= numBigStepLevel.Uint64()+1; i++ { + leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, big.NewInt(i)) + if err != nil { + return nil, err + } + challengeLeafHeights[i] = leafHeight.Uint64() + } + stateManager, err := NewStateManager( statelessBlockValidator, nil, smallStepEdgeHeight.Uint64(), bigStepEdgeHeight.Uint64()*smallStepEdgeHeight.Uint64(), historyCacheBaseDir, + challengeLeafHeights, ) if err != nil { return nil, err diff --git a/staker/state_provider.go b/staker/state_provider.go index de72193409..4154ef6bea 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -36,7 +36,10 @@ var ( } ) -var ErrChainCatchingUp = errors.New("chain catching up") +var ( + ErrChainCatchingUp = errors.New("chain catching up") + emptyCommit = commitments.History{} +) type StateManager struct { validator *StatelessBlockValidator @@ -44,9 +47,10 @@ type StateManager struct { numOpcodesPerBigStep uint64 maxWavmOpcodes uint64 historyCache challengecache.HistoryCommitmentCacher + challengeLeafHeights []uint64 } -func NewStateManager(val *StatelessBlockValidator, blockValidator *BlockValidator, numOpcodesPerBigStep uint64, maxWavmOpcodes uint64, cacheBaseDir string) (*StateManager, error) { +func NewStateManager(val *StatelessBlockValidator, blockValidator *BlockValidator, numOpcodesPerBigStep uint64, maxWavmOpcodes uint64, cacheBaseDir string, challengeLeafHeights []uint64) (*StateManager, error) { historyCache := challengecache.New(cacheBaseDir) return &StateManager{ validator: val, @@ -54,6 +58,7 @@ func NewStateManager(val *StatelessBlockValidator, blockValidator *BlockValidato numOpcodesPerBigStep: numOpcodesPerBigStep, maxWavmOpcodes: maxWavmOpcodes, historyCache: historyCache, + challengeLeafHeights: challengeLeafHeights, }, nil } @@ -463,7 +468,7 @@ func (s *StateManager) intermediateBigStepLeaves(ctx context.Context, wasmModule cacheKey := &challengecache.Key{ WavmModuleRoot: wasmModuleRoot, MessageHeight: protocol.Height(blockHeight), - BigStepHeight: option.None[protocol.Height](), + StepHeights: nil, } cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toBigStep)) if err == nil { @@ -501,7 +506,7 @@ func (s *StateManager) intermediateSmallStepLeaves(ctx context.Context, wasmModu cacheKey := &challengecache.Key{ WavmModuleRoot: wasmModuleRoot, MessageHeight: protocol.Height(blockHeight), - BigStepHeight: option.Some[protocol.Height](protocol.Height(bigStep)), + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(bigStep)}, } cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toSmallStep)) if err == nil { @@ -666,3 +671,236 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes PosInBatch: uint64(count - prevBatchMsgCount), }, nil } + +// A list of heights that have been validated to be non-empty +// and to be < the total number of challenge levels in the protocol. +type validatedStartHeights []l2stateprovider.Height + +// HistoryCommitment computes a Merklelized commitment over a set of hashes +// at specified challenge levels. +// For block challenges, for example, this is a set of machine hashes corresponding +// each message in a range N to M. +func (s *StateManager) HistoryCommitment( + ctx context.Context, + wasmModuleRoot common.Hash, + batch l2stateprovider.Batch, + startHeights []l2stateprovider.Height, + upToHeight option.Option[l2stateprovider.Height], +) (commitments.History, error) { + validatedHeights, err := s.validateStartHeights(startHeights) + if err != nil { + return emptyCommit, err + } + // If the call is for message number ranges only, we get the hashes for + // those states and return a commitment for them. + if len(validatedHeights) == 1 { + return s.blockHistoryCommitment(validatedHeights[0], upToHeight, batch) + } + + // Loads a machine at a specific message number. + fromMessageNumber := uint64(validatedHeights[0]) + + // Next, computes the exact start point of where we need to execute + // the machine from the inputs, and figures out in what increments we need to do so. + machineStartIndex := s.computeMachineStartIndex(validatedHeights) + + // We compute the stepwise increments we need for stepping through the machine. + stepBy, err := s.computeStepIncrement(validatedHeights) + if err != nil { + return emptyCommit, err + } + + // Compute how many machine hashes we need to collect. + numHashes, err := s.computeRequiredNumberOfHashes(validatedHeights, upToHeight) + if err != nil { + return emptyCommit, err + } + + hashes, err := s.intermediateStepLeaves(ctx, wasmModuleRoot, fromMessageNumber, startHeights[1:], machineStartIndex, machineStartIndex+stepBy*numHashes, stepBy) + if err != nil { + return commitments.History{}, err + } + return commitments.New(hashes) +} + +// Validates a start heights input must be non-empty and have a max +// equal to the number of challenge levels. +func (s *StateManager) validateStartHeights( + startHeights []l2stateprovider.Height, +) (validatedStartHeights, error) { + if len(startHeights) == 0 { + return nil, errors.New("must provide start heights to compute number of hashes") + } + challengeLevel := len(startHeights) - 1 + if challengeLevel >= len(s.challengeLeafHeights) { + return nil, fmt.Errorf( + "challenge level %d is out of range for challenge leaf heights %v", + challengeLevel, + s.challengeLeafHeights, + ) + } + return validatedStartHeights(startHeights), nil +} + +// Computes the required number of hashes for a history commitment +// based on the requested heights and challenge level. +func (s *StateManager) computeRequiredNumberOfHashes( + startHeights validatedStartHeights, + upToHeight option.Option[l2stateprovider.Height], +) (uint64, error) { + // Get the max number of hashes at the specified challenge level. + // from the protocol constants. + challengeLevel := len(startHeights) - 1 + maxHeightForLevel := s.challengeLeafHeights[challengeLevel] + + // Get the start height we want to use at the challenge level. + start := uint64(startHeights[challengeLevel]) + + var end uint64 + if upToHeight.IsNone() { + end = maxHeightForLevel + } else { + end = uint64(upToHeight.Unwrap()) + // If the end height is more than the allowed max, we return an error. + // This scenario should not happen, and instead of silently truncating, + // surfacing an error is the safest way of warning the operator + // they are committing something invalid. + if end > maxHeightForLevel { + return 0, fmt.Errorf( + "end %d was greater than max height for level %d", + end, + maxHeightForLevel, + ) + } + } + if end < start { + return 0, fmt.Errorf("invalid range: end %d was < start %d", end, start) + } + // The number of hashes is the difference between the start and end + // requested heights, plus 1. + return (end - start) + 1, nil +} + +// Computes a block history commitment from a start height to a specified +// height up to the required batch number. +func (s *StateManager) blockHistoryCommitment( + from l2stateprovider.Height, + to option.Option[l2stateprovider.Height], + batch l2stateprovider.Batch, +) (commitments.History, error) { + var upTo l2stateprovider.Height + if !to.IsNone() { + upTo = to.Unwrap() + } else { + blockChallengeLeafHeight := s.challengeLeafHeights[0] + upTo = l2stateprovider.Height(blockChallengeLeafHeight) + } + states, err := s.statesUpTo(uint64(from), uint64(upTo), uint64(batch)) + if err != nil { + return emptyCommit, err + } + return commitments.New(states) +} + +// Figure out the actual opcode index we should move the machine to +// when we compute the history commitment. As there are different levels of challenge +// granularity, we have to do some math to figure out the correct index. +// Take, for example: +// +// lvl2_items_per_lvl1_step = 2 +// lvl3_items_per_lvl2_step = 4 +// lvl4_items_per_lvl3_step = 8 +// +// This means there are 2 lvl2 items per lvl1 step, 4 lvl3 items per lvl2 step, +// and 8 lvl4 items per lvl3 step in a challenge. +// +// # Let's say we want to compute the actual opcode index for start heights +// +// [lvl1_start=2, lvl2_start=3, lvl3_start=4] +// +// We can compute the opcode index using the following algorithm for the example above. +// +// 2 * (4 * 8) = 64 +// + 3 * (8) = 24 +// + 4 = opcode at index 92 +// +// This generalizes for any number of subchallenge levels into the algorithm below. +func (s *StateManager) computeMachineStartIndex( + startHeights validatedStartHeights, +) uint64 { + if len(startHeights) == 1 { + return 0 + } + // We ignore the block challenge level here. + heights := startHeights[1:] + leafHeights := s.challengeLeafHeights[1:] + + // Next, we compute the opcode index. + opcodeIndex := uint64(0) + idx := 1 + // TODO: Handle height 0. + for _, height := range heights { + total := uint64(1) + for i := idx; i < len(leafHeights); i++ { + total *= leafHeights[i] + } + opcodeIndex += total * uint64(height) + idx += 1 + } + return opcodeIndex +} + +func (s *StateManager) computeStepIncrement(startHeights validatedStartHeights) (uint64, error) { + challengeLevel := len(startHeights) - 1 + totalChallengeLevels := len(s.challengeLeafHeights) + + // The stepwise increment of the last challenge level is always one. + if challengeLevel+1 == totalChallengeLevels { + return 1, nil + } + return s.challengeLeafHeights[challengeLevel+1], nil +} + +func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, startHeight []l2stateprovider.Height, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { + cacheKey := &challengecache.Key{ + WavmModuleRoot: wasmModuleRoot, + MessageHeight: protocol.Height(blockHeight), + StepHeights: startHeight, + } + // Make sure that the last level starts with 0 + if startHeight[len(startHeight)-1] == 0 { + cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toStep)) + if err == nil { + return cachedRoots, nil + } + } + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) + if err != nil { + return nil, err + } + input, err := entry.ToInput() + if err != nil { + return nil, err + } + execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + if err != nil { + return nil, err + } + bigStepLeaves := execRun.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) + result, err := bigStepLeaves.Await(ctx) + if err != nil { + return nil, err + } + // TODO: Hacky workaround to avoid saving a history commitment to height 0. + if len(result) > 1 { + // Make sure that the last level starts with 0 + if startHeight[len(startHeight)-1] == 0 { + if err := s.historyCache.Put(cacheKey, result); err != nil { + if !errors.Is(err, challengecache.ErrFileAlreadyExists) { + return nil, err + } + } + } + } + return result, nil +} diff --git a/system_tests/assertion_on_large_number_of_batch_test.go b/system_tests/assertion_on_large_number_of_batch_test.go index cb59206a02..6ffb152439 100644 --- a/system_tests/assertion_on_large_number_of_batch_test.go +++ b/system_tests/assertion_on_large_number_of_batch_test.go @@ -65,7 +65,7 @@ func TestAssertionOnLargeNumberOfBatch(t *testing.T) { err = stateless.Start(ctx) Require(t, err) - manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir()) + manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir(), nil) Require(t, err) poster := assertions.NewPoster( diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index 9bd72d1578..076648eb8b 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -398,7 +398,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, Require(t, err) err = stateless.Start(ctx) Require(t, err) - manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir()) + manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir(), nil) Require(t, err) return l2node, l1stack, manager } From 6f542af64ccdca5b9d3f380af83de1f56120e6f8 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Mon, 21 Aug 2023 16:18:30 +0530 Subject: [PATCH 011/126] Minor fix --- staker/state_provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 4154ef6bea..952d711e4c 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -486,7 +486,7 @@ func (s *StateManager) intermediateBigStepLeaves(ctx context.Context, wasmModule if err != nil { return nil, err } - bigStepLeaves := execRun.GetLeavesInRangeWithStepSize(0, toBigStep*s.numOpcodesPerBigStep, s.numOpcodesPerBigStep) + bigStepLeaves := execRun.GetBigStepLeavesUpTo(toBigStep, s.numOpcodesPerBigStep) result, err := bigStepLeaves.Await(ctx) if err != nil { return nil, err @@ -524,7 +524,7 @@ func (s *StateManager) intermediateSmallStepLeaves(ctx context.Context, wasmModu if err != nil { return nil, err } - smallStepLeaves := execRun.GetLeavesInRangeWithStepSize(bigStep*s.numOpcodesPerBigStep, bigStep*s.numOpcodesPerBigStep+toSmallStep, 1) + smallStepLeaves := execRun.GetSmallStepLeavesUpTo(bigStep, toSmallStep, s.numOpcodesPerBigStep) result, err := smallStepLeaves.Await(ctx) if err != nil { return nil, err From 04241b06a161966efb73748596f0998f6c66c790 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Mon, 21 Aug 2023 16:20:07 +0530 Subject: [PATCH 012/126] Minor fix --- staker/state_provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 952d711e4c..397b203cf6 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -886,8 +886,8 @@ func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoo if err != nil { return nil, err } - bigStepLeaves := execRun.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) - result, err := bigStepLeaves.Await(ctx) + stepLeaves := execRun.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) + result, err := stepLeaves.Await(ctx) if err != nil { return nil, err } From 0f8bf4d53c8b2853ba849b4a5fea08c0a7750f73 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Mon, 21 Aug 2023 16:26:54 +0530 Subject: [PATCH 013/126] fix computeStepIncrement --- staker/state_provider.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 397b203cf6..81693a5ae4 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -858,7 +858,11 @@ func (s *StateManager) computeStepIncrement(startHeights validatedStartHeights) if challengeLevel+1 == totalChallengeLevels { return 1, nil } - return s.challengeLeafHeights[challengeLevel+1], nil + total := uint64(1) + for i := challengeLevel + 1; i < len(s.challengeLeafHeights); i++ { + total *= s.challengeLeafHeights[i] + } + return total, nil } func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, startHeight []l2stateprovider.Height, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { From 2e0bc77cc34f7cece1bb43bfb835bd17e82d5317 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Mon, 21 Aug 2023 16:31:33 +0530 Subject: [PATCH 014/126] minor fix --- validator/server_arb/execution_run.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 7aac5bc291..fcfa5eb4f0 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -96,13 +96,6 @@ func (e *executionRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64 func (e *executionRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { var stateRoots []common.Hash - machine, err := e.cache.GetMachineAt(ctx, 0) - if err != nil { - return nil, err - } - if !machine.IsRunning() { - return stateRoots, nil - } for i := fromStep; i <= toStep; i = i + stepSize { machineStep, err := e.intermediateGetStepAt(ctx, i) if err != nil { From 0a60c122706988f0870f3a8972c79b92c5ed17ca Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 23 Aug 2023 19:42:38 +0530 Subject: [PATCH 015/126] update based on latest changes in https://github.com/OffchainLabs/bold/pull/417 --- bold | 2 +- staker/state_provider.go | 213 ++++++--------------------------------- 2 files changed, 30 insertions(+), 185 deletions(-) diff --git a/bold b/bold index 5116fa9253..e517fa7c4b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 5116fa9253fa3c7074206c2c00c1d08e868e2178 +Subproject commit e517fa7c4b69052616b56f8d96e35c2f5207a382 diff --git a/staker/state_provider.go b/staker/state_provider.go index 81693a5ae4..12a3e670d6 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -24,7 +24,11 @@ import ( "github.com/offchainlabs/nitro/validator" ) -var _ l2stateprovider.Provider = (*StateManager)(nil) +var ( + _ l2stateprovider.Provider = (*StateManager)(nil) + _ l2stateprovider.L2MessageStateCollector = (*StateManager)(nil) + _ l2stateprovider.MachineHashCollector = (*StateManager)(nil) +) // Defines the ABI encoding structure for submission of prefix proofs to the protocol contracts var ( @@ -672,197 +676,38 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes }, nil } -// A list of heights that have been validated to be non-empty -// and to be < the total number of challenge levels in the protocol. -type validatedStartHeights []l2stateprovider.Height - -// HistoryCommitment computes a Merklelized commitment over a set of hashes -// at specified challenge levels. -// For block challenges, for example, this is a set of machine hashes corresponding -// each message in a range N to M. -func (s *StateManager) HistoryCommitment( +// L2MessageStatesUpTo Computes a block history commitment from a start L2 message to an end L2 message index +// and up to a required batch index. The hashes used for this commitment are the machine hashes +// at each message number. +func (s *StateManager) L2MessageStatesUpTo( ctx context.Context, - wasmModuleRoot common.Hash, - batch l2stateprovider.Batch, - startHeights []l2stateprovider.Height, - upToHeight option.Option[l2stateprovider.Height], -) (commitments.History, error) { - validatedHeights, err := s.validateStartHeights(startHeights) - if err != nil { - return emptyCommit, err - } - // If the call is for message number ranges only, we get the hashes for - // those states and return a commitment for them. - if len(validatedHeights) == 1 { - return s.blockHistoryCommitment(validatedHeights[0], upToHeight, batch) - } - - // Loads a machine at a specific message number. - fromMessageNumber := uint64(validatedHeights[0]) - - // Next, computes the exact start point of where we need to execute - // the machine from the inputs, and figures out in what increments we need to do so. - machineStartIndex := s.computeMachineStartIndex(validatedHeights) - - // We compute the stepwise increments we need for stepping through the machine. - stepBy, err := s.computeStepIncrement(validatedHeights) - if err != nil { - return emptyCommit, err - } - - // Compute how many machine hashes we need to collect. - numHashes, err := s.computeRequiredNumberOfHashes(validatedHeights, upToHeight) - if err != nil { - return emptyCommit, err - } - - hashes, err := s.intermediateStepLeaves(ctx, wasmModuleRoot, fromMessageNumber, startHeights[1:], machineStartIndex, machineStartIndex+stepBy*numHashes, stepBy) - if err != nil { - return commitments.History{}, err - } - return commitments.New(hashes) -} - -// Validates a start heights input must be non-empty and have a max -// equal to the number of challenge levels. -func (s *StateManager) validateStartHeights( - startHeights []l2stateprovider.Height, -) (validatedStartHeights, error) { - if len(startHeights) == 0 { - return nil, errors.New("must provide start heights to compute number of hashes") - } - challengeLevel := len(startHeights) - 1 - if challengeLevel >= len(s.challengeLeafHeights) { - return nil, fmt.Errorf( - "challenge level %d is out of range for challenge leaf heights %v", - challengeLevel, - s.challengeLeafHeights, - ) - } - return validatedStartHeights(startHeights), nil -} - -// Computes the required number of hashes for a history commitment -// based on the requested heights and challenge level. -func (s *StateManager) computeRequiredNumberOfHashes( - startHeights validatedStartHeights, - upToHeight option.Option[l2stateprovider.Height], -) (uint64, error) { - // Get the max number of hashes at the specified challenge level. - // from the protocol constants. - challengeLevel := len(startHeights) - 1 - maxHeightForLevel := s.challengeLeafHeights[challengeLevel] - - // Get the start height we want to use at the challenge level. - start := uint64(startHeights[challengeLevel]) - - var end uint64 - if upToHeight.IsNone() { - end = maxHeightForLevel - } else { - end = uint64(upToHeight.Unwrap()) - // If the end height is more than the allowed max, we return an error. - // This scenario should not happen, and instead of silently truncating, - // surfacing an error is the safest way of warning the operator - // they are committing something invalid. - if end > maxHeightForLevel { - return 0, fmt.Errorf( - "end %d was greater than max height for level %d", - end, - maxHeightForLevel, - ) - } - } - if end < start { - return 0, fmt.Errorf("invalid range: end %d was < start %d", end, start) - } - // The number of hashes is the difference between the start and end - // requested heights, plus 1. - return (end - start) + 1, nil -} - -// Computes a block history commitment from a start height to a specified -// height up to the required batch number. -func (s *StateManager) blockHistoryCommitment( from l2stateprovider.Height, - to option.Option[l2stateprovider.Height], + upTo option.Option[l2stateprovider.Height], batch l2stateprovider.Batch, -) (commitments.History, error) { - var upTo l2stateprovider.Height - if !to.IsNone() { - upTo = to.Unwrap() +) ([]common.Hash, error) { + var to l2stateprovider.Height + if !upTo.IsNone() { + to = upTo.Unwrap() } else { blockChallengeLeafHeight := s.challengeLeafHeights[0] - upTo = l2stateprovider.Height(blockChallengeLeafHeight) - } - states, err := s.statesUpTo(uint64(from), uint64(upTo), uint64(batch)) - if err != nil { - return emptyCommit, err - } - return commitments.New(states) -} - -// Figure out the actual opcode index we should move the machine to -// when we compute the history commitment. As there are different levels of challenge -// granularity, we have to do some math to figure out the correct index. -// Take, for example: -// -// lvl2_items_per_lvl1_step = 2 -// lvl3_items_per_lvl2_step = 4 -// lvl4_items_per_lvl3_step = 8 -// -// This means there are 2 lvl2 items per lvl1 step, 4 lvl3 items per lvl2 step, -// and 8 lvl4 items per lvl3 step in a challenge. -// -// # Let's say we want to compute the actual opcode index for start heights -// -// [lvl1_start=2, lvl2_start=3, lvl3_start=4] -// -// We can compute the opcode index using the following algorithm for the example above. -// -// 2 * (4 * 8) = 64 -// + 3 * (8) = 24 -// + 4 = opcode at index 92 -// -// This generalizes for any number of subchallenge levels into the algorithm below. -func (s *StateManager) computeMachineStartIndex( - startHeights validatedStartHeights, -) uint64 { - if len(startHeights) == 1 { - return 0 - } - // We ignore the block challenge level here. - heights := startHeights[1:] - leafHeights := s.challengeLeafHeights[1:] - - // Next, we compute the opcode index. - opcodeIndex := uint64(0) - idx := 1 - // TODO: Handle height 0. - for _, height := range heights { - total := uint64(1) - for i := idx; i < len(leafHeights); i++ { - total *= leafHeights[i] - } - opcodeIndex += total * uint64(height) - idx += 1 + to = l2stateprovider.Height(blockChallengeLeafHeight) } - return opcodeIndex + return s.statesUpTo(uint64(from), uint64(to), uint64(batch)) } -func (s *StateManager) computeStepIncrement(startHeights validatedStartHeights) (uint64, error) { - challengeLevel := len(startHeights) - 1 - totalChallengeLevels := len(s.challengeLeafHeights) - - // The stepwise increment of the last challenge level is always one. - if challengeLevel+1 == totalChallengeLevels { - return 1, nil - } - total := uint64(1) - for i := challengeLevel + 1; i < len(s.challengeLeafHeights); i++ { - total *= s.challengeLeafHeights[i] - } - return total, nil +// CollectMachineMashes Collects a list of machine hashes at a message number based on some configuration parameters. +func (s *StateManager) CollectMachineMashes( + ctx context.Context, cfg *l2stateprovider.HashCollectorConfig, +) ([]common.Hash, error) { + return s.intermediateStepLeaves( + ctx, + cfg.WasmModuleRoot, + uint64(cfg.MessageNumber), + cfg.StepHeights, + uint64(cfg.MachineStartIndex), + uint64(cfg.MachineStartIndex)+uint64(cfg.StepSize)*cfg.NumDesiredHashes, + uint64(cfg.StepSize), + ) } func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, startHeight []l2stateprovider.Height, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { From 12de883500915a08923f0cc47fcb68cc06d53629 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 24 Aug 2023 20:15:10 +0530 Subject: [PATCH 016/126] Add option to switch to new bold protocol staker during the contract upgrade --- arbnode/node.go | 2 +- staker/staker.go | 57 +++++++++++++++++++++++++++++++++++++ system_tests/staker_test.go | 3 ++ 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/arbnode/node.go b/arbnode/node.go index a4025429c6..40aa58c342 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -843,7 +843,7 @@ func createNodeImpl( confirmedNotifiers = append(confirmedNotifiers, messagePruner) } - stakerObj, err = staker.NewStaker(l1Reader, wallet, bind.CallOpts{}, config.Staker, blockValidator, statelessBlockValidator, nil, confirmedNotifiers, deployInfo.ValidatorUtils, fatalErrChan) + stakerObj, err = staker.NewStaker(l1Reader, wallet, bind.CallOpts{}, config.Staker, blockValidator, statelessBlockValidator, nil, confirmedNotifiers, deployInfo.ValidatorUtils, deployInfo.Rollup, fatalErrChan) if err != nil { return nil, err } diff --git a/staker/staker.go b/staker/staker.go index a35f5088c1..9d9d3c1816 100644 --- a/staker/staker.go +++ b/staker/staker.go @@ -22,6 +22,8 @@ import ( "github.com/offchainlabs/nitro/arbutil" "github.com/offchainlabs/nitro/cmd/genericconf" + "github.com/offchainlabs/nitro/solgen/go/bridgegen" + "github.com/offchainlabs/nitro/solgen/go/rollupgen" "github.com/offchainlabs/nitro/util/arbmath" "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" @@ -70,6 +72,7 @@ func L1PostingStrategyAddOptions(prefix string, f *flag.FlagSet) { type L1ValidatorConfig struct { Enable bool `koanf:"enable"` + EnableBold bool `koanf:"enable-bold"` Strategy string `koanf:"strategy"` StakerInterval time.Duration `koanf:"staker-interval"` MakeAssertionInterval time.Duration `koanf:"make-assertion-interval"` @@ -133,6 +136,7 @@ func (c *L1ValidatorConfig) Validate() error { var DefaultL1ValidatorConfig = L1ValidatorConfig{ Enable: true, + EnableBold: false, Strategy: "Watchtower", StakerInterval: time.Minute, MakeAssertionInterval: time.Hour, @@ -158,6 +162,7 @@ var DefaultValidatorL1WalletConfig = genericconf.WalletConfig{ func L1ValidatorConfigAddOptions(prefix string, f *flag.FlagSet) { f.Bool(prefix+".enable", DefaultL1ValidatorConfig.Enable, "enable validator") + f.Bool(prefix+".enable-bold", DefaultL1ValidatorConfig.EnableBold, "enable switch check to bold validator") f.String(prefix+".strategy", DefaultL1ValidatorConfig.Strategy, "L1 validator strategy, either watchtower, defensive, stakeLatest, or makeNodes") f.Duration(prefix+".staker-interval", DefaultL1ValidatorConfig.StakerInterval, "how often the L1 validator should check the status of the L1 rollup and maybe take action with its stake") f.Duration(prefix+".make-assertion-interval", DefaultL1ValidatorConfig.MakeAssertionInterval, "if configured with the makeNodes strategy, how often to create new assertions (bypassed in case of a dispute)") @@ -216,6 +221,7 @@ type Staker struct { bringActiveUntilNode uint64 inboxReader InboxReaderInterface statelessBlockValidator *StatelessBlockValidator + bridge *bridgegen.IBridge fatalErr chan<- error } @@ -229,6 +235,7 @@ func NewStaker( stakedNotifiers []LatestStakedNotifier, confirmedNotifiers []LatestConfirmedNotifier, validatorUtilsAddress common.Address, + bridgeAddress common.Address, fatalErr chan<- error, ) (*Staker, error) { @@ -245,6 +252,13 @@ func NewStaker( if config.StartValidationFromStaked && blockValidator != nil { stakedNotifiers = append(stakedNotifiers, blockValidator) } + var bridge *bridgegen.IBridge + if config.EnableBold { + bridge, err = bridgegen.NewIBridge(bridgeAddress, client) + if err != nil { + return nil, err + } + } return &Staker{ L1Validator: val, l1Reader: l1Reader, @@ -256,6 +270,7 @@ func NewStaker( lastActCalledBlock: nil, inboxReader: statelessBlockValidator.inboxReader, statelessBlockValidator: statelessBlockValidator, + bridge: bridge, fatalErr: fatalErr, }, nil } @@ -424,6 +439,48 @@ func (s *Staker) Start(ctxIn context.Context) { } return s.config.StakerInterval }) + s.CallIteratively(func(ctx context.Context) time.Duration { + // Using ctxIn instead of ctx since, ctxIn will be passed on to bold staker + // and ctx will be cancelled after the switch to bold staker. + switchedToBoldProtocol, err := s.checkAndSwitchToBoldStaker(ctxIn) + if err != nil { + log.Error("staker: error in checking switch to bold staker", "err", err) + } + if switchedToBoldProtocol { + s.StopAndWait() + } + return s.config.StakerInterval + }) +} + +func (s *Staker) checkAndSwitchToBoldStaker(ctx context.Context) (bool, error) { + switchedToBoldProtocol := false + if s.config.EnableBold { + callOpts := s.getCallOpts(ctx) + rollupAddress, err := s.bridge.Rollup(callOpts) + if err != nil { + return false, err + } + userLogic, err := rollupgen.NewRollupUserLogic(rollupAddress, s.client) + if err != nil { + return false, err + } + _, err = userLogic.ExtraChallengeTimeBlocks(callOpts) + if err != nil { + // Switch to Bold protocol since ExtraChallengeTimeBlocks does not exist in bold protocol . + auth, err := s.builder.Auth(ctx) + if err != nil { + return false, err + } + boldManager, err := NewManager(ctx, rollupAddress, auth, *callOpts, s.client, s.statelessBlockValidator, "") + if err != nil { + return false, err + } + boldManager.Start(ctx) + switchedToBoldProtocol = true + } + } + return switchedToBoldProtocol, nil } func (s *Staker) IsWhitelisted(ctx context.Context) (bool, error) { diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index 468463d58f..f126a10a6a 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -168,6 +168,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) nil, nil, l2nodeA.DeployInfo.ValidatorUtils, + l2nodeA.DeployInfo.Rollup, nil, ) Require(t, err) @@ -208,6 +209,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) nil, nil, l2nodeB.DeployInfo.ValidatorUtils, + l2nodeB.DeployInfo.Rollup, nil, ) Require(t, err) @@ -234,6 +236,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) nil, nil, l2nodeA.DeployInfo.ValidatorUtils, + l2nodeA.DeployInfo.Rollup, nil, ) Require(t, err) From 7f011e7aafbf8e8147db2c18959cbc7b7c98a582 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 31 Aug 2023 18:45:12 +0530 Subject: [PATCH 017/126] call checkAndSwitchToBoldStaker before act as well --- staker/staker.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/staker/staker.go b/staker/staker.go index 9d9d3c1816..94556f2064 100644 --- a/staker/staker.go +++ b/staker/staker.go @@ -381,6 +381,13 @@ func (s *Staker) Start(ctxIn context.Context) { if err != nil { log.Warn("error updating latest wasm module root", "err", err) } + switchedToBoldProtocol, err := s.checkAndSwitchToBoldStaker(ctxIn) + if err != nil { + log.Error("staker: error in checking switch to bold staker", "err", err) + } + if switchedToBoldProtocol { + s.StopAndWait() + } arbTx, err := s.Act(ctx) if err == nil && arbTx != nil { _, err = s.l1Reader.WaitForTxApproval(ctx, arbTx) From 612949a9260a5528bd01147d4bceb34aa7fdb514 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 1 Sep 2023 15:27:00 +0530 Subject: [PATCH 018/126] Add TestStakerSwitchDuringRollupUpgrade --- arbnode/node.go | 2 +- contracts | 2 +- system_tests/staker_test.go | 194 +++++++++++++++++++++++++++++++++++- 3 files changed, 193 insertions(+), 5 deletions(-) diff --git a/arbnode/node.go b/arbnode/node.go index 40aa58c342..4efcf1b7f7 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -843,7 +843,7 @@ func createNodeImpl( confirmedNotifiers = append(confirmedNotifiers, messagePruner) } - stakerObj, err = staker.NewStaker(l1Reader, wallet, bind.CallOpts{}, config.Staker, blockValidator, statelessBlockValidator, nil, confirmedNotifiers, deployInfo.ValidatorUtils, deployInfo.Rollup, fatalErrChan) + stakerObj, err = staker.NewStaker(l1Reader, wallet, bind.CallOpts{}, config.Staker, blockValidator, statelessBlockValidator, nil, confirmedNotifiers, deployInfo.ValidatorUtils, deployInfo.Bridge, fatalErrChan) if err != nil { return nil, err } diff --git a/contracts b/contracts index 97cfbe00ff..8324fc06de 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit 97cfbe00ff0eea4d7f5f5f3afb01598c19ddabc4 +Subproject commit 8324fc06de2718d9d3a4ba927ac0fd8b5c427ef8 diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index f126a10a6a..bb4f0dffe3 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -9,6 +9,7 @@ package arbtest import ( "context" + "encoding/json" "errors" "fmt" "math/big" @@ -21,19 +22,27 @@ import ( "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" + mocksgen_bold "github.com/OffchainLabs/bold/solgen/go/mocksgen" + challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing/setup" + "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbnode/dataposter/storage" "github.com/offchainlabs/nitro/arbos/l2pricing" "github.com/offchainlabs/nitro/arbutil" + "github.com/offchainlabs/nitro/cmd/chaininfo" + "github.com/offchainlabs/nitro/solgen/go/bridgegen" "github.com/offchainlabs/nitro/solgen/go/mocksgen" "github.com/offchainlabs/nitro/solgen/go/rollupgen" "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/util" "github.com/offchainlabs/nitro/util/arbmath" "github.com/offchainlabs/nitro/util/colors" + "github.com/offchainlabs/nitro/validator/server_common" "github.com/offchainlabs/nitro/validator/valnode" ) @@ -168,7 +177,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) nil, nil, l2nodeA.DeployInfo.ValidatorUtils, - l2nodeA.DeployInfo.Rollup, + l2nodeA.DeployInfo.Bridge, nil, ) Require(t, err) @@ -209,7 +218,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) nil, nil, l2nodeB.DeployInfo.ValidatorUtils, - l2nodeB.DeployInfo.Rollup, + l2nodeB.DeployInfo.Bridge, nil, ) Require(t, err) @@ -236,7 +245,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) nil, nil, l2nodeA.DeployInfo.ValidatorUtils, - l2nodeA.DeployInfo.Rollup, + l2nodeA.DeployInfo.Bridge, nil, ) Require(t, err) @@ -413,3 +422,182 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) func TestStakersCooperative(t *testing.T) { stakerTestImpl(t, false, false) } + +func TestStakerSwitchDuringRollupUpgrade(t *testing.T) { + ctx, cancelCtx := context.WithCancel(context.Background()) + defer cancelCtx() + stakerImpl, l1info, l1client, l2chainConfig, l2node, deployAuth := setupNonBoldStaker(t, ctx) + defer l2node.StopAndWait() + + err := stakerImpl.Initialize(ctx) + Require(t, err) + stakerImpl.Start(ctx) + if stakerImpl.Stopped() { + t.Fatal("Old protocol staker not started") + } + + rollupAddresses := deployBoldContracts(t, ctx, l1info, l1client, l2chainConfig.ChainID, deployAuth) + + bridge, err := bridgegen.NewBridge(l2node.DeployInfo.Bridge, l1client) + Require(t, err) + tx, err := bridge.UpdateRollupAddress(&deployAuth, rollupAddresses.Rollup) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) + + time.Sleep(time.Second) + + if !stakerImpl.Stopped() { + t.Fatal("Old protocol staker not stopped after rollup upgrade") + } +} + +func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, info, *ethclient.Client, *params.ChainConfig, *arbnode.Node, bind.TransactOpts) { + var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs + l2chainConfig := params.ArbitrumDevTestChainConfig() + l2info := NewBlockChainTestInfo( + t, + types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), + transferGas, + ) + _, l2node, l2client, _, l1info, _, l1client, _ := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, l2chainConfig, nil, nil, l2info) + + config := arbnode.ConfigDefaultL1Test() + config.Sequencer.Enable = false + config.DelayedSequencer.Enable = false + config.BatchPoster.Enable = false + + BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) + + deployAuth := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + + balance := big.NewInt(params.Ether) + balance.Mul(balance, big.NewInt(100)) + l1info.GenerateAccount("Validator") + TransferBalance(t, "Faucet", "Validator", balance, l1info, l1client, ctx) + l1auth := l1info.GetDefaultTransactOpts("Validator", ctx) + + rollup, err := rollupgen.NewRollupAdminLogic(l2node.DeployInfo.Rollup, l1client) + Require(t, err) + + tx, err := rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(1)) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) + valConfig := staker.DefaultL1ValidatorConfig + valConfig.Strategy = "WatchTower" + valConfig.EnableBold = true + valConfig.StakerInterval = 100 * time.Millisecond + + dp, err := arbnode.ValidatorDataposter(rawdb.NewTable(l2node.ArbDB, storage.BlockValidatorPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) + if err != nil { + t.Fatalf("Error creating validator dataposter: %v", err) + } + valWallet, err := staker.NewContractValidatorWallet(dp, nil, l2node.DeployInfo.ValidatorWalletCreator, l2node.DeployInfo.Rollup, l2node.L1Reader, &l1auth, 0, func(common.Address) {}, 10000) + Require(t, err) + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + + stateless, err := staker.NewStatelessBlockValidator( + l2node.InboxReader, + l2node.InboxTracker, + l2node.TxStreamer, + l2node.Execution.Recorder, + l2node.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = stateless.Start(ctx) + Require(t, err) + stakerImpl, err := staker.NewStaker( + l2node.L1Reader, + valWallet, + bind.CallOpts{}, + valConfig, + nil, + stateless, + nil, + nil, + l2node.DeployInfo.ValidatorUtils, + l2node.DeployInfo.Bridge, + nil, + ) + Require(t, err) + return stakerImpl, l1info, l1client, l2chainConfig, l2node, deployAuth +} + +func deployBoldContracts( + t *testing.T, + ctx context.Context, + l1info info, + backend *ethclient.Client, + chainId *big.Int, + deployAuth bind.TransactOpts, +) *chaininfo.RollupAddresses { + stakeToken, tx, tokenBindings, err := mocksgen_bold.DeployTestWETH9( + &deployAuth, + backend, + "Weth", + "WETH", + ) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + value, _ := new(big.Int).SetString("1000000", 10) + deployAuth.Value = value + tx, err = tokenBindings.Deposit(&deployAuth) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + deployAuth.Value = nil + Require(t, err) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + + initialBalance := new(big.Int).Lsh(big.NewInt(1), 200) + l1info.GenerateGenesisAccount("deployer", initialBalance) + l1info.GenerateGenesisAccount("asserter", initialBalance) + l1info.GenerateGenesisAccount("sequencer", initialBalance) + SendWaitTestTransactions(t, ctx, backend, []*types.Transaction{ + l1info.PrepareTx("Faucet", "RollupOwner", 30000, initialBalance, nil)}) + l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + locator, err := server_common.NewMachineLocator("") + Require(t, err) + + cfg := challenge_testing.GenerateRollupConfig( + false, + locator.LatestWasmModuleRoot(), + l1TransactionOpts.From, + chainId, + common.Address{}, + big.NewInt(1), + stakeToken, + ) + config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) + if err != nil { + return nil + } + cfg.ChainConfig = string(config) + + addresses, err := setup.DeployFullRollupStack( + ctx, + backend, + &l1TransactionOpts, + l1info.GetAddress("sequencer"), + cfg, + false, + ) + Require(t, err) + + return &chaininfo.RollupAddresses{ + Bridge: addresses.Bridge, + Inbox: addresses.Inbox, + SequencerInbox: addresses.SequencerInbox, + Rollup: addresses.Rollup, + ValidatorUtils: addresses.ValidatorUtils, + ValidatorWalletCreator: addresses.ValidatorWalletCreator, + DeployedAt: addresses.DeployedAt, + } +} From 1cd98193c58100cc806792e3cb259392430e6eb0 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 12 Sep 2023 21:02:31 +0530 Subject: [PATCH 019/126] add CollectProof --- staker/state_provider.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/staker/state_provider.go b/staker/state_provider.go index 12a3e670d6..7e652401d5 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -710,6 +710,29 @@ func (s *StateManager) CollectMachineMashes( ) } +// CollectProof Collects osp of at a message number and OpcodeIndex . +func (s *StateManager) CollectProof( + ctx context.Context, + wasmModuleRoot common.Hash, + messageNumber l2stateprovider.Height, + machineIndex l2stateprovider.OpcodeIndex, +) ([]byte, error) { + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(messageNumber)) + if err != nil { + return nil, err + } + input, err := entry.ToInput() + if err != nil { + return nil, err + } + execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + if err != nil { + return nil, err + } + oneStepProofPromise := execRun.GetProofAt(uint64(machineIndex)) + return oneStepProofPromise.Await(ctx) +} + func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, startHeight []l2stateprovider.Height, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { cacheKey := &challengecache.Key{ WavmModuleRoot: wasmModuleRoot, From 09407828863ecc6e7984197b5d932edd04f3e9be Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 19 Sep 2023 15:53:12 +0530 Subject: [PATCH 020/126] use pr 440 of bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index edfc0156b1..98bda6d104 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit edfc0156b115b0e679fbb7e2b7f11050165870be +Subproject commit 98bda6d1047d3c7273f324866b3909c27410e88a From 46c81d2df50a365ed2cc7ad3cf24a810fa3bde79 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 19 Sep 2023 16:19:55 +0530 Subject: [PATCH 021/126] update based on pr 440 of bold --- staker/manager.go | 28 +- staker/state_provider.go | 445 +----------------- ...assertion_on_large_number_of_batch_test.go | 2 +- system_tests/manager_test.go | 298 +----------- 4 files changed, 24 insertions(+), 749 deletions(-) diff --git a/staker/manager.go b/staker/manager.go index 01f7d3b908..8790a14374 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -4,11 +4,11 @@ package staker import ( "context" - "math/big" solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" challengemanager "github.com/OffchainLabs/bold/challenge-manager" "github.com/OffchainLabs/bold/challenge-manager/types" + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/solgen/go/challengeV2gen" "github.com/OffchainLabs/bold/solgen/go/rollupgen" @@ -52,43 +52,39 @@ func NewManager( if err != nil { return nil, err } - bigStepEdgeHeight, err := managerBinding.LAYERZEROBIGSTEPEDGEHEIGHT(&callOpts) - if err != nil { - return nil, err - } - smallStepEdgeHeight, err := managerBinding.LAYERZEROSMALLSTEPEDGEHEIGHT(&callOpts) - if err != nil { - return nil, err - } numBigStepLevel, err := managerBinding.NUMBIGSTEPLEVEL(&callOpts) if err != nil { return nil, err } - challengeLeafHeights := make([]uint64, numBigStepLevel.Uint64()+2) + challengeLeafHeights := make([]l2stateprovider.Height, numBigStepLevel.Uint64()+2) for i := uint64(0); i <= numBigStepLevel.Uint64()+1; i++ { - leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, big.NewInt(i)) + leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, uint8(i)) if err != nil { return nil, err } - challengeLeafHeights[i] = leafHeight.Uint64() + challengeLeafHeights[i] = l2stateprovider.Height(leafHeight.Uint64()) } stateManager, err := NewStateManager( statelessBlockValidator, - nil, - smallStepEdgeHeight.Uint64(), - bigStepEdgeHeight.Uint64()*smallStepEdgeHeight.Uint64(), historyCacheBaseDir, challengeLeafHeights, ) if err != nil { return nil, err } + provider := l2stateprovider.NewHistoryCommitmentProvider( + stateManager, + stateManager, + stateManager, + challengeLeafHeights, + stateManager, + ) manager, err := challengemanager.New( ctx, chain, client, - stateManager, + provider, rollupAddress, challengemanager.WithMode(types.MakeMode), ) diff --git a/staker/state_provider.go b/staker/state_provider.go index 7e652401d5..e939943304 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -15,19 +15,16 @@ import ( protocol "github.com/OffchainLabs/bold/chain-abstraction" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" - "github.com/OffchainLabs/bold/solgen/go/rollupgen" - commitments "github.com/OffchainLabs/bold/state-commitments/history" - prefixproofs "github.com/OffchainLabs/bold/state-commitments/prefix-proofs" - "github.com/offchainlabs/nitro/arbutil" challengecache "github.com/offchainlabs/nitro/staker/challenge-cache" "github.com/offchainlabs/nitro/validator" ) var ( - _ l2stateprovider.Provider = (*StateManager)(nil) + _ l2stateprovider.ProofCollector = (*StateManager)(nil) _ l2stateprovider.L2MessageStateCollector = (*StateManager)(nil) _ l2stateprovider.MachineHashCollector = (*StateManager)(nil) + _ l2stateprovider.ExecutionProvider = (*StateManager)(nil) ) // Defines the ABI encoding structure for submission of prefix proofs to the protocol contracts @@ -42,25 +39,18 @@ var ( var ( ErrChainCatchingUp = errors.New("chain catching up") - emptyCommit = commitments.History{} ) type StateManager struct { validator *StatelessBlockValidator - blockValidator *BlockValidator - numOpcodesPerBigStep uint64 - maxWavmOpcodes uint64 historyCache challengecache.HistoryCommitmentCacher - challengeLeafHeights []uint64 + challengeLeafHeights []l2stateprovider.Height } -func NewStateManager(val *StatelessBlockValidator, blockValidator *BlockValidator, numOpcodesPerBigStep uint64, maxWavmOpcodes uint64, cacheBaseDir string, challengeLeafHeights []uint64) (*StateManager, error) { +func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challengeLeafHeights []l2stateprovider.Height) (*StateManager, error) { historyCache := challengecache.New(cacheBaseDir) return &StateManager{ validator: val, - blockValidator: blockValidator, - numOpcodesPerBigStep: numOpcodesPerBigStep, - maxWavmOpcodes: maxWavmOpcodes, historyCache: historyCache, challengeLeafHeights: challengeLeafHeights, }, nil @@ -113,7 +103,7 @@ func (s *StateManager) ExecutionStateAtMessageNumber(ctx context.Context, messag return executionState, nil } -func (s *StateManager) executionStateAtMessageNumberImpl(ctx context.Context, messageNumber uint64) (*protocol.ExecutionState, error) { +func (s *StateManager) executionStateAtMessageNumberImpl(_ context.Context, messageNumber uint64) (*protocol.ExecutionState, error) { batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(messageNumber)) if err != nil { return &protocol.ExecutionState{}, err @@ -135,415 +125,6 @@ func (s *StateManager) executionStateAtMessageNumberImpl(ctx context.Context, me }, nil } -// HistoryCommitmentAtMessage Produces a block history commitment of messageCount. -func (s *StateManager) HistoryCommitmentAtMessage(ctx context.Context, messageNumber uint64) (commitments.History, error) { - batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(messageNumber)) - if err != nil { - return commitments.History{}, err - } - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(messageNumber) - if err != nil { - return commitments.History{}, err - } - if batchMsgCount <= arbutil.MessageIndex(messageNumber) { - batch++ - } - stateRoot, err := s.getHashAtMessageCountAndBatch(ctx, arbutil.MessageIndex(messageNumber), batch) - if err != nil { - return commitments.History{}, err - } - return commitments.New([]common.Hash{stateRoot}) -} - -func (s *StateManager) HistoryCommitmentAtBatch(ctx context.Context, batchNumber uint64) (commitments.History, error) { - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchNumber) - if err != nil { - return commitments.History{}, err - } - res, err := s.validator.streamer.ResultAtCount(batchMsgCount - 1) - if err != nil { - return commitments.History{}, err - } - state := validator.GoGlobalState{ - BlockHash: res.BlockHash, - SendRoot: res.SendRoot, - Batch: batchNumber, - PosInBatch: 0, - } - machineHash := crypto.Keccak256Hash([]byte("Machine finished:"), state.Hash().Bytes()) - return commitments.New([]common.Hash{machineHash}) -} - -// BigStepCommitmentUpTo Produces a big step history commitment from big step 0 to toBigStep within block -// challenge heights blockHeight and blockHeight+1. -func (s *StateManager) BigStepCommitmentUpTo(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, toBigStep uint64) (commitments.History, error) { - result, err := s.intermediateBigStepLeaves(ctx, wasmModuleRoot, messageNumber, toBigStep) - if err != nil { - return commitments.History{}, err - } - return commitments.New(result) -} - -// SmallStepCommitmentUpTo Produces a small step history commitment from small step 0 to N between -// big steps bigStep to bigStep+1 within block challenge heights blockHeight to blockHeight+1. -func (s *StateManager) SmallStepCommitmentUpTo(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, bigStep uint64, toSmallStep uint64) (commitments.History, error) { - result, err := s.intermediateSmallStepLeaves(ctx, wasmModuleRoot, messageNumber, bigStep, toSmallStep) - if err != nil { - return commitments.History{}, err - } - return commitments.New(result) -} - -// HistoryCommitmentUpToBatch Produces a block challenge history commitment in a certain inclusive block range, -// but padding states with duplicates after the first state with a batch count of at least the specified max. -func (s *StateManager) HistoryCommitmentUpToBatch(ctx context.Context, messageNumberStart uint64, messageNumberEnd uint64, nextBatchCount uint64) (commitments.History, error) { - stateRoots, err := s.statesUpTo(messageNumberStart, messageNumberEnd, nextBatchCount) - if err != nil { - return commitments.History{}, err - } - return commitments.New(stateRoots) -} - -// BigStepLeafCommitment Produces a big step history commitment for all big steps within block -// challenge heights blockHeight to blockHeight+1. -func (s *StateManager) BigStepLeafCommitment(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64) (commitments.History, error) { - // Number of big steps between assertion heights A and B will be - // fixed. It is simply the max number of opcodes - // per block divided by the size of a big step. - numBigSteps := s.maxWavmOpcodes / s.numOpcodesPerBigStep - return s.BigStepCommitmentUpTo(ctx, wasmModuleRoot, messageNumber, numBigSteps) -} - -// SmallStepLeafCommitment Produces a small step history commitment for all small steps between -// big steps bigStep to bigStep+1 within block challenge heights blockHeight to blockHeight+1. -func (s *StateManager) SmallStepLeafCommitment(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, bigStep uint64) (commitments.History, error) { - return s.SmallStepCommitmentUpTo( - ctx, - wasmModuleRoot, - messageNumber, - bigStep, - s.numOpcodesPerBigStep, - ) -} - -// PrefixProofUpToBatch Produces a prefix proof in a block challenge from height A to B, -// but padding states with duplicates after the first state with a batch count of at least the specified max. -func (s *StateManager) PrefixProofUpToBatch( - ctx context.Context, - startHeight, - fromMessageNumber, - toMessageNumber, - batchCount uint64, -) ([]byte, error) { - if toMessageNumber > batchCount { - return nil, errors.New("toMessageNumber should not be greater than batchCount") - } - states, err := s.statesUpTo(startHeight, toMessageNumber, batchCount) - if err != nil { - return nil, err - } - loSize := fromMessageNumber + 1 - startHeight - hiSize := toMessageNumber + 1 - startHeight - return s.getPrefixProof(loSize, hiSize, states) -} - -// BigStepPrefixProof Produces a big step prefix proof from height A to B for heights fromBlockChallengeHeight to H+1 -// within a block challenge. -func (s *StateManager) BigStepPrefixProof( - ctx context.Context, - wasmModuleRoot common.Hash, - messageNumber uint64, - fromBigStep uint64, - toBigStep uint64, -) ([]byte, error) { - prefixLeaves, err := s.intermediateBigStepLeaves(ctx, wasmModuleRoot, messageNumber, toBigStep) - if err != nil { - return nil, err - } - loSize := fromBigStep + 1 - hiSize := toBigStep + 1 - return s.getPrefixProof(loSize, hiSize, prefixLeaves) -} - -// SmallStepPrefixProof Produces a small step prefix proof from height A to B for big step S to S+1 and -// block challenge height heights H to H+1. -func (s *StateManager) SmallStepPrefixProof(ctx context.Context, wasmModuleRoot common.Hash, messageNumber uint64, bigStep uint64, fromSmallStep uint64, toSmallStep uint64) ([]byte, error) { - prefixLeaves, err := s.intermediateSmallStepLeaves(ctx, wasmModuleRoot, messageNumber, bigStep, toSmallStep) - if err != nil { - return nil, err - } - loSize := fromSmallStep + 1 - hiSize := toSmallStep + 1 - return s.getPrefixProof(loSize, hiSize, prefixLeaves) -} - -// Like abi.NewType but panics if it fails for use in constants -func newStaticType(t string, internalType string, components []abi.ArgumentMarshaling) abi.Type { - ty, err := abi.NewType(t, internalType, components) - if err != nil { - panic(err) - } - return ty -} - -var bytes32Type = newStaticType("bytes32", "", nil) -var uint64Type = newStaticType("uint64", "", nil) -var uint8Type = newStaticType("uint8", "", nil) - -var WasmModuleProofAbi = abi.Arguments{ - { - Name: "lastHash", - Type: bytes32Type, - }, - { - Name: "assertionExecHash", - Type: bytes32Type, - }, - { - Name: "inboxAcc", - Type: bytes32Type, - }, -} - -var ExecutionStateAbi = abi.Arguments{ - { - Name: "b1", - Type: bytes32Type, - }, - { - Name: "b2", - Type: bytes32Type, - }, - { - Name: "u1", - Type: uint64Type, - }, - { - Name: "u2", - Type: uint64Type, - }, - { - Name: "status", - Type: uint8Type, - }, -} - -func (s *StateManager) OneStepProofData( - ctx context.Context, - wasmModuleRoot common.Hash, - postState rollupgen.ExecutionState, - messageNumber, - bigStep, - smallStep uint64, -) (*protocol.OneStepData, []common.Hash, []common.Hash, error) { - endCommit, err := s.SmallStepCommitmentUpTo( - ctx, - wasmModuleRoot, - messageNumber, - bigStep, - smallStep+1, - ) - if err != nil { - return nil, nil, nil, err - } - startCommit, err := s.SmallStepCommitmentUpTo( - ctx, - wasmModuleRoot, - messageNumber, - bigStep, - smallStep, - ) - if err != nil { - return nil, nil, nil, err - } - - step := bigStep*s.numOpcodesPerBigStep + smallStep - - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(messageNumber)) - if err != nil { - return nil, nil, nil, err - } - input, err := entry.ToInput() - if err != nil { - return nil, nil, nil, err - } - execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) - if err != nil { - return nil, nil, nil, err - } - - oneStepProofPromise := execRun.GetProofAt(step) - oneStepProof, err := oneStepProofPromise.Await(ctx) - if err != nil { - return nil, nil, nil, err - } - - machineStepPromise := execRun.GetStepAt(step) - machineStep, err := machineStepPromise.Await(ctx) - if err != nil { - return nil, nil, nil, err - } - beforeHash := machineStep.Hash - if beforeHash != startCommit.LastLeaf { - return nil, nil, nil, fmt.Errorf("machine executed to start step %v hash %v but expected %v", step, beforeHash, startCommit.LastLeaf) - } - - machineStepPromise = execRun.GetStepAt(step + 1) - machineStep, err = machineStepPromise.Await(ctx) - if err != nil { - return nil, nil, nil, err - } - afterHash := machineStep.Hash - if afterHash != endCommit.LastLeaf { - return nil, nil, nil, fmt.Errorf("machine executed to end step %v hash %v but expected %v", step+1, beforeHash, endCommit.LastLeaf) - } - - data := &protocol.OneStepData{ - BeforeHash: startCommit.LastLeaf, - Proof: oneStepProof, - } - return data, startCommit.LastLeafProof, endCommit.LastLeafProof, nil -} - -func (s *StateManager) AgreesWithHistoryCommitment( - ctx context.Context, - wasmModuleRoot common.Hash, - assertionInboxMaxCount uint64, - parentAssertionAfterStateBatch uint64, - edgeType protocol.EdgeType, - heights protocol.OriginHeights, - history l2stateprovider.History, -) (bool, error) { - var localCommit commitments.History - var err error - switch edgeType { - case protocol.BlockChallengeEdge: - localCommit, err = s.HistoryCommitmentUpToBatch(ctx, parentAssertionAfterStateBatch, parentAssertionAfterStateBatch+history.Height, assertionInboxMaxCount) - if err != nil { - return false, err - } - case protocol.BigStepChallengeEdge: - localCommit, err = s.BigStepCommitmentUpTo( - ctx, - wasmModuleRoot, - uint64(heights.BlockChallengeOriginHeight), - history.Height, - ) - if err != nil { - return false, err - } - case protocol.SmallStepChallengeEdge: - localCommit, err = s.SmallStepCommitmentUpTo( - ctx, - wasmModuleRoot, - uint64(heights.BlockChallengeOriginHeight), - uint64(heights.BigStepChallengeOriginHeight), - history.Height, - ) - if err != nil { - return false, err - } - default: - return false, errors.New("unsupported edge type") - } - return localCommit.Height == history.Height && localCommit.Merkle == history.MerkleRoot, nil -} - -func (s *StateManager) getPrefixProof(loSize uint64, hiSize uint64, leaves []common.Hash) ([]byte, error) { - prefixExpansion, err := prefixproofs.ExpansionFromLeaves(leaves[:loSize]) - if err != nil { - return nil, err - } - prefixProof, err := prefixproofs.GeneratePrefixProof( - loSize, - prefixExpansion, - leaves[loSize:hiSize], - prefixproofs.RootFetcherFromExpansion, - ) - if err != nil { - return nil, err - } - _, numRead := prefixproofs.MerkleExpansionFromCompact(prefixProof, loSize) - onlyProof := prefixProof[numRead:] - return ProofArgs.Pack(&prefixExpansion, &onlyProof) -} - -func (s *StateManager) intermediateBigStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, toBigStep uint64) ([]common.Hash, error) { - cacheKey := &challengecache.Key{ - WavmModuleRoot: wasmModuleRoot, - MessageHeight: protocol.Height(blockHeight), - StepHeights: nil, - } - cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toBigStep)) - if err == nil { - return cachedRoots, nil - } - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) - if err != nil { - return nil, err - } - input, err := entry.ToInput() - if err != nil { - return nil, err - } - execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) - if err != nil { - return nil, err - } - bigStepLeaves := execRun.GetBigStepLeavesUpTo(toBigStep, s.numOpcodesPerBigStep) - result, err := bigStepLeaves.Await(ctx) - if err != nil { - return nil, err - } - // TODO: Hacky workaround to avoid saving a history commitment to height 0. - if len(result) > 1 { - if err := s.historyCache.Put(cacheKey, result); err != nil { - if !errors.Is(err, challengecache.ErrFileAlreadyExists) { - return nil, err - } - } - } - return result, nil -} - -func (s *StateManager) intermediateSmallStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, bigStep uint64, toSmallStep uint64) ([]common.Hash, error) { - cacheKey := &challengecache.Key{ - WavmModuleRoot: wasmModuleRoot, - MessageHeight: protocol.Height(blockHeight), - StepHeights: []l2stateprovider.Height{l2stateprovider.Height(bigStep)}, - } - cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toSmallStep)) - if err == nil { - return cachedRoots, nil - } - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) - if err != nil { - return nil, err - } - input, err := entry.ToInput() - if err != nil { - return nil, err - } - execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) - if err != nil { - return nil, err - } - smallStepLeaves := execRun.GetSmallStepLeavesUpTo(bigStep, toSmallStep, s.numOpcodesPerBigStep) - result, err := smallStepLeaves.Await(ctx) - if err != nil { - return nil, err - } - // TODO: Hacky workaround to avoid saving a history commitment to height 0. - if len(result) > 1 { - if err := s.historyCache.Put(cacheKey, result); err != nil { - if !errors.Is(err, challengecache.ErrFileAlreadyExists) { - return nil, err - } - } - } - return result, nil -} - // TODO: Rename block to message. func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchCount uint64) ([]common.Hash, error) { if blockEnd < blockStart { @@ -636,14 +217,6 @@ func (s *StateManager) findBatchAfterMessageCount(msgCount arbutil.MessageIndex) } } -func (s *StateManager) getHashAtMessageCountAndBatch(_ context.Context, messageCount arbutil.MessageIndex, batch uint64) (common.Hash, error) { - gs, err := s.getInfoAtMessageCountAndBatch(messageCount, batch) - if err != nil { - return common.Hash{}, err - } - return crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), nil -} - func (s *StateManager) getInfoAtMessageCountAndBatch(messageCount arbutil.MessageIndex, batch uint64) (validator.GoGlobalState, error) { globalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, batch) if err != nil { @@ -680,7 +253,7 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes // and up to a required batch index. The hashes used for this commitment are the machine hashes // at each message number. func (s *StateManager) L2MessageStatesUpTo( - ctx context.Context, + _ context.Context, from l2stateprovider.Height, upTo option.Option[l2stateprovider.Height], batch l2stateprovider.Batch, @@ -690,13 +263,13 @@ func (s *StateManager) L2MessageStatesUpTo( to = upTo.Unwrap() } else { blockChallengeLeafHeight := s.challengeLeafHeights[0] - to = l2stateprovider.Height(blockChallengeLeafHeight) + to = blockChallengeLeafHeight } return s.statesUpTo(uint64(from), uint64(to), uint64(batch)) } -// CollectMachineMashes Collects a list of machine hashes at a message number based on some configuration parameters. -func (s *StateManager) CollectMachineMashes( +// CollectMachineHashes Collects a list of machine hashes at a message number based on some configuration parameters. +func (s *StateManager) CollectMachineHashes( ctx context.Context, cfg *l2stateprovider.HashCollectorConfig, ) ([]common.Hash, error) { return s.intermediateStepLeaves( diff --git a/system_tests/assertion_on_large_number_of_batch_test.go b/system_tests/assertion_on_large_number_of_batch_test.go index 6ffb152439..1b127333e4 100644 --- a/system_tests/assertion_on_large_number_of_batch_test.go +++ b/system_tests/assertion_on_large_number_of_batch_test.go @@ -65,7 +65,7 @@ func TestAssertionOnLargeNumberOfBatch(t *testing.T) { err = stateless.Start(ctx) Require(t, err) - manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir(), nil) + manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) Require(t, err) poster := assertions.NewPoster( diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index 076648eb8b..5b8759cc64 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -4,15 +4,12 @@ package arbtest import ( "context" - "github.com/offchainlabs/nitro/util/testhelpers" "math/big" "reflect" - "strings" "testing" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" @@ -20,17 +17,12 @@ import ( "github.com/offchainlabs/nitro/arbos/l2pricing" "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/util" - "github.com/offchainlabs/nitro/validator" + "github.com/offchainlabs/nitro/util/testhelpers" "github.com/offchainlabs/nitro/validator/valnode" protocol "github.com/OffchainLabs/bold/chain-abstraction" - commitments "github.com/OffchainLabs/bold/state-commitments/history" - prefixproofs "github.com/OffchainLabs/bold/state-commitments/prefix-proofs" ) -const numOpcodesPerBigStepTest = uint64(4) -const maxWavmOpcodesTest = uint64(20) - func TestExecutionStateMsgCount(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -69,292 +61,6 @@ func TestExecutionStateAtMessageNumber(t *testing.T) { Require(t, err) } -func TestHistoryCommitmentUpTo(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - res1, err := l2node.TxStreamer.ResultAtCount(1) - Require(t, err) - expectedHistoryCommitment, err := commitments.New( - []common.Hash{ - crypto.Keccak256Hash( - []byte("Machine finished:"), - validator.GoGlobalState{ - BlockHash: res1.BlockHash, - SendRoot: res1.SendRoot, - Batch: 1, - PosInBatch: 0, - }.Hash().Bytes(), - ), - }, - ) - Require(t, err) - historyCommitment, err := manager.HistoryCommitmentAtMessage(ctx, 1) - Require(t, err) - if !reflect.DeepEqual(historyCommitment, expectedHistoryCommitment) { - Fail(t, "Unexpected HistoryCommitment", historyCommitment, "(expected ", expectedHistoryCommitment, ")") - } -} - -func TestBigStepCommitmentUpTo(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - commitment, err := manager.BigStepCommitmentUpTo(ctx, common.Hash{}, 1, 3) - Require(t, err) - if commitment.Height != 3 { - Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", 3, ")") - } -} - -func TestSmallStepCommitmentUpTo(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - commitment, err := manager.SmallStepCommitmentUpTo(ctx, common.Hash{}, 1, 3, 2) - Require(t, err) - if commitment.Height != 2 { - Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", 2, ")") - } -} - -func TestHistoryCommitmentUpToBatch(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - res1, err := l2node.TxStreamer.ResultAtCount(1) - Require(t, err) - expectedHistoryCommitment, err := commitments.New( - []common.Hash{ - crypto.Keccak256Hash( - []byte("Machine finished:"), - validator.GoGlobalState{ - BlockHash: res1.BlockHash, - SendRoot: res1.SendRoot, - Batch: 1, - PosInBatch: 0, - }.Hash().Bytes(), - ), - crypto.Keccak256Hash( - []byte("Machine finished:"), - validator.GoGlobalState{ - BlockHash: res1.BlockHash, - SendRoot: res1.SendRoot, - Batch: 1, - PosInBatch: 0, - }.Hash().Bytes(), - ), - }, - ) - Require(t, err) - historyCommitment, err := manager.HistoryCommitmentUpToBatch(ctx, 1, 2, 2) - Require(t, err) - if !reflect.DeepEqual(historyCommitment, expectedHistoryCommitment) { - Fail(t, "Unexpected HistoryCommitment", historyCommitment, "(expected ", expectedHistoryCommitment, ")") - } -} - -func TestBigStepLeafCommitment(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - commitment, err := manager.BigStepLeafCommitment(ctx, common.Hash{}, 1) - Require(t, err) - numBigSteps := maxWavmOpcodesTest / numOpcodesPerBigStepTest - if commitment.Height != numBigSteps { - Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", numBigSteps, ")") - } -} - -func TestSmallStepLeafCommitment(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - commitment, err := manager.SmallStepLeafCommitment(ctx, common.Hash{}, 1, 3) - Require(t, err) - if commitment.Height != numOpcodesPerBigStepTest { - Fail(t, "Unexpected commitment height", commitment.Height, "(expected ", numOpcodesPerBigStepTest, ")") - } -} - -func TestAllPrefixProofs(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - - from := uint64(1) - to := uint64(3) - - loCommit, err := manager.HistoryCommitmentUpToBatch(ctx, 1, from, 10) - Require(t, err) - hiCommit, err := manager.HistoryCommitmentUpToBatch(ctx, 1, to, 10) - Require(t, err) - packedProof, err := manager.PrefixProofUpToBatch(ctx, 1, from, to, 10) - Require(t, err) - - data, err := staker.ProofArgs.Unpack(packedProof) - Require(t, err) - preExpansion, ok := data[0].([][32]byte) - if !ok { - Fatal(t, "bad output from packedProof") - } - proof, ok := data[1].([][32]byte) - if !ok { - Fatal(t, "bad output from packedProof") - } - - preExpansionHashes := make([]common.Hash, len(preExpansion)) - for i := 0; i < len(preExpansion); i++ { - preExpansionHashes[i] = preExpansion[i] - } - prefixProof := make([]common.Hash, len(proof)) - for i := 0; i < len(proof); i++ { - prefixProof[i] = proof[i] - } - - err = prefixproofs.VerifyPrefixProof(&prefixproofs.VerifyPrefixProofConfig{ - PreRoot: loCommit.Merkle, - PreSize: from, - PostRoot: hiCommit.Merkle, - PostSize: to, - PreExpansion: preExpansionHashes, - PrefixProof: prefixProof, - }) - Require(t, err) - - bigFrom := uint64(1) - - bigCommit, err := manager.BigStepLeafCommitment(ctx, common.Hash{}, from) - Require(t, err) - - bigBisectCommit, err := manager.BigStepCommitmentUpTo(ctx, common.Hash{}, from, bigFrom) - Require(t, err) - if bigFrom != bigBisectCommit.Height { - Fail(t, "Unexpected bigBisectCommit Height", bigBisectCommit.Height, "(expected ", bigFrom, ")") - } - if bigCommit.FirstLeaf != bigBisectCommit.FirstLeaf { - Fail(t, "Unexpected bigBisectCommit FirstLeaf", bigBisectCommit.FirstLeaf, "(expected ", bigCommit.FirstLeaf, ")") - } - - bigProof, err := manager.BigStepPrefixProof(ctx, common.Hash{}, from, bigFrom, bigCommit.Height) - Require(t, err) - - data, err = staker.ProofArgs.Unpack(bigProof) - Require(t, err) - preExpansion, ok = data[0].([][32]byte) - if !ok { - Fatal(t, "bad output from packedProof") - } - proof, ok = data[1].([][32]byte) - if !ok { - Fatal(t, "bad output from packedProof") - } - - preExpansionHashes = make([]common.Hash, len(preExpansion)) - for i := 0; i < len(preExpansion); i++ { - preExpansionHashes[i] = preExpansion[i] - } - prefixProof = make([]common.Hash, len(proof)) - for i := 0; i < len(proof); i++ { - prefixProof[i] = proof[i] - } - - computed, err := prefixproofs.Root(preExpansionHashes) - Require(t, err) - if bigBisectCommit.Merkle != computed { - Fail(t, "Unexpected bigBisectCommit Merkle", bigBisectCommit.Merkle, "(expected ", computed, ")") - } - - err = prefixproofs.VerifyPrefixProof(&prefixproofs.VerifyPrefixProofConfig{ - PreRoot: bigBisectCommit.Merkle, - PreSize: bigFrom + 1, - PostRoot: bigCommit.Merkle, - PostSize: bigCommit.Height + 1, - PreExpansion: preExpansionHashes, - PrefixProof: prefixProof, - }) - Require(t, err) - - smallCommit, err := manager.SmallStepLeafCommitment(ctx, common.Hash{}, from, bigFrom) - Require(t, err) - - smallFrom := uint64(2) - - smallBisectCommit, err := manager.SmallStepCommitmentUpTo(ctx, common.Hash{}, from, bigFrom, smallFrom) - Require(t, err) - if smallBisectCommit.Height != smallFrom { - Fail(t, "Unexpected smallBisectCommit Height", smallBisectCommit.Height, "(expected ", smallFrom, ")") - } - if smallBisectCommit.FirstLeaf != smallCommit.FirstLeaf { - Fail(t, "Unexpected smallBisectCommit FirstLeaf", smallBisectCommit.FirstLeaf, "(expected ", smallCommit.FirstLeaf, ")") - } - - smallProof, err := manager.SmallStepPrefixProof(ctx, common.Hash{}, from, bigFrom, smallFrom, smallCommit.Height) - Require(t, err) - - data, err = staker.ProofArgs.Unpack(smallProof) - Require(t, err) - preExpansion, ok = data[0].([][32]byte) - if !ok { - Fatal(t, "bad output from packedProof") - } - proof, ok = data[1].([][32]byte) - if !ok { - Fatal(t, "bad output from packedProof") - } - - preExpansionHashes = make([]common.Hash, len(preExpansion)) - for i := 0; i < len(preExpansion); i++ { - preExpansionHashes[i] = preExpansion[i] - } - prefixProof = make([]common.Hash, len(proof)) - for i := 0; i < len(proof); i++ { - prefixProof[i] = proof[i] - } - - computed, err = prefixproofs.Root(preExpansionHashes) - Require(t, err) - if smallBisectCommit.Merkle != computed { - Fail(t, "Unexpected smallBisectCommit Merkle", smallBisectCommit.Merkle, "(expected ", computed, ")") - } - - err = prefixproofs.VerifyPrefixProof(&prefixproofs.VerifyPrefixProofConfig{ - PreRoot: smallBisectCommit.Merkle, - PreSize: smallFrom + 1, - PostRoot: smallCommit.Merkle, - PostSize: smallCommit.Height + 1, - PreExpansion: preExpansionHashes, - PrefixProof: prefixProof, - }) - Require(t, err) -} - -func TestPrefixProofUpToBatchInvalidBatchCount(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - - _, err := manager.PrefixProofUpToBatch(ctx, 0, 0, 2, 1) - if err == nil || !strings.Contains(err.Error(), "toMessageNumber should not be greater than batchCount") { - Fail(t, "batch count", 1, "less than toMessageNumber", 2, "should not be allowed") - } -} func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, *staker.StateManager) { var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs l2chainConfig := params.ArbitrumDevTestChainConfig() @@ -398,7 +104,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, Require(t, err) err = stateless.Start(ctx) Require(t, err) - manager, err := staker.NewStateManager(stateless, nil, numOpcodesPerBigStepTest, maxWavmOpcodesTest, t.TempDir(), nil) + manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) Require(t, err) return l2node, l1stack, manager } From 8c0df58c9bb326ced9ad4d283ee48879335ed1b5 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 19 Sep 2023 16:39:36 +0530 Subject: [PATCH 022/126] minor fix --- bold | 2 +- go-ethereum | 2 +- nitro-testnode | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bold b/bold index e517fa7c4b..98bda6d104 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e517fa7c4b69052616b56f8d96e35c2f5207a382 +Subproject commit 98bda6d1047d3c7273f324866b3909c27410e88a diff --git a/go-ethereum b/go-ethereum index d312afd03b..b4bd0da114 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit d312afd03bba77aa2b4ea36e80b7308cd6528e80 +Subproject commit b4bd0da1142fe6bb81cac7e0794ebb4746b9885a diff --git a/nitro-testnode b/nitro-testnode index 14f24a1bad..7ad12c0f1b 160000 --- a/nitro-testnode +++ b/nitro-testnode @@ -1 +1 @@ -Subproject commit 14f24a1bad2625412602d06156156c380bd589d2 +Subproject commit 7ad12c0f1be75a72c7360d5258e0090f8225594e From 52934a83f07fbbbbcba460bf972288cc72c3f761 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 19 Sep 2023 16:48:18 +0530 Subject: [PATCH 023/126] minor fix --- system_tests/staker_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index edab59b8d5..4d979471fa 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/params" mocksgen_bold "github.com/OffchainLabs/bold/solgen/go/mocksgen" + rollupgen_bold "github.com/OffchainLabs/bold/solgen/go/rollupgen" challenge_testing "github.com/OffchainLabs/bold/testing" "github.com/OffchainLabs/bold/testing/setup" @@ -489,11 +490,11 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, info valConfig.EnableBold = true valConfig.StakerInterval = 100 * time.Millisecond - dp, err := arbnode.ValidatorDataposter(rawdb.NewTable(l2node.ArbDB, storage.BlockValidatorPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) + dp, err := arbnode.StakerDataposter(rawdb.NewTable(l2node.ArbDB, storage.StakerPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) if err != nil { t.Fatalf("Error creating validator dataposter: %v", err) } - valWallet, err := staker.NewContractValidatorWallet(dp, nil, l2node.DeployInfo.ValidatorWalletCreator, l2node.DeployInfo.Rollup, l2node.L1Reader, &l1auth, 0, func(common.Address) {}, 10000) + valWallet, err := staker.NewContractValidatorWallet(dp, nil, l2node.DeployInfo.ValidatorWalletCreator, l2node.DeployInfo.Rollup, l2node.L1Reader, &l1auth, 0, func(common.Address) {}, func() uint64 { return valConfig.ExtraGas }) Require(t, err) _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) blockValidatorConfig := staker.TestBlockValidatorConfig @@ -574,6 +575,12 @@ func deployBoldContracts( common.Address{}, big.NewInt(1), stakeToken, + rollupgen_bold.ExecutionState{ + GlobalState: rollupgen_bold.GlobalState{}, + MachineStatus: 1, + }, + big.NewInt(0), + common.Address{}, ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) if err != nil { From 7092ecdf10c921f0afc7cce5ad89e6b249a9ebef Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 20 Sep 2023 22:04:24 -0400 Subject: [PATCH 024/126] update commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 98bda6d104..735507480b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 98bda6d1047d3c7273f324866b3909c27410e88a +Subproject commit 735507480b18e83a93ba2ef1c62b993990018bf7 From dfee9b72e37834d29f5c41208bbedb39d239605c Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 11:17:09 -0400 Subject: [PATCH 025/126] update bold commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 735507480b..50a69e3d91 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 735507480b18e83a93ba2ef1c62b993990018bf7 +Subproject commit 50a69e3d91c088d91feb27e6ce03294d908dc71f From 48a3dc874da9adda47326ad75ecde3d3913cd9ec Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 11:31:06 -0400 Subject: [PATCH 026/126] protocol system test revisit --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 616 +++++++++++++++++++ 2 files changed, 617 insertions(+), 1 deletion(-) create mode 100644 system_tests/bold_challenge_protocol_test.go diff --git a/bold b/bold index 50a69e3d91..100ace7af6 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 50a69e3d91c088d91feb27e6ce03294d908dc71f +Subproject commit 100ace7af61062dba68098d09e728a8aed5e6f6c diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go new file mode 100644 index 0000000000..7502da8f61 --- /dev/null +++ b/system_tests/bold_challenge_protocol_test.go @@ -0,0 +1,616 @@ +package arbtest + +import ( + "context" + "encoding/hex" + "encoding/json" + "math/big" + "testing" + "time" + + "github.com/OffchainLabs/bold/assertions" + solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + challengemanager "github.com/OffchainLabs/bold/challenge-manager" + modes "github.com/OffchainLabs/bold/challenge-manager/types" + "github.com/OffchainLabs/bold/solgen/go/mocksgen" + challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing/setup" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/offchainlabs/nitro/arbnode" + "github.com/offchainlabs/nitro/arbnode/execution" + "github.com/offchainlabs/nitro/arbos/l2pricing" + "github.com/offchainlabs/nitro/cmd/chaininfo" + "github.com/offchainlabs/nitro/solgen/go/rollupgen" + "github.com/offchainlabs/nitro/staker" + "github.com/offchainlabs/nitro/statetransfer" + "github.com/offchainlabs/nitro/util" + "github.com/offchainlabs/nitro/util/signature" + "github.com/offchainlabs/nitro/validator/server_common" + "github.com/offchainlabs/nitro/validator/valnode" +) + +// One Arbitrum block had 1,849,212,947 total opcodes. The closest, higher power of two +// is 2^31. So we if we make our small step heights 2^20, we need 2048 big steps +// to cover the block. With 2^20, our small step history commitments will be approx +// 32 Mb of state roots in memory at once. +var ( + blockChallengeLeafHeight = uint64(1 << 5) // 32 + bigStepChallengeLeafHeight = uint64(2048) // this + the number below should be 2^43 total WAVM opcodes per block. + smallStepChallengeLeafHeight = uint64(1 << 20) +) + +func TestBoldProtocol(t *testing.T) { + t.Parallel() + ctx, cancelCtx := context.WithCancel(context.Background()) + defer cancelCtx() + var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs + l2chainConfig := params.ArbitrumDevTestChainConfig() + l2info := NewBlockChainTestInfo( + t, + types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), + transferGas, + ) + + _, l2nodeA, l2clientA, _, l1info, _, l1client, l1stack, assertionChain, stakeTokenAddr := createTestNodeOnL1ForBoldProtocol(t, ctx, true, nil, l2chainConfig, nil, l2info) + defer requireClose(t, l1stack) + defer l2nodeA.StopAndWait() + + l2clientB, l2nodeB, assertionChainB := create2ndNodeWithConfigForBoldProtocol(t, ctx, l2nodeA, l1stack, l1info, &l2info.ArbInitData, arbnode.ConfigDefaultL1Test(), nil, stakeTokenAddr) + defer l2nodeB.StopAndWait() + + nodeAGenesis := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() + nodeBGenesis := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() + if nodeAGenesis != nodeBGenesis { + Fail(t, "node A L2 genesis hash", nodeAGenesis, "!= node B L2 genesis hash", nodeBGenesis) + } + bridgeBalancesToBoldL2s(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2clientA, l2clientB, ctx) + + deployAuth := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + + balance := big.NewInt(params.Ether) + balance.Mul(balance, big.NewInt(100)) + TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + TransferBalance(t, "Faucet", "EvilAsserter", balance, l1info, l1client, ctx) + l1authB := l1info.GetDefaultTransactOpts("EvilAsserter", ctx) + + t.Log("Setting the minimum assertion period") + rollup, err := rollupgen.NewRollupAdminLogicTransactor(assertionChain.RollupAddress(), l1client) + Require(t, err) + tx, err := rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(0)) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) + rollup, err = rollupgen.NewRollupAdminLogicTransactor(assertionChainB.RollupAddress(), l1client) + Require(t, err) + tx, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(0)) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) + + valConfig := staker.L1ValidatorConfig{} + valConfig.Strategy = "MakeNodes" + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + + statelessA, err := staker.NewStatelessBlockValidator( + l2nodeA.InboxReader, + l2nodeA.InboxTracker, + l2nodeA.TxStreamer, + l2nodeA.Execution.Recorder, + l2nodeA.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = statelessA.Start(ctx) + Require(t, err) + + statelessB, err := staker.NewStatelessBlockValidator( + l2nodeB.InboxReader, + l2nodeB.InboxTracker, + l2nodeB.TxStreamer, + l2nodeB.Execution.Recorder, + l2nodeB.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = statelessB.Start(ctx) + Require(t, err) + + stateManager, err := staker.NewStateManager( + statelessA, + nil, + smallStepChallengeLeafHeight, + smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, + "/tmp/good", + ) + Require(t, err) + poster := assertions.NewPoster( + assertionChain, + stateManager, + "good", + time.Hour, + ) + + stateManagerB, err := staker.NewStateManager( + statelessB, + nil, + smallStepChallengeLeafHeight, + smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, + "/tmp/evil", + ) + Require(t, err) + chainB, err := solimpl.NewAssertionChain( + ctx, + assertionChain.RollupAddress(), + &l1authB, + l1client, + ) + Require(t, err) + posterB := assertions.NewPoster( + chainB, + stateManagerB, + "evil", + time.Hour, + ) + + t.Log("Sending a tx from faucet to L2 node A background user") + l2info.GenerateAccount("BackgroundUser") + tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big1, nil) + err = l2clientA.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l2clientA, tx) + Require(t, err) + + t.Log("Sending a tx from faucet to L2 node B background user") + l2info.Accounts["Faucet"].Nonce = 0 + tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big2, nil) + err = l2clientB.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l2clientB, tx) + Require(t, err) + + bcA, err := l2nodeA.InboxTracker.GetBatchCount() + Require(t, err) + bcB, err := l2nodeB.InboxTracker.GetBatchCount() + Require(t, err) + msgA, err := l2nodeA.InboxTracker.GetBatchMessageCount(bcA - 1) + Require(t, err) + msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) + Require(t, err) + accA, err := l2nodeA.InboxTracker.GetBatchAcc(bcA - 1) + Require(t, err) + accB, err := l2nodeB.InboxTracker.GetBatchAcc(bcB - 1) + Require(t, err) + t.Logf("Node A, count %d, msgs %d, acc %s", bcA, msgA, accA) + t.Logf("Node B, count %d, msgs %d, acc %s", bcB, msgB, accB) + + nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() + nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() + if nodeALatest == nodeBLatest { + Fail(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) + } + + t.Log("Honest party posting assertion at batch 1, pos 0") + _, err = poster.PostAssertion(ctx) + Require(t, err) + + time.Sleep(10 * time.Second) + + t.Log("Honest party posting assertion at batch 2, pos 0") + _, err = poster.PostAssertion(ctx) + Require(t, err) + + t.Log("Evil party posting rival assertion at batch 2, pos 0") + _, err = posterB.PostAssertion(ctx) + Require(t, err) + + manager, err := challengemanager.New( + ctx, + assertionChain, + l1client, + stateManager, + assertionChain.RollupAddress(), + challengemanager.WithName("honest"), + challengemanager.WithMode(modes.DefensiveMode), + challengemanager.WithAssertionPostingInterval(time.Hour), + challengemanager.WithAssertionScanningInterval(5*time.Second), + challengemanager.WithEdgeTrackerWakeInterval(time.Second), + ) + Require(t, err) + manager.Start(ctx) + + managerB, err := challengemanager.New( + ctx, + chainB, + l1client, + stateManagerB, + assertionChain.RollupAddress(), + challengemanager.WithName("evil"), + challengemanager.WithMode(modes.DefensiveMode), + challengemanager.WithAssertionPostingInterval(time.Hour), + challengemanager.WithAssertionScanningInterval(5*time.Second), + challengemanager.WithEdgeTrackerWakeInterval(time.Second), + ) + Require(t, err) + managerB.Start(ctx) + + // creationInfo, err := chainB.ReadAssertionCreationInfo(ctx, honest.Id()) + // Require(t, err) + + // entry, err := statelessA.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(1)) + // Require(t, err) + // input, err := entry.ToInput() + // Require(t, err) + // execRun, err := statelessA.ExecutionSpawner().CreateExecutionRun(creationInfo.WasmModuleRoot, input).Await(ctx) + // Require(t, err) + + // bigStepLeaves := execRun.GetBigStepLeavesUpTo(bigStepChallengeLeafHeight, smallStepChallengeLeafHeight) + // result, err := bigStepLeaves.Await(ctx) + // Require(t, err) + // t.Logf("Got result %d with first %#x and last %#x", len(result), result[0], result[len(result)-1]) + + // entry, err = statelessA.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(1)) + // Require(t, err) + // input, err = entry.ToInput() + // Require(t, err) + // execRun, err = statelessA.ExecutionSpawner().CreateExecutionRun(creationInfo.WasmModuleRoot, input).Await(ctx) + // Require(t, err) + + // t.Log("=======") + // bigStep := uint64(58) + // bigStepLeaves = execRun.GetSmallStepLeavesUpTo(bigStep, smallStepChallengeLeafHeight, smallStepChallengeLeafHeight) + // result, err = bigStepLeaves.Await(ctx) + // Require(t, err) + // t.Logf("Got result %d with first %#x and last %#x", len(result), result[0], result[len(result)-1]) + + // entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) + // input, err := entry.ToInput() + // execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + // bigStepLeaves := execRun.GetSmallStepLeavesUpTo(toBigStep, s.numOpcodesPerBigStep) + // result, err := bigStepLeaves.Await(ctx) + + time.Sleep(time.Hour) + +} + +func createTestNodeOnL1ForBoldProtocol( + t *testing.T, + ctx context.Context, + isSequencer bool, + nodeConfig *arbnode.Config, + chainConfig *params.ChainConfig, + stackConfig *node.Config, + l2info_in info, +) ( + l2info info, currentNode *arbnode.Node, l2client *ethclient.Client, l2stack *node.Node, + l1info info, l1backend *eth.Ethereum, l1client *ethclient.Client, l1stack *node.Node, + assertionChain *solimpl.AssertionChain, stakeTokenAddr common.Address, +) { + if nodeConfig == nil { + nodeConfig = arbnode.ConfigDefaultL1Test() + } + if chainConfig == nil { + chainConfig = params.ArbitrumDevTestChainConfig() + } + nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 + fatalErrChan := make(chan error, 10) + l1info, l1client, l1backend, l1stack = createTestL1BlockChain(t, nil) + var l2chainDb ethdb.Database + var l2arbDb ethdb.Database + var l2blockchain *core.BlockChain + l2info = l2info_in + if l2info == nil { + l2info = NewArbTestInfo(t, chainConfig.ChainID) + } + + l1info.GenerateAccount("RollupOwner") + l1info.GenerateAccount("Sequencer") + l1info.GenerateAccount("User") + l1info.GenerateAccount("Asserter") + l1info.GenerateAccount("EvilAsserter") + + SendWaitTestTransactions(t, ctx, l1client, []*types.Transaction{ + l1info.PrepareTx("Faucet", "RollupOwner", 30000, big.NewInt(9223372036854775807), nil), + l1info.PrepareTx("Faucet", "Sequencer", 30000, big.NewInt(9223372036854775807), nil), + l1info.PrepareTx("Faucet", "User", 30000, big.NewInt(9223372036854775807), nil), + l1info.PrepareTx("Faucet", "Asserter", 30000, big.NewInt(9223372036854775807), nil), + l1info.PrepareTx("Faucet", "EvilAsserter", 30000, big.NewInt(9223372036854775807), nil), + }) + + l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + stakeToken, tx, tokenBindings, err := mocksgen.DeployTestWETH9( + &l1TransactionOpts, + l1client, + "Weth", + "WETH", + ) + Require(t, err) + EnsureTxSucceeded(ctx, l1client, tx) + stakeTokenAddr = stakeToken + value, ok := new(big.Int).SetString("10000", 10) + if !ok { + t.Fatal(t, "could not set value") + } + l1TransactionOpts.Value = value + tx, err = tokenBindings.Deposit(&l1TransactionOpts) + Require(t, err) + EnsureTxSucceeded(ctx, l1client, tx) + l1TransactionOpts.Value = nil + + addresses, assertionChainBindings := deployContractsOnly(t, ctx, l1info, l1client, chainConfig.ChainID, stakeToken) + + l1info.SetContract("Bridge", addresses.Bridge) + l1info.SetContract("SequencerInbox", addresses.SequencerInbox) + l1info.SetContract("Inbox", addresses.Inbox) + + _, l2stack, l2chainDb, l2arbDb, l2blockchain = createL2BlockChainWithStackConfig(t, l2info, "", chainConfig, getInitMessage(ctx, t, l1client, addresses), stackConfig) + assertionChain = assertionChainBindings + var sequencerTxOptsPtr *bind.TransactOpts + var dataSigner signature.DataSignerFunc + if isSequencer { + sequencerTxOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) + sequencerTxOptsPtr = &sequencerTxOpts + dataSigner = signature.DataSignerFromPrivateKey(l1info.GetInfoWithPrivKey("Sequencer").PrivateKey) + } + + if !isSequencer { + nodeConfig.BatchPoster.Enable = false + nodeConfig.DelayedSequencer.Enable = false + } + + AddDefaultValNode(t, ctx, nodeConfig, true) + + currentNode, err = arbnode.CreateNode( + ctx, l2stack, l2chainDb, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain, l1client, + addresses, sequencerTxOptsPtr, sequencerTxOptsPtr, dataSigner, fatalErrChan, + ) + Require(t, err) + + Require(t, currentNode.Start(ctx)) + + l2client = ClientForStack(t, l2stack) + + StartWatchChanErr(t, ctx, fatalErrChan, currentNode) + + return +} + +func deployContractsOnly( + t *testing.T, + ctx context.Context, + l1info info, + backend *ethclient.Client, + chainId *big.Int, + stakeToken common.Address, +) (*chaininfo.RollupAddresses, *solimpl.AssertionChain) { + l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + locator, err := server_common.NewMachineLocator("") + Require(t, err) + wasmModuleRoot := locator.LatestWasmModuleRoot() + + prod := false + loserStakeEscrow := common.Address{} + miniStake := big.NewInt(1) + cfg := challenge_testing.GenerateRollupConfig( + prod, + wasmModuleRoot, + l1TransactionOpts.From, + chainId, + loserStakeEscrow, + miniStake, + stakeToken, + challenge_testing.WithLevelZeroHeights(&challenge_testing.LevelZeroHeights{ + BlockChallengeHeight: blockChallengeLeafHeight, + BigStepChallengeHeight: bigStepChallengeLeafHeight, + SmallStepChallengeHeight: smallStepChallengeLeafHeight, + }), + ) + config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) + Require(t, err) + cfg.ChainConfig = string(config) + addresses, err := setup.DeployFullRollupStack( + ctx, + backend, + &l1TransactionOpts, + l1info.GetAddress("Sequencer"), + cfg, + false, // do not use mock bridge. + ) + Require(t, err) + + asserter := l1info.GetDefaultTransactOpts("Asserter", ctx) + evilAsserter := l1info.GetDefaultTransactOpts("EvilAsserter", ctx) + chain, err := solimpl.NewAssertionChain( + ctx, + addresses.Rollup, + &asserter, + backend, + ) + Require(t, err) + + chalManager, err := chain.SpecChallengeManager(ctx) + Require(t, err) + chalManagerAddr := chalManager.Address() + seed, ok := new(big.Int).SetString("1000", 10) + if !ok { + t.Fatal("not ok") + } + value, ok := new(big.Int).SetString("10000", 10) + if !ok { + t.Fatal(t, "could not set value") + } + tokenBindings, err := mocksgen.NewTestWETH9(stakeToken, backend) + Require(t, err) + tx, err := tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, asserter.From, seed) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, addresses.Rollup, value) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, chalManagerAddr, value) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + + tx, err = tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, evilAsserter.From, seed) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&evilAsserter, addresses.Rollup, value) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&evilAsserter, chalManagerAddr, value) + Require(t, err) + EnsureTxSucceeded(ctx, backend, tx) + + return &chaininfo.RollupAddresses{ + Bridge: addresses.Bridge, + Inbox: addresses.Inbox, + SequencerInbox: addresses.SequencerInbox, + Rollup: addresses.Rollup, + ValidatorUtils: addresses.ValidatorUtils, + ValidatorWalletCreator: addresses.ValidatorWalletCreator, + DeployedAt: addresses.DeployedAt, + }, chain +} + +func bridgeBalancesToBoldL2s( + t *testing.T, account string, amount *big.Int, l1info info, l2info info, l1client client, l2clientA client, l2clientB client, ctx context.Context, +) (*types.Transaction, *types.Receipt) { + t.Helper() + + // setup or validate the same account on l2info + l1acct := l1info.GetInfoWithPrivKey(account) + if l2info.Accounts[account] == nil { + l2info.SetFullAccountInfo(account, &AccountInfo{ + Address: l1acct.Address, + PrivateKey: l1acct.PrivateKey, + Nonce: 0, + }) + } else { + l2acct := l2info.GetInfoWithPrivKey(account) + if l2acct.PrivateKey.X.Cmp(l1acct.PrivateKey.X) != 0 || + l2acct.PrivateKey.Y.Cmp(l1acct.PrivateKey.Y) != 0 { + Fatal(t, "l2 account already exists and not compatible to l1") + } + } + + // check previous balance + l2Balance, err := l2clientA.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) + Require(t, err) + l2BalanceB, err := l2clientB.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) + Require(t, err) + + // send transaction + data, err := hex.DecodeString("0f4d14e9000000000000000000000000000000000000000000000000000082f79cd90000") + Require(t, err) + tx := l1info.PrepareTx(account, "Inbox", l1info.TransferGas*100, amount, data) + err = l1client.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) + + tx = l1info.PrepareTx(account, "EvilInbox", l1info.TransferGas*100, amount, data) + err = l1client.SendTransaction(ctx, tx) + Require(t, err) + res, err := EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) + _ = res + + // wait for balance to appear in l2 + l2Balance.Add(l2Balance, amount) + l2BalanceB.Add(l2BalanceB, amount) + for i := 0; true; i++ { + balanceA, err := l2clientA.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) + Require(t, err) + balanceB, err := l2clientB.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) + Require(t, err) + if balanceA.Cmp(l2Balance) >= 0 && balanceB.Cmp(l2BalanceB) >= 0 { + t.Log("Balance was bridged to two L2 nodes successfully") + break + } + TransferBalance(t, "Faucet", "User", big.NewInt(1), l1info, l1client, ctx) + if i > 50 { + Fatal(t, "bridging failed") + } + <-time.After(time.Millisecond * 100) + } + + return tx, res +} + +func create2ndNodeWithConfigForBoldProtocol( + t *testing.T, + ctx context.Context, + first *arbnode.Node, + l1stack *node.Node, + l1info *BlockchainTestInfo, + l2InitData *statetransfer.ArbosInitializationInfo, + nodeConfig *arbnode.Config, + stackConfig *node.Config, + stakeTokenAddr common.Address, +) (*ethclient.Client, *arbnode.Node, *solimpl.AssertionChain) { + if nodeConfig == nil { + nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() + } + if nodeConfig == nil { + nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() + } + nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 + fatalErrChan := make(chan error, 10) + l1rpcClient, err := l1stack.Attach() + if err != nil { + Fatal(t, err) + } + l1client := ethclient.NewClient(l1rpcClient) + + if stackConfig == nil { + stackConfig = stackConfigForTest(t) + } + l2stack, err := node.New(stackConfig) + Require(t, err) + + l2chainDb, err := l2stack.OpenDatabase("chaindb", 0, 0, "", false) + Require(t, err) + l2arbDb, err := l2stack.OpenDatabase("arbdb", 0, 0, "", false) + Require(t, err) + + chainConfig := first.Execution.ArbInterface.BlockChain().Config() + addresses, assertionChain := deployContractsOnly(t, ctx, l1info, l1client, chainConfig.ChainID, stakeTokenAddr) + + l1info.SetContract("EvilBridge", addresses.Bridge) + l1info.SetContract("EvilSequencerInbox", addresses.SequencerInbox) + l1info.SetContract("EvilInbox", addresses.Inbox) + + AddDefaultValNode(t, ctx, nodeConfig, true) + + dataSigner := signature.DataSignerFromPrivateKey(l1info.GetInfoWithPrivKey("Sequencer").PrivateKey) + txOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) + + initReader := statetransfer.NewMemoryInitDataReader(l2InitData) + initMessage := getInitMessage(ctx, t, l1client, first.DeployInfo) + + l2blockchain, err := execution.WriteOrTestBlockChain(l2chainDb, nil, initReader, chainConfig, initMessage, arbnode.ConfigDefaultL2Test().TxLookupLimit, 0) + Require(t, err) + + l2node, err := arbnode.CreateNode(ctx, l2stack, l2chainDb, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain, l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan) + Require(t, err) + + Require(t, l2node.Start(ctx)) + + l2client := ClientForStack(t, l2stack) + + StartWatchChanErr(t, ctx, fatalErrChan, l2node) + + return l2client, l2node, assertionChain +} From dc8f7dc060b2e915a670f6d255d65ecb396dfed3 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 11:33:01 -0400 Subject: [PATCH 027/126] add in the sys test --- system_tests/bold_challenge_protocol_test.go | 290 +++++++++---------- 1 file changed, 143 insertions(+), 147 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 7502da8f61..3db0bb2981 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -8,10 +8,8 @@ import ( "testing" "time" - "github.com/OffchainLabs/bold/assertions" + protocol "github.com/OffchainLabs/bold/chain-abstraction" solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" - challengemanager "github.com/OffchainLabs/bold/challenge-manager" - modes "github.com/OffchainLabs/bold/challenge-manager/types" "github.com/OffchainLabs/bold/solgen/go/mocksgen" challenge_testing "github.com/OffchainLabs/bold/testing" "github.com/OffchainLabs/bold/testing/setup" @@ -29,12 +27,10 @@ import ( "github.com/offchainlabs/nitro/arbos/l2pricing" "github.com/offchainlabs/nitro/cmd/chaininfo" "github.com/offchainlabs/nitro/solgen/go/rollupgen" - "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/statetransfer" "github.com/offchainlabs/nitro/util" "github.com/offchainlabs/nitro/util/signature" "github.com/offchainlabs/nitro/validator/server_common" - "github.com/offchainlabs/nitro/validator/valnode" ) // One Arbitrum block had 1,849,212,947 total opcodes. The closest, higher power of two @@ -79,7 +75,7 @@ func TestBoldProtocol(t *testing.T) { balance.Mul(balance, big.NewInt(100)) TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) TransferBalance(t, "Faucet", "EvilAsserter", balance, l1info, l1client, ctx) - l1authB := l1info.GetDefaultTransactOpts("EvilAsserter", ctx) + //l1authB := l1info.GetDefaultTransactOpts("EvilAsserter", ctx) t.Log("Setting the minimum assertion period") rollup, err := rollupgen.NewRollupAdminLogicTransactor(assertionChain.RollupAddress(), l1client) @@ -95,156 +91,156 @@ func TestBoldProtocol(t *testing.T) { _, err = EnsureTxSucceeded(ctx, l1client, tx) Require(t, err) - valConfig := staker.L1ValidatorConfig{} - valConfig.Strategy = "MakeNodes" - _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) - blockValidatorConfig := staker.TestBlockValidatorConfig - - statelessA, err := staker.NewStatelessBlockValidator( - l2nodeA.InboxReader, - l2nodeA.InboxTracker, - l2nodeA.TxStreamer, - l2nodeA.Execution.Recorder, - l2nodeA.ArbDB, - nil, - StaticFetcherFrom(t, &blockValidatorConfig), - valStack, - ) - Require(t, err) - err = statelessA.Start(ctx) - Require(t, err) - - statelessB, err := staker.NewStatelessBlockValidator( - l2nodeB.InboxReader, - l2nodeB.InboxTracker, - l2nodeB.TxStreamer, - l2nodeB.Execution.Recorder, - l2nodeB.ArbDB, - nil, - StaticFetcherFrom(t, &blockValidatorConfig), - valStack, - ) - Require(t, err) - err = statelessB.Start(ctx) - Require(t, err) - - stateManager, err := staker.NewStateManager( - statelessA, - nil, - smallStepChallengeLeafHeight, - smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, - "/tmp/good", - ) - Require(t, err) - poster := assertions.NewPoster( - assertionChain, - stateManager, - "good", - time.Hour, - ) - - stateManagerB, err := staker.NewStateManager( - statelessB, - nil, - smallStepChallengeLeafHeight, - smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, - "/tmp/evil", - ) - Require(t, err) - chainB, err := solimpl.NewAssertionChain( - ctx, - assertionChain.RollupAddress(), - &l1authB, - l1client, - ) - Require(t, err) - posterB := assertions.NewPoster( - chainB, - stateManagerB, - "evil", - time.Hour, - ) + // valConfig := staker.L1ValidatorConfig{} + // valConfig.Strategy = "MakeNodes" + // _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + // blockValidatorConfig := staker.TestBlockValidatorConfig + + // statelessA, err := staker.NewStatelessBlockValidator( + // l2nodeA.InboxReader, + // l2nodeA.InboxTracker, + // l2nodeA.TxStreamer, + // l2nodeA.Execution.Recorder, + // l2nodeA.ArbDB, + // nil, + // StaticFetcherFrom(t, &blockValidatorConfig), + // valStack, + // ) + // Require(t, err) + // err = statelessA.Start(ctx) + // Require(t, err) - t.Log("Sending a tx from faucet to L2 node A background user") - l2info.GenerateAccount("BackgroundUser") - tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big1, nil) - err = l2clientA.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2clientA, tx) - Require(t, err) + // statelessB, err := staker.NewStatelessBlockValidator( + // l2nodeB.InboxReader, + // l2nodeB.InboxTracker, + // l2nodeB.TxStreamer, + // l2nodeB.Execution.Recorder, + // l2nodeB.ArbDB, + // nil, + // StaticFetcherFrom(t, &blockValidatorConfig), + // valStack, + // ) + // Require(t, err) + // err = statelessB.Start(ctx) + // Require(t, err) - t.Log("Sending a tx from faucet to L2 node B background user") - l2info.Accounts["Faucet"].Nonce = 0 - tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big2, nil) - err = l2clientB.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2clientB, tx) - Require(t, err) + // stateManager, err := staker.NewStateManager( + // statelessA, + // nil, + // smallStepChallengeLeafHeight, + // smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, + // "/tmp/good", + // ) + // Require(t, err) + // poster := assertions.NewPoster( + // assertionChain, + // stateManager, + // "good", + // time.Hour, + // ) + + // stateManagerB, err := staker.NewStateManager( + // statelessB, + // nil, + // smallStepChallengeLeafHeight, + // smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, + // "/tmp/evil", + // ) + // Require(t, err) + // chainB, err := solimpl.NewAssertionChain( + // ctx, + // assertionChain.RollupAddress(), + // &l1authB, + // l1client, + // ) + // Require(t, err) + // posterB := assertions.NewPoster( + // chainB, + // stateManagerB, + // "evil", + // time.Hour, + // ) + + // t.Log("Sending a tx from faucet to L2 node A background user") + // l2info.GenerateAccount("BackgroundUser") + // tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big1, nil) + // err = l2clientA.SendTransaction(ctx, tx) + // Require(t, err) + // _, err = EnsureTxSucceeded(ctx, l2clientA, tx) + // Require(t, err) - bcA, err := l2nodeA.InboxTracker.GetBatchCount() - Require(t, err) - bcB, err := l2nodeB.InboxTracker.GetBatchCount() - Require(t, err) - msgA, err := l2nodeA.InboxTracker.GetBatchMessageCount(bcA - 1) - Require(t, err) - msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) - Require(t, err) - accA, err := l2nodeA.InboxTracker.GetBatchAcc(bcA - 1) - Require(t, err) - accB, err := l2nodeB.InboxTracker.GetBatchAcc(bcB - 1) - Require(t, err) - t.Logf("Node A, count %d, msgs %d, acc %s", bcA, msgA, accA) - t.Logf("Node B, count %d, msgs %d, acc %s", bcB, msgB, accB) + // t.Log("Sending a tx from faucet to L2 node B background user") + // l2info.Accounts["Faucet"].Nonce = 0 + // tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big2, nil) + // err = l2clientB.SendTransaction(ctx, tx) + // Require(t, err) + // _, err = EnsureTxSucceeded(ctx, l2clientB, tx) + // Require(t, err) - nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() - nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() - if nodeALatest == nodeBLatest { - Fail(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) - } + // bcA, err := l2nodeA.InboxTracker.GetBatchCount() + // Require(t, err) + // bcB, err := l2nodeB.InboxTracker.GetBatchCount() + // Require(t, err) + // msgA, err := l2nodeA.InboxTracker.GetBatchMessageCount(bcA - 1) + // Require(t, err) + // msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) + // Require(t, err) + // accA, err := l2nodeA.InboxTracker.GetBatchAcc(bcA - 1) + // Require(t, err) + // accB, err := l2nodeB.InboxTracker.GetBatchAcc(bcB - 1) + // Require(t, err) + // t.Logf("Node A, count %d, msgs %d, acc %s", bcA, msgA, accA) + // t.Logf("Node B, count %d, msgs %d, acc %s", bcB, msgB, accB) - t.Log("Honest party posting assertion at batch 1, pos 0") - _, err = poster.PostAssertion(ctx) - Require(t, err) + // nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() + // nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() + // if nodeALatest == nodeBLatest { + // Fail(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) + // } - time.Sleep(10 * time.Second) + // t.Log("Honest party posting assertion at batch 1, pos 0") + // _, err = poster.PostAssertion(ctx) + // Require(t, err) - t.Log("Honest party posting assertion at batch 2, pos 0") - _, err = poster.PostAssertion(ctx) - Require(t, err) + // time.Sleep(10 * time.Second) - t.Log("Evil party posting rival assertion at batch 2, pos 0") - _, err = posterB.PostAssertion(ctx) - Require(t, err) + // t.Log("Honest party posting assertion at batch 2, pos 0") + // _, err = poster.PostAssertion(ctx) + // Require(t, err) - manager, err := challengemanager.New( - ctx, - assertionChain, - l1client, - stateManager, - assertionChain.RollupAddress(), - challengemanager.WithName("honest"), - challengemanager.WithMode(modes.DefensiveMode), - challengemanager.WithAssertionPostingInterval(time.Hour), - challengemanager.WithAssertionScanningInterval(5*time.Second), - challengemanager.WithEdgeTrackerWakeInterval(time.Second), - ) - Require(t, err) - manager.Start(ctx) + // t.Log("Evil party posting rival assertion at batch 2, pos 0") + // _, err = posterB.PostAssertion(ctx) + // Require(t, err) - managerB, err := challengemanager.New( - ctx, - chainB, - l1client, - stateManagerB, - assertionChain.RollupAddress(), - challengemanager.WithName("evil"), - challengemanager.WithMode(modes.DefensiveMode), - challengemanager.WithAssertionPostingInterval(time.Hour), - challengemanager.WithAssertionScanningInterval(5*time.Second), - challengemanager.WithEdgeTrackerWakeInterval(time.Second), - ) - Require(t, err) - managerB.Start(ctx) + // manager, err := challengemanager.New( + // ctx, + // assertionChain, + // l1client, + // stateManager, + // assertionChain.RollupAddress(), + // challengemanager.WithName("honest"), + // challengemanager.WithMode(modes.DefensiveMode), + // challengemanager.WithAssertionPostingInterval(time.Hour), + // challengemanager.WithAssertionScanningInterval(5*time.Second), + // challengemanager.WithEdgeTrackerWakeInterval(time.Second), + // ) + // Require(t, err) + // manager.Start(ctx) + + // managerB, err := challengemanager.New( + // ctx, + // chainB, + // l1client, + // stateManagerB, + // assertionChain.RollupAddress(), + // challengemanager.WithName("evil"), + // challengemanager.WithMode(modes.DefensiveMode), + // challengemanager.WithAssertionPostingInterval(time.Hour), + // challengemanager.WithAssertionScanningInterval(5*time.Second), + // challengemanager.WithEdgeTrackerWakeInterval(time.Second), + // ) + // Require(t, err) + // managerB.Start(ctx) // creationInfo, err := chainB.ReadAssertionCreationInfo(ctx, honest.Id()) // Require(t, err) @@ -411,7 +407,7 @@ func deployContractsOnly( loserStakeEscrow, miniStake, stakeToken, - challenge_testing.WithLevelZeroHeights(&challenge_testing.LevelZeroHeights{ + challenge_testing.WithLayerZeroHeights(&protocol.LayerZeroHeights{ BlockChallengeHeight: blockChallengeLeafHeight, BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, From 7ad381ea7cab32d3c76405f55f4b0466f2e63e3f Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 11:55:32 -0400 Subject: [PATCH 028/126] working on integration --- system_tests/bold_challenge_protocol_test.go | 129 +++++++++++-------- 1 file changed, 74 insertions(+), 55 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 3db0bb2981..7fda2aa8e2 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -8,9 +8,12 @@ import ( "testing" "time" + "github.com/OffchainLabs/bold/assertions" protocol "github.com/OffchainLabs/bold/chain-abstraction" solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/solgen/go/mocksgen" + "github.com/OffchainLabs/bold/solgen/go/rollupgen" challenge_testing "github.com/OffchainLabs/bold/testing" "github.com/OffchainLabs/bold/testing/setup" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -26,11 +29,12 @@ import ( "github.com/offchainlabs/nitro/arbnode/execution" "github.com/offchainlabs/nitro/arbos/l2pricing" "github.com/offchainlabs/nitro/cmd/chaininfo" - "github.com/offchainlabs/nitro/solgen/go/rollupgen" + "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/statetransfer" "github.com/offchainlabs/nitro/util" "github.com/offchainlabs/nitro/util/signature" "github.com/offchainlabs/nitro/validator/server_common" + "github.com/offchainlabs/nitro/validator/valnode" ) // One Arbitrum block had 1,849,212,947 total opcodes. The closest, higher power of two @@ -91,62 +95,68 @@ func TestBoldProtocol(t *testing.T) { _, err = EnsureTxSucceeded(ctx, l1client, tx) Require(t, err) - // valConfig := staker.L1ValidatorConfig{} - // valConfig.Strategy = "MakeNodes" - // _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) - // blockValidatorConfig := staker.TestBlockValidatorConfig - - // statelessA, err := staker.NewStatelessBlockValidator( - // l2nodeA.InboxReader, - // l2nodeA.InboxTracker, - // l2nodeA.TxStreamer, - // l2nodeA.Execution.Recorder, - // l2nodeA.ArbDB, - // nil, - // StaticFetcherFrom(t, &blockValidatorConfig), - // valStack, - // ) - // Require(t, err) - // err = statelessA.Start(ctx) - // Require(t, err) + valConfig := staker.L1ValidatorConfig{} + valConfig.Strategy = "MakeNodes" + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + + statelessA, err := staker.NewStatelessBlockValidator( + l2nodeA.InboxReader, + l2nodeA.InboxTracker, + l2nodeA.TxStreamer, + l2nodeA.Execution.Recorder, + l2nodeA.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = statelessA.Start(ctx) + Require(t, err) - // statelessB, err := staker.NewStatelessBlockValidator( - // l2nodeB.InboxReader, - // l2nodeB.InboxTracker, - // l2nodeB.TxStreamer, - // l2nodeB.Execution.Recorder, - // l2nodeB.ArbDB, - // nil, - // StaticFetcherFrom(t, &blockValidatorConfig), - // valStack, - // ) - // Require(t, err) - // err = statelessB.Start(ctx) - // Require(t, err) + statelessB, err := staker.NewStatelessBlockValidator( + l2nodeB.InboxReader, + l2nodeB.InboxTracker, + l2nodeB.TxStreamer, + l2nodeB.Execution.Recorder, + l2nodeB.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = statelessB.Start(ctx) + Require(t, err) - // stateManager, err := staker.NewStateManager( - // statelessA, - // nil, - // smallStepChallengeLeafHeight, - // smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, - // "/tmp/good", - // ) - // Require(t, err) - // poster := assertions.NewPoster( - // assertionChain, - // stateManager, - // "good", - // time.Hour, - // ) + stateManager, err := staker.NewStateManager( + statelessA, + "/tmp/good", + []l2stateprovider.Height{ + l2stateprovider.Height(blockChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(smallStepChallengeLeafHeight), + }, + ) + Require(t, err) + + poster := assertions.NewPoster( + assertionChain, + stateManager, + "good", + time.Hour, + ) + + stateManagerB, err := staker.NewStateManager( + statelessB, + "/tmp/evil", + []l2stateprovider.Height{ + l2stateprovider.Height(blockChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(smallStepChallengeLeafHeight), + }, + ) + Require(t, err) - // stateManagerB, err := staker.NewStateManager( - // statelessB, - // nil, - // smallStepChallengeLeafHeight, - // smallStepChallengeLeafHeight*bigStepChallengeLeafHeight, - // "/tmp/evil", - // ) - // Require(t, err) // chainB, err := solimpl.NewAssertionChain( // ctx, // assertionChain.RollupAddress(), @@ -351,7 +361,7 @@ func createTestNodeOnL1ForBoldProtocol( l1info.SetContract("SequencerInbox", addresses.SequencerInbox) l1info.SetContract("Inbox", addresses.Inbox) - _, l2stack, l2chainDb, l2arbDb, l2blockchain = createL2BlockChainWithStackConfig(t, l2info, "", chainConfig, getInitMessage(ctx, t, l1client, addresses), stackConfig) + _, l2stack, l2chainDb, l2arbDb, l2blockchain = createL2BlockChainWithStackConfig(t, l2info, "", chainConfig, getInitMessage(ctx, t, l1client, addresses), stackConfig, nil) assertionChain = assertionChainBindings var sequencerTxOptsPtr *bind.TransactOpts var dataSigner signature.DataSignerFunc @@ -399,6 +409,12 @@ func deployContractsOnly( prod := false loserStakeEscrow := common.Address{} miniStake := big.NewInt(1) + genesisExecutionState := rollupgen.ExecutionState{ + GlobalState: rollupgen.GlobalState{}, + MachineStatus: 1, + } + genesisInboxCount := big.NewInt(0) + anyTrustFastConfirmer := common.Address{} cfg := challenge_testing.GenerateRollupConfig( prod, wasmModuleRoot, @@ -407,6 +423,9 @@ func deployContractsOnly( loserStakeEscrow, miniStake, stakeToken, + genesisExecutionState, + genesisInboxCount, + anyTrustFastConfirmer, challenge_testing.WithLayerZeroHeights(&protocol.LayerZeroHeights{ BlockChallengeHeight: blockChallengeLeafHeight, BigStepChallengeHeight: bigStepChallengeLeafHeight, From 25637ff6ebe1ed534d15508ff960471ed1ae111b Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 12:02:13 -0400 Subject: [PATCH 029/126] posting assertions --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 144 ++++++++++--------- 2 files changed, 74 insertions(+), 72 deletions(-) diff --git a/bold b/bold index 100ace7af6..47151dcc5a 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 100ace7af61062dba68098d09e728a8aed5e6f6c +Subproject commit 47151dcc5ac15449c4c556c3a81cc5b0c327f727 diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 7fda2aa8e2..a8c92dcef2 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -11,6 +11,8 @@ import ( "github.com/OffchainLabs/bold/assertions" protocol "github.com/OffchainLabs/bold/chain-abstraction" solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + challengemanager "github.com/OffchainLabs/bold/challenge-manager" + modes "github.com/OffchainLabs/bold/challenge-manager/types" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/solgen/go/mocksgen" "github.com/OffchainLabs/bold/solgen/go/rollupgen" @@ -79,7 +81,7 @@ func TestBoldProtocol(t *testing.T) { balance.Mul(balance, big.NewInt(100)) TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) TransferBalance(t, "Faucet", "EvilAsserter", balance, l1info, l1client, ctx) - //l1authB := l1info.GetDefaultTransactOpts("EvilAsserter", ctx) + l1authB := l1info.GetDefaultTransactOpts("EvilAsserter", ctx) t.Log("Setting the minimum assertion period") rollup, err := rollupgen.NewRollupAdminLogicTransactor(assertionChain.RollupAddress(), l1client) @@ -157,85 +159,85 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) - // chainB, err := solimpl.NewAssertionChain( - // ctx, - // assertionChain.RollupAddress(), - // &l1authB, - // l1client, - // ) - // Require(t, err) - // posterB := assertions.NewPoster( - // chainB, - // stateManagerB, - // "evil", - // time.Hour, - // ) + chainB, err := solimpl.NewAssertionChain( + ctx, + assertionChain.RollupAddress(), + &l1authB, + l1client, + ) + Require(t, err) + posterB := assertions.NewPoster( + chainB, + stateManagerB, + "evil", + time.Hour, + ) - // t.Log("Sending a tx from faucet to L2 node A background user") - // l2info.GenerateAccount("BackgroundUser") - // tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big1, nil) - // err = l2clientA.SendTransaction(ctx, tx) - // Require(t, err) - // _, err = EnsureTxSucceeded(ctx, l2clientA, tx) - // Require(t, err) + t.Log("Sending a tx from faucet to L2 node A background user") + l2info.GenerateAccount("BackgroundUser") + tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big1, nil) + err = l2clientA.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l2clientA, tx) + Require(t, err) - // t.Log("Sending a tx from faucet to L2 node B background user") - // l2info.Accounts["Faucet"].Nonce = 0 - // tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big2, nil) - // err = l2clientB.SendTransaction(ctx, tx) - // Require(t, err) - // _, err = EnsureTxSucceeded(ctx, l2clientB, tx) - // Require(t, err) + t.Log("Sending a tx from faucet to L2 node B background user") + l2info.Accounts["Faucet"].Nonce = 0 + tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big2, nil) + err = l2clientB.SendTransaction(ctx, tx) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l2clientB, tx) + Require(t, err) - // bcA, err := l2nodeA.InboxTracker.GetBatchCount() - // Require(t, err) - // bcB, err := l2nodeB.InboxTracker.GetBatchCount() - // Require(t, err) - // msgA, err := l2nodeA.InboxTracker.GetBatchMessageCount(bcA - 1) - // Require(t, err) - // msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) - // Require(t, err) - // accA, err := l2nodeA.InboxTracker.GetBatchAcc(bcA - 1) - // Require(t, err) - // accB, err := l2nodeB.InboxTracker.GetBatchAcc(bcB - 1) - // Require(t, err) - // t.Logf("Node A, count %d, msgs %d, acc %s", bcA, msgA, accA) - // t.Logf("Node B, count %d, msgs %d, acc %s", bcB, msgB, accB) + bcA, err := l2nodeA.InboxTracker.GetBatchCount() + Require(t, err) + bcB, err := l2nodeB.InboxTracker.GetBatchCount() + Require(t, err) + msgA, err := l2nodeA.InboxTracker.GetBatchMessageCount(bcA - 1) + Require(t, err) + msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) + Require(t, err) + accA, err := l2nodeA.InboxTracker.GetBatchAcc(bcA - 1) + Require(t, err) + accB, err := l2nodeB.InboxTracker.GetBatchAcc(bcB - 1) + Require(t, err) + t.Logf("Node A, count %d, msgs %d, acc %s", bcA, msgA, accA) + t.Logf("Node B, count %d, msgs %d, acc %s", bcB, msgB, accB) - // nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() - // nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() - // if nodeALatest == nodeBLatest { - // Fail(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) - // } + nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() + nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() + if nodeALatest == nodeBLatest { + Fail(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) + } - // t.Log("Honest party posting assertion at batch 1, pos 0") - // _, err = poster.PostAssertion(ctx) - // Require(t, err) + t.Log("Honest party posting assertion at batch 1, pos 0") + _, err = poster.PostAssertion(ctx) + Require(t, err) - // time.Sleep(10 * time.Second) + time.Sleep(10 * time.Second) - // t.Log("Honest party posting assertion at batch 2, pos 0") - // _, err = poster.PostAssertion(ctx) - // Require(t, err) + t.Log("Honest party posting assertion at batch 2, pos 0") + _, err = poster.PostAssertion(ctx) + Require(t, err) - // t.Log("Evil party posting rival assertion at batch 2, pos 0") - // _, err = posterB.PostAssertion(ctx) - // Require(t, err) + t.Log("Evil party posting rival assertion at batch 2, pos 0") + _, err = posterB.PostAssertion(ctx) + Require(t, err) - // manager, err := challengemanager.New( - // ctx, - // assertionChain, - // l1client, - // stateManager, - // assertionChain.RollupAddress(), - // challengemanager.WithName("honest"), - // challengemanager.WithMode(modes.DefensiveMode), - // challengemanager.WithAssertionPostingInterval(time.Hour), - // challengemanager.WithAssertionScanningInterval(5*time.Second), - // challengemanager.WithEdgeTrackerWakeInterval(time.Second), - // ) - // Require(t, err) - // manager.Start(ctx) + manager, err := challengemanager.New( + ctx, + assertionChain, + l1client, + stateManager, + assertionChain.RollupAddress(), + challengemanager.WithName("honest"), + challengemanager.WithMode(modes.DefensiveMode), + // challengemanager.WithAssertionPostingInterval(time.Hour), + // challengemanager.WithAssertionScanningInterval(5*time.Second), + challengemanager.WithEdgeTrackerWakeInterval(time.Second), + ) + Require(t, err) + manager.Start(ctx) // managerB, err := challengemanager.New( // ctx, From 4b679188a5539a70440d48bb64cc842b8a42dbdf Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 12:08:44 -0400 Subject: [PATCH 030/126] posting scanning interval fixes --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 56 ++++++++++++++------ 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/bold b/bold index 47151dcc5a..a359415b32 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 47151dcc5ac15449c4c556c3a81cc5b0c327f727 +Subproject commit a359415b32d0dec6a88b5196c26c8fc011e3c590 diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index a8c92dcef2..16252c2af3 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -224,35 +224,57 @@ func TestBoldProtocol(t *testing.T) { _, err = posterB.PostAssertion(ctx) Require(t, err) + provider := l2stateprovider.NewHistoryCommitmentProvider( + stateManager, + stateManager, + stateManager, + []l2stateprovider.Height{ + l2stateprovider.Height(blockChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(smallStepChallengeLeafHeight), + }, + stateManager, + ) manager, err := challengemanager.New( ctx, assertionChain, l1client, - stateManager, + provider, assertionChain.RollupAddress(), challengemanager.WithName("honest"), challengemanager.WithMode(modes.DefensiveMode), - // challengemanager.WithAssertionPostingInterval(time.Hour), - // challengemanager.WithAssertionScanningInterval(5*time.Second), + challengemanager.WithAssertionPostingInterval(time.Hour), + challengemanager.WithAssertionScanningInterval(time.Hour), challengemanager.WithEdgeTrackerWakeInterval(time.Second), ) Require(t, err) manager.Start(ctx) - // managerB, err := challengemanager.New( - // ctx, - // chainB, - // l1client, - // stateManagerB, - // assertionChain.RollupAddress(), - // challengemanager.WithName("evil"), - // challengemanager.WithMode(modes.DefensiveMode), - // challengemanager.WithAssertionPostingInterval(time.Hour), - // challengemanager.WithAssertionScanningInterval(5*time.Second), - // challengemanager.WithEdgeTrackerWakeInterval(time.Second), - // ) - // Require(t, err) - // managerB.Start(ctx) + evilProvider := l2stateprovider.NewHistoryCommitmentProvider( + stateManagerB, + stateManagerB, + stateManagerB, + []l2stateprovider.Height{ + l2stateprovider.Height(blockChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(smallStepChallengeLeafHeight), + }, + stateManagerB, + ) + managerB, err := challengemanager.New( + ctx, + chainB, + l1client, + evilProvider, + assertionChain.RollupAddress(), + challengemanager.WithName("evil"), + challengemanager.WithMode(modes.DefensiveMode), + challengemanager.WithAssertionPostingInterval(time.Hour), + challengemanager.WithAssertionScanningInterval(time.Hour), + challengemanager.WithEdgeTrackerWakeInterval(time.Second), + ) + Require(t, err) + managerB.Start(ctx) // creationInfo, err := chainB.ReadAssertionCreationInfo(ctx, honest.Id()) // Require(t, err) From 8db7463c39b89fc6a46c1b1680b816e942194add Mon Sep 17 00:00:00 2001 From: amsanghi Date: Mon, 25 Sep 2023 21:59:50 +0530 Subject: [PATCH 031/126] updated commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 98bda6d104..100ace7af6 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 98bda6d1047d3c7273f324866b3909c27410e88a +Subproject commit 100ace7af61062dba68098d09e728a8aed5e6f6c From 7e52efb3f96fde99c8dba65b10b1200c7e00b44b Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 15:40:29 -0400 Subject: [PATCH 032/126] fix regen --- bold | 2 +- staker/state_provider.go | 7 ++++++- system_tests/bold_challenge_protocol_test.go | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bold b/bold index a359415b32..8c132845e0 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit a359415b32d0dec6a88b5196c26c8fc011e3c590 +Subproject commit 8c132845e05d47755e76924370d7ec5f9c362226 diff --git a/staker/state_provider.go b/staker/state_provider.go index e939943304..99ff49d8c9 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -265,7 +265,12 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - return s.statesUpTo(uint64(from), uint64(to), uint64(batch)) + items, err := s.statesUpTo(uint64(from), uint64(to), uint64(batch)) + if err != nil { + return nil, err + } + fmt.Printf("In nitro, states from %d to %d, batch %d got num hashes %d\n", from, to, batch, len(items)) + return items, nil } // CollectMachineHashes Collects a list of machine hashes at a message number based on some configuration parameters. diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 16252c2af3..eace33f826 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -455,6 +455,7 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), + challenge_testing.WithNumBigStepLevels(new(big.Int).SetUint64(1)), ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) From 94614558095442f066d546a55da424dbf419cfa8 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 16:04:58 -0400 Subject: [PATCH 033/126] debugging --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 8c132845e0..7a88470abd 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 8c132845e05d47755e76924370d7ec5f9c362226 +Subproject commit 7a88470abd36acb7cacc3135fb96b1c93d6f0b71 From 4e2ea7c7d40ce241c182f365bd67661eb18f023e Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 17:21:15 -0400 Subject: [PATCH 034/126] regen --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 7a88470abd..abb2a99658 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 7a88470abd36acb7cacc3135fb96b1c93d6f0b71 +Subproject commit abb2a99658c989e665722ce61346d376cf27c711 From d5df0684da249974485fba03bc9674c09f1545fe Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 17:28:13 -0400 Subject: [PATCH 035/126] update sub --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index abb2a99658..9003ee1214 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit abb2a99658c989e665722ce61346d376cf27c711 +Subproject commit 9003ee1214a47beef3d331be07ff31f0f0bc39a4 From d1d4565a2d843291325fae9622a67d51b365a4ac Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 18:49:04 -0400 Subject: [PATCH 036/126] working up to subchallenges --- bold | 2 +- staker/state_provider.go | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/bold b/bold index 9003ee1214..e9d5037e5c 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 9003ee1214a47beef3d331be07ff31f0f0bc39a4 +Subproject commit e9d5037e5c05be12ce8a9c75b623e8650668beaa diff --git a/staker/state_provider.go b/staker/state_provider.go index 99ff49d8c9..12d4815aa3 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -312,18 +312,18 @@ func (s *StateManager) CollectProof( } func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, startHeight []l2stateprovider.Height, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { - cacheKey := &challengecache.Key{ - WavmModuleRoot: wasmModuleRoot, - MessageHeight: protocol.Height(blockHeight), - StepHeights: startHeight, - } + // cacheKey := &challengecache.Key{ + // WavmModuleRoot: wasmModuleRoot, + // MessageHeight: protocol.Height(blockHeight), + // StepHeights: startHeight, + // // } // Make sure that the last level starts with 0 - if startHeight[len(startHeight)-1] == 0 { - cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toStep)) - if err == nil { - return cachedRoots, nil - } - } + // if startHeight[len(startHeight)-1] == 0 { + // cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toStep)) + // if err == nil { + // return cachedRoots, nil + // } + // } entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) if err != nil { return nil, err @@ -343,14 +343,14 @@ func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoo } // TODO: Hacky workaround to avoid saving a history commitment to height 0. if len(result) > 1 { - // Make sure that the last level starts with 0 - if startHeight[len(startHeight)-1] == 0 { - if err := s.historyCache.Put(cacheKey, result); err != nil { - if !errors.Is(err, challengecache.ErrFileAlreadyExists) { - return nil, err - } - } - } + // // Make sure that the last level starts with 0 + // if startHeight[len(startHeight)-1] == 0 { + // if err := s.historyCache.Put(cacheKey, result); err != nil { + // if !errors.Is(err, challengecache.ErrFileAlreadyExists) { + // return nil, err + // } + // } + // } } return result, nil } From 49321d2443edf2fedf1dfc9ecac4c09e057d6eb5 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 25 Sep 2023 18:49:24 -0400 Subject: [PATCH 037/126] update sub --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index e9d5037e5c..64f85f2090 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e9d5037e5c05be12ce8a9c75b623e8650668beaa +Subproject commit 64f85f2090eded136fb2022d31db36b352d29302 From f539d0b053a445148002f615d7111cc5994d9ab3 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 27 Sep 2023 13:57:33 -0400 Subject: [PATCH 038/126] fixes --- staker/challenge-cache/cache.go | 20 ++++--- staker/state_provider.go | 63 +++++++++++++------- system_tests/bold_challenge_protocol_test.go | 6 +- validator/interface.go | 2 - validator/server_api/valiation_api.go | 26 -------- validator/server_arb/execution_run.go | 53 +++++----------- 6 files changed, 71 insertions(+), 99 deletions(-) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 87a11584af..2388d0d55b 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -53,7 +53,7 @@ var ( // HistoryCommitmentCacher can retrieve history commitment state roots given lookup keys. type HistoryCommitmentCacher interface { - Get(lookup *Key, readUpTo protocol.Height) ([]common.Hash, error) + Get(lookup *Key, numToRead uint64) ([]common.Hash, error) Put(lookup *Key, stateRoots []common.Hash) error } @@ -82,15 +82,18 @@ type Key struct { // is returned. func (c *Cache) Get( lookup *Key, - readUpTo protocol.Height, + numToRead uint64, ) ([]common.Hash, error) { fName, err := determineFilePath(c.baseDir, lookup) if err != nil { return nil, err } + fmt.Printf("Trying to open file %s\n", fName) if _, err := os.Stat(fName); err != nil { + fmt.Printf("Not found %s\n", fName) return nil, ErrNotFoundInCache } + fmt.Println("Found!") f, err := os.Open(fName) if err != nil { return nil, err @@ -100,7 +103,7 @@ func (c *Cache) Get( log.Error("Could not close file after reading", "err", err, "file", fName) } }() - return readStateRoots(f, readUpTo) + return readStateRoots(f, numToRead) } // Put a list of state roots into the cache. @@ -135,6 +138,7 @@ func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { log.Error("Could not close file after writing", "err", err, "file", fName) } }() + fmt.Printf("Writing %d state roots to file %s", len(stateRoots), fName) if err := writeStateRoots(f, stateRoots); err != nil { return err } @@ -149,7 +153,7 @@ func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { } // Reads 32 bytes at a time from a reader up to a specified height. If none, then read all. -func readStateRoots(r io.Reader, readUpTo protocol.Height) ([]common.Hash, error) { +func readStateRoots(r io.Reader, numToRead uint64) ([]common.Hash, error) { br := bufio.NewReader(r) stateRoots := make([]common.Hash, 0) buf := make([]byte, 0, 32) @@ -168,15 +172,15 @@ func readStateRoots(r io.Reader, readUpTo protocol.Height) ([]common.Hash, error return nil, fmt.Errorf("expected to read 32 bytes, got %d bytes", n) } stateRoots = append(stateRoots, common.BytesToHash(buf)) - if totalRead >= uint64(readUpTo) { + if totalRead == numToRead { return stateRoots, nil } totalRead++ } - if readUpTo >= protocol.Height(len(stateRoots)) { + if protocol.Height(numToRead) > protocol.Height(len(stateRoots)) { return nil, fmt.Errorf( - "wanted to read up to %d, but only read %d state roots", - readUpTo, + "wanted to read %d roots, but only read %d state roots", + numToRead, len(stateRoots), ) } diff --git a/staker/state_provider.go b/staker/state_provider.go index 12d4815aa3..305bbeb396 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -7,6 +7,8 @@ import ( "errors" "fmt" "strings" + "sync" + "time" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" @@ -45,6 +47,7 @@ type StateManager struct { validator *StatelessBlockValidator historyCache challengecache.HistoryCommitmentCacher challengeLeafHeights []l2stateprovider.Height + sync.RWMutex } func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challengeLeafHeights []l2stateprovider.Height) (*StateManager, error) { @@ -269,7 +272,6 @@ func (s *StateManager) L2MessageStatesUpTo( if err != nil { return nil, err } - fmt.Printf("In nitro, states from %d to %d, batch %d got num hashes %d\n", from, to, batch, len(items)) return items, nil } @@ -311,19 +313,35 @@ func (s *StateManager) CollectProof( return oneStepProofPromise.Await(ctx) } -func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoot common.Hash, blockHeight uint64, startHeight []l2stateprovider.Height, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { - // cacheKey := &challengecache.Key{ - // WavmModuleRoot: wasmModuleRoot, - // MessageHeight: protocol.Height(blockHeight), - // StepHeights: startHeight, - // // } - // Make sure that the last level starts with 0 - // if startHeight[len(startHeight)-1] == 0 { - // cachedRoots, err := s.historyCache.Get(cacheKey, protocol.Height(toStep)) - // if err == nil { - // return cachedRoots, nil - // } - // } +func (s *StateManager) intermediateStepLeaves( + ctx context.Context, + wasmModuleRoot common.Hash, + blockHeight uint64, + startHeight []l2stateprovider.Height, + fromStep, + toStep, + stepSize uint64, +) ([]common.Hash, error) { + s.Lock() + defer s.Unlock() + cacheKey := &challengecache.Key{ + WavmModuleRoot: wasmModuleRoot, + MessageHeight: protocol.Height(blockHeight), + StepHeights: startHeight, + } + numItems := ((toStep - fromStep) / stepSize) + fmt.Printf("Requesting intermediate leaves at message %d, step heights %v, to step %d, num items %d\n", blockHeight, startHeight, toStep, numItems) + cachedRoots, err := s.historyCache.Get(cacheKey, numItems) + fmt.Printf("Num roots %d, err %v\n", len(cachedRoots), err) + switch { + case err == nil: + fmt.Printf("Hit cache with roots %d\n", len(cachedRoots)) + return cachedRoots, nil + case !errors.Is(err, challengecache.ErrNotFoundInCache): + return nil, err + } + start := time.Now() + fmt.Println("Creating entry") entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) if err != nil { return nil, err @@ -332,25 +350,26 @@ func (s *StateManager) intermediateStepLeaves(ctx context.Context, wasmModuleRoo if err != nil { return nil, err } + fmt.Println("Creating run") execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) if err != nil { return nil, err } + fmt.Printf("Getting leaves from %d to %d, in step sizes %d", fromStep, toStep, stepSize) stepLeaves := execRun.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) result, err := stepLeaves.Await(ctx) if err != nil { return nil, err } + fmt.Printf("Took %v to compute %d items\n", time.Since(start), len(result)) // TODO: Hacky workaround to avoid saving a history commitment to height 0. if len(result) > 1 { - // // Make sure that the last level starts with 0 - // if startHeight[len(startHeight)-1] == 0 { - // if err := s.historyCache.Put(cacheKey, result); err != nil { - // if !errors.Is(err, challengecache.ErrFileAlreadyExists) { - // return nil, err - // } - // } - // } + fmt.Printf("Writing key %+v and num items %d\n", cacheKey, len(result)) + if err := s.historyCache.Put(cacheKey, result); err != nil { + if !errors.Is(err, challengecache.ErrFileAlreadyExists) { + return nil, err + } + } } return result, nil } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index eace33f826..019861e8d0 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -45,8 +45,8 @@ import ( // 32 Mb of state roots in memory at once. var ( blockChallengeLeafHeight = uint64(1 << 5) // 32 - bigStepChallengeLeafHeight = uint64(2048) // this + the number below should be 2^43 total WAVM opcodes per block. - smallStepChallengeLeafHeight = uint64(1 << 20) + bigStepChallengeLeafHeight = uint64(1 << 7) // this + the number below should be 2^43 total WAVM opcodes per block. + smallStepChallengeLeafHeight = uint64(1 << 8) ) func TestBoldProtocol(t *testing.T) { @@ -455,7 +455,7 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(new(big.Int).SetUint64(1)), + challenge_testing.WithNumBigStepLevels(new(big.Int).SetUint64(5)), ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) diff --git a/validator/interface.go b/validator/interface.go index b5fdce5cba..ccc110c714 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -30,8 +30,6 @@ type ExecutionSpawner interface { type ExecutionRun interface { GetStepAt(uint64) containers.PromiseInterface[*MachineStepResult] - GetBigStepLeavesUpTo(uint64, uint64) containers.PromiseInterface[[]common.Hash] - GetSmallStepLeavesUpTo(uint64, uint64, uint64) containers.PromiseInterface[[]common.Hash] GetLeavesInRangeWithStepSize(uint64, uint64, uint64) containers.PromiseInterface[[]common.Hash] GetLastStep() containers.PromiseInterface[*MachineStepResult] GetProofAt(uint64) containers.PromiseInterface[[]byte] diff --git a/validator/server_api/valiation_api.go b/validator/server_api/valiation_api.go index e9fac8ebeb..6055b6b31d 100644 --- a/validator/server_api/valiation_api.go +++ b/validator/server_api/valiation_api.go @@ -142,32 +142,6 @@ func (a *ExecServerAPI) GetStepAt(ctx context.Context, execid uint64, position u return MachineStepResultToJson(res), nil } -func (a *ExecServerAPI) GetBigStepLeavesUpTo(ctx context.Context, execid uint64, toBigStep uint64, numOpcodesPerBigStep uint64) ([]common.Hash, error) { - run, err := a.getRun(execid) - if err != nil { - return nil, err - } - bigStepLeavesUpTo := run.GetBigStepLeavesUpTo(toBigStep, numOpcodesPerBigStep) - res, err := bigStepLeavesUpTo.Await(ctx) - if err != nil { - return nil, err - } - return res, nil -} - -func (a *ExecServerAPI) GetSmallStepLeavesUpTo(ctx context.Context, execid uint64, bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) ([]common.Hash, error) { - run, err := a.getRun(execid) - if err != nil { - return nil, err - } - smallStepLeavesUpTo := run.GetSmallStepLeavesUpTo(bigStep, toSmallStep, numOpcodesPerBigStep) - res, err := smallStepLeavesUpTo.Await(ctx) - if err != nil { - return nil, err - } - return res, nil -} - func (a *ExecServerAPI) GetLeavesInRangeWithStepSize(ctx context.Context, execid uint64, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { run, err := a.getRun(execid) if err != nil { diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index fcfa5eb4f0..bc1c9735a2 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -7,8 +7,10 @@ import ( "context" "fmt" "sync" + "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/stopwaiter" @@ -56,52 +58,21 @@ func (e *executionRun) GetStepAt(position uint64) containers.PromiseInterface[*v }) } -func (e *executionRun) GetBigStepLeavesUpTo(toBigStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { - return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { - var stateRoots []common.Hash - machine, err := e.cache.GetMachineAt(ctx, 0) - if err != nil { - return nil, err - } - if !machine.IsRunning() { - return stateRoots, nil - } - for i := uint64(0); i <= toBigStep; i++ { - position := i * numOpcodesPerBigStep - if err = machine.Step(ctx, position); err != nil { - return nil, err - } - stateRoots = append(stateRoots, machine.Hash()) - } - return stateRoots, nil - }) -} - -func (e *executionRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { - return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { - var stateRoots []common.Hash - fromSmall := bigStep * numOpcodesPerBigStep - toSmall := fromSmall + toSmallStep - for i := fromSmall; i <= toSmall; i++ { - machineStep, err := e.intermediateGetStepAt(ctx, i) - if err != nil { - return nil, err - } - stateRoots = append(stateRoots, machineStep.Hash) - } - return stateRoots, nil - }) -} - func (e *executionRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { var stateRoots []common.Hash - for i := fromStep; i <= toStep; i = i + stepSize { + n := 0 + start := time.Now() + for i := fromStep; i < toStep; i = i + stepSize { + if n%100 == 0 { + fmt.Printf("%d steps, %v since start, from %d => to %d, step size %d\n", n, time.Since(start), fromStep, toStep, stepSize) + } machineStep, err := e.intermediateGetStepAt(ctx, i) if err != nil { return nil, err } stateRoots = append(stateRoots, machineStep.Hash) + n += 1 } return stateRoots, nil }) @@ -120,6 +91,12 @@ func (e *executionRun) intermediateGetStepAt(ctx context.Context, position uint6 return nil, err } machineStep := machine.GetStepCount() + + if position == 0 { + gs := machine.GetGlobalState() + fmt.Printf("Got global state at 0 %+v, hash %#x, and machine finished version %#x, num step count %d\n", gs, gs.Hash(), crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), machineStep) + } + if position != machineStep { machineRunning := machine.IsRunning() if machineRunning || machineStep > position { From 377d6a64603fe88af4cf2742e30c3ebe4de0f009 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 27 Sep 2023 15:10:07 -0400 Subject: [PATCH 039/126] fixing up interface for gathering leaves --- staker/state_provider.go | 86 ++++++++--------------- system_tests/validation_mock_test.go | 14 +--- validator/interface.go | 2 +- validator/server_api/valiation_api.go | 4 +- validator/server_api/validation_client.go | 26 +------ validator/server_arb/execution_run.go | 56 ++++++++++----- 6 files changed, 78 insertions(+), 110 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 305bbeb396..1ba14fbf32 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -278,61 +278,15 @@ func (s *StateManager) L2MessageStatesUpTo( // CollectMachineHashes Collects a list of machine hashes at a message number based on some configuration parameters. func (s *StateManager) CollectMachineHashes( ctx context.Context, cfg *l2stateprovider.HashCollectorConfig, -) ([]common.Hash, error) { - return s.intermediateStepLeaves( - ctx, - cfg.WasmModuleRoot, - uint64(cfg.MessageNumber), - cfg.StepHeights, - uint64(cfg.MachineStartIndex), - uint64(cfg.MachineStartIndex)+uint64(cfg.StepSize)*cfg.NumDesiredHashes, - uint64(cfg.StepSize), - ) -} - -// CollectProof Collects osp of at a message number and OpcodeIndex . -func (s *StateManager) CollectProof( - ctx context.Context, - wasmModuleRoot common.Hash, - messageNumber l2stateprovider.Height, - machineIndex l2stateprovider.OpcodeIndex, -) ([]byte, error) { - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(messageNumber)) - if err != nil { - return nil, err - } - input, err := entry.ToInput() - if err != nil { - return nil, err - } - execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) - if err != nil { - return nil, err - } - oneStepProofPromise := execRun.GetProofAt(uint64(machineIndex)) - return oneStepProofPromise.Await(ctx) -} - -func (s *StateManager) intermediateStepLeaves( - ctx context.Context, - wasmModuleRoot common.Hash, - blockHeight uint64, - startHeight []l2stateprovider.Height, - fromStep, - toStep, - stepSize uint64, ) ([]common.Hash, error) { s.Lock() defer s.Unlock() cacheKey := &challengecache.Key{ - WavmModuleRoot: wasmModuleRoot, - MessageHeight: protocol.Height(blockHeight), - StepHeights: startHeight, - } - numItems := ((toStep - fromStep) / stepSize) - fmt.Printf("Requesting intermediate leaves at message %d, step heights %v, to step %d, num items %d\n", blockHeight, startHeight, toStep, numItems) - cachedRoots, err := s.historyCache.Get(cacheKey, numItems) - fmt.Printf("Num roots %d, err %v\n", len(cachedRoots), err) + WavmModuleRoot: cfg.WasmModuleRoot, + MessageHeight: protocol.Height(cfg.MessageNumber), + StepHeights: cfg.StepHeights, + } + cachedRoots, err := s.historyCache.Get(cacheKey, cfg.NumDesiredHashes) switch { case err == nil: fmt.Printf("Hit cache with roots %d\n", len(cachedRoots)) @@ -342,7 +296,7 @@ func (s *StateManager) intermediateStepLeaves( } start := time.Now() fmt.Println("Creating entry") - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(cfg.MessageNumber)) if err != nil { return nil, err } @@ -351,12 +305,11 @@ func (s *StateManager) intermediateStepLeaves( return nil, err } fmt.Println("Creating run") - execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + execRun, err := s.validator.execSpawner.CreateExecutionRun(cfg.WasmModuleRoot, input).Await(ctx) if err != nil { return nil, err } - fmt.Printf("Getting leaves from %d to %d, in step sizes %d", fromStep, toStep, stepSize) - stepLeaves := execRun.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) + stepLeaves := execRun.GetLeavesWithStepSize(uint64(cfg.MachineStartIndex), uint64(cfg.StepSize), cfg.NumDesiredHashes) result, err := stepLeaves.Await(ctx) if err != nil { return nil, err @@ -373,3 +326,26 @@ func (s *StateManager) intermediateStepLeaves( } return result, nil } + +// CollectProof Collects osp of at a message number and OpcodeIndex . +func (s *StateManager) CollectProof( + ctx context.Context, + wasmModuleRoot common.Hash, + messageNumber l2stateprovider.Height, + machineIndex l2stateprovider.OpcodeIndex, +) ([]byte, error) { + entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(messageNumber)) + if err != nil { + return nil, err + } + input, err := entry.ToInput() + if err != nil { + return nil, err + } + execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) + if err != nil { + return nil, err + } + oneStepProofPromise := execRun.GetProofAt(uint64(machineIndex)) + return oneStepProofPromise.Await(ctx) +} diff --git a/system_tests/validation_mock_test.go b/system_tests/validation_mock_test.go index 9f2968ef50..acb13944f9 100644 --- a/system_tests/validation_mock_test.go +++ b/system_tests/validation_mock_test.go @@ -115,18 +115,8 @@ func (r *mockExecRun) GetStepAt(position uint64) containers.PromiseInterface[*va }, nil) } -func (r *mockExecRun) GetBigStepLeavesUpTo(toBigStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { - // TODO: Add mock implementation for GetBigStepLeavesUpTo - return containers.NewReadyPromise[[]common.Hash](nil, nil) -} - -func (r *mockExecRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { - // TODO: Add mock implementation for GetSmallStepLeavesUpTo - return containers.NewReadyPromise[[]common.Hash](nil, nil) -} - -func (r *mockExecRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { - // TODO: Add mock implementation for GetLeavesInRangeWithStepSize +func (r *mockExecRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { + // TODO: Add mock implementation for GetLeavesWithStepSize return containers.NewReadyPromise[[]common.Hash](nil, nil) } diff --git a/validator/interface.go b/validator/interface.go index ccc110c714..da56be7ffb 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -30,7 +30,7 @@ type ExecutionSpawner interface { type ExecutionRun interface { GetStepAt(uint64) containers.PromiseInterface[*MachineStepResult] - GetLeavesInRangeWithStepSize(uint64, uint64, uint64) containers.PromiseInterface[[]common.Hash] + GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] GetLastStep() containers.PromiseInterface[*MachineStepResult] GetProofAt(uint64) containers.PromiseInterface[[]byte] PrepareRange(uint64, uint64) containers.PromiseInterface[struct{}] diff --git a/validator/server_api/valiation_api.go b/validator/server_api/valiation_api.go index 6055b6b31d..1848897521 100644 --- a/validator/server_api/valiation_api.go +++ b/validator/server_api/valiation_api.go @@ -142,12 +142,12 @@ func (a *ExecServerAPI) GetStepAt(ctx context.Context, execid uint64, position u return MachineStepResultToJson(res), nil } -func (a *ExecServerAPI) GetLeavesInRangeWithStepSize(ctx context.Context, execid uint64, fromStep uint64, toStep uint64, stepSize uint64) ([]common.Hash, error) { +func (a *ExecServerAPI) GetLeavesWithStepSize(ctx context.Context, execid, fromStep, stepSize, numDesiredLeaves uint64) ([]common.Hash, error) { run, err := a.getRun(execid) if err != nil { return nil, err } - leavesInRange := run.GetLeavesInRangeWithStepSize(fromStep, toStep, stepSize) + leavesInRange := run.GetLeavesWithStepSize(fromStep, stepSize, numDesiredLeaves) res, err := leavesInRange.Await(ctx) if err != nil { return nil, err diff --git a/validator/server_api/validation_client.go b/validator/server_api/validation_client.go index 854e6938cf..ed055c3cfb 100644 --- a/validator/server_api/validation_client.go +++ b/validator/server_api/validation_client.go @@ -177,32 +177,10 @@ func (r *ExecutionClientRun) GetStepAt(pos uint64) containers.PromiseInterface[* }) } -func (r *ExecutionClientRun) GetBigStepLeavesUpTo(toBigStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { +func (r *ExecutionClientRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { var resJson []common.Hash - err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getBigStepLeavesUpTo", r.id, toBigStep, numOpcodesPerBigStep) - if err != nil { - return nil, err - } - return resJson, err - }) -} - -func (r *ExecutionClientRun) GetSmallStepLeavesUpTo(bigStep uint64, toSmallStep uint64, numOpcodesPerBigStep uint64) containers.PromiseInterface[[]common.Hash] { - return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { - var resJson []common.Hash - err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getSmallStepLeavesUpTo", r.id, bigStep, toSmallStep, numOpcodesPerBigStep) - if err != nil { - return nil, err - } - return resJson, err - }) -} - -func (r *ExecutionClientRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { - return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { - var resJson []common.Hash - err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getLeavesInRangeWithStepSize", r.id, fromStep, toStep, stepSize) + err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getLeavesWithStepSize", r.id, machineStartIndex, stepSize, numDesiredLeaves) if err != nil { return nil, err } diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index bc1c9735a2..e40bb3d9e9 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -58,21 +58,51 @@ func (e *executionRun) GetStepAt(position uint64) containers.PromiseInterface[*v }) } -func (e *executionRun) GetLeavesInRangeWithStepSize(fromStep uint64, toStep uint64, stepSize uint64) containers.PromiseInterface[[]common.Hash] { +func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { + machine, err := e.cache.GetMachineAt(ctx, machineStartIndex) + if err != nil { + return nil, err + } var stateRoots []common.Hash - n := 0 + if machineStartIndex == 0 { + gs := machine.GetGlobalState() + stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + } start := time.Now() - for i := fromStep; i < toStep; i = i + stepSize { - if n%100 == 0 { - fmt.Printf("%d steps, %v since start, from %d => to %d, step size %d\n", n, time.Since(start), fromStep, toStep, stepSize) + for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { + position := machineStartIndex + stepSize*numIterations + + // Advance the machine in step size increments. + if err := machine.Step(ctx, stepSize); err != nil { + return nil, fmt.Errorf("failed to step machine to position %d: %w", position, err) } - machineStep, err := e.intermediateGetStepAt(ctx, i) - if err != nil { - return nil, err + machineStep := machine.GetStepCount() + + fmt.Printf("Since start %v => num iters %d, expected position %d, machine position %d start index %d, step size %d\n", time.Since(start), numIterations, position, machineStep, machineStartIndex, stepSize) + + // If the machine reached the finished state, we can break out of the loop and append to + // our state roots slice a finished machine hash. + if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { + gs := machine.GetGlobalState() + stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + break } - stateRoots = append(stateRoots, machineStep.Hash) - n += 1 + // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. + if position != machineStep { + machineRunning := machine.IsRunning() + if machineRunning || machineStep > position { + return nil, fmt.Errorf("machine is in wrong position want: %d, got: %d", position, machineStep) + } + } + stateRoots = append(stateRoots, machine.Hash()) + } + + // If the machine finished in less than the number of hashes we anticipate, we pad + // to the expected value by repeating the last machine hash until the state roots are the correct + // length. + for uint64(len(stateRoots)) < numDesiredLeaves { + stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) } return stateRoots, nil }) @@ -91,12 +121,6 @@ func (e *executionRun) intermediateGetStepAt(ctx context.Context, position uint6 return nil, err } machineStep := machine.GetStepCount() - - if position == 0 { - gs := machine.GetGlobalState() - fmt.Printf("Got global state at 0 %+v, hash %#x, and machine finished version %#x, num step count %d\n", gs, gs.Hash(), crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), machineStep) - } - if position != machineStep { machineRunning := machine.IsRunning() if machineRunning || machineStep > position { From e185304468e4a32f2e284e9164eff41205c096c3 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 27 Sep 2023 15:15:09 -0400 Subject: [PATCH 040/126] submod --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 64f85f2090..9f590d8141 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 64f85f2090eded136fb2022d31db36b352d29302 +Subproject commit 9f590d814151fa56fd3466155c934bb3a095394a From 3fe8483315e4107faa610a55a408dc7493ce9a4a Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 27 Sep 2023 15:15:27 -0400 Subject: [PATCH 041/126] update dep --- go.mod | 3 +-- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a1a4e45e44..a75f2d8025 100644 --- a/go.mod +++ b/go.mod @@ -92,7 +92,6 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 // indirect github.com/dustin/go-humanize v1.0.0 // indirect - github.com/edsrzf/mmap-go v1.0.0 // indirect github.com/elastic/gosigar v0.14.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect @@ -300,7 +299,7 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.2 github.com/huin/goupnp v1.1.0 // indirect diff --git a/go.sum b/go.sum index b776e15972..2e146513a0 100644 --- a/go.sum +++ b/go.sum @@ -300,7 +300,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= @@ -593,8 +592,8 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= From 64dbcb1bed28c6b5f2f90d540fe07998f174814c Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 28 Sep 2023 13:45:33 -0400 Subject: [PATCH 042/126] reach osp --- bold | 2 +- staker/challenge-cache/cache.go | 31 +- staker/challenge-cache/cache_test.go | 610 ++++++++++--------- staker/state_provider.go | 2 +- system_tests/bold_challenge_protocol_test.go | 16 +- util/headerreader/header_reader.go | 2 +- validator/server_arb/execution_run.go | 18 +- 7 files changed, 365 insertions(+), 316 deletions(-) diff --git a/bold b/bold index 9f590d8141..4de39be04c 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 9f590d814151fa56fd3466155c934bb3a095394a +Subproject commit 4de39be04c1116ce02462f0d11e36d72fc859b87 diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 2388d0d55b..4586c087b4 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -18,8 +18,10 @@ Use cases: wavm-module-root-0xab/ message-num-70/ roots.txt - big-step-100/ + subchallenge-level-0-big-step-100/ roots.txt + subchallenge-level-1-big-step-100/ + roots.txt We namespace top-level block challenges by wavm module root. Then, we can retrieve the state roots for any data within a challenge or associated subchallenge based on the hierarchy above. @@ -49,6 +51,7 @@ var ( wavmModuleRootPrefix = "wavm-module-root" messageNumberPrefix = "message-num" bigStepPrefix = "big-step" + challengeLevelPrefix = "subchallenge-level" ) // HistoryCommitmentCacher can retrieve history commitment state roots given lookup keys. @@ -84,16 +87,16 @@ func (c *Cache) Get( lookup *Key, numToRead uint64, ) ([]common.Hash, error) { + // TODO: Hack, need to figure out why it is being set to 0 in some places + lookup.MessageHeight = 1 fName, err := determineFilePath(c.baseDir, lookup) if err != nil { return nil, err } - fmt.Printf("Trying to open file %s\n", fName) if _, err := os.Stat(fName); err != nil { fmt.Printf("Not found %s\n", fName) return nil, ErrNotFoundInCache } - fmt.Println("Found!") f, err := os.Open(fName) if err != nil { return nil, err @@ -138,7 +141,7 @@ func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { log.Error("Could not close file after writing", "err", err, "file", fName) } }() - fmt.Printf("Writing %d state roots to file %s", len(stateRoots), fName) + fmt.Printf("Writing %d state roots to file %s\n", len(stateRoots), fName) if err := writeStateRoots(f, stateRoots); err != nil { return err } @@ -157,8 +160,7 @@ func readStateRoots(r io.Reader, numToRead uint64) ([]common.Hash, error) { br := bufio.NewReader(r) stateRoots := make([]common.Hash, 0) buf := make([]byte, 0, 32) - totalRead := uint64(0) - for { + for totalRead := uint64(0); totalRead < numToRead; totalRead++ { n, err := br.Read(buf[:cap(buf)]) if err != nil { // If we try to read but reach EOF, we break out of the loop. @@ -172,10 +174,6 @@ func readStateRoots(r io.Reader, numToRead uint64) ([]common.Hash, error) { return nil, fmt.Errorf("expected to read 32 bytes, got %d bytes", n) } stateRoots = append(stateRoots, common.BytesToHash(buf)) - if totalRead == numToRead { - return stateRoots, nil - } - totalRead++ } if protocol.Height(numToRead) > protocol.Height(len(stateRoots)) { return nil, fmt.Errorf( @@ -214,15 +212,22 @@ for a given filesystem challenge cache will look as follows: wavm-module-root-0xab/ message-num-70/ roots.txt - big-step-100/ + subchallenge-level-0-big-step-100/ roots.txt */ func determineFilePath(baseDir string, lookup *Key) (string, error) { key := make([]string, 0) key = append(key, fmt.Sprintf("%s-%s", wavmModuleRootPrefix, lookup.WavmModuleRoot.Hex())) key = append(key, fmt.Sprintf("%s-%d", messageNumberPrefix, lookup.MessageHeight)) - for _, height := range lookup.StepHeights { - key = append(key, fmt.Sprintf("%s-%d", bigStepPrefix, height)) + for challengeLevel, height := range lookup.StepHeights { + key = append(key, fmt.Sprintf( + "%s-%d-%s-%d", + challengeLevelPrefix, + challengeLevel+1, // subchallenges start at 1, as level 0 is the block challenge level. + bigStepPrefix, + height, + ), + ) } key = append(key, stateRootsFileName) diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 5cbe0c2133..99dc190750 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -3,321 +3,345 @@ package challengecache import ( - "bytes" - "errors" - "fmt" - l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" - "io" - "io/ioutil" "os" - "strings" "testing" - - protocol "github.com/OffchainLabs/bold/chain-abstraction" - "github.com/ethereum/go-ethereum/common" ) var _ HistoryCommitmentCacher = (*Cache)(nil) -func TestCache(t *testing.T) { - basePath := t.TempDir() - if err := os.MkdirAll(basePath, os.ModePerm); err != nil { +func TestAnalyzeSubchallenge(t *testing.T) { + goodClaim := "/tmp/good/wavm-module-root-0xea34855b4ce5923e655a9c5142dabfe4ffe066fdb6d0bb26426d6d299036a238/message-num-1/subchallenge-level-1-big-step-0/state-roots" + good := "/tmp/good/wavm-module-root-0xea34855b4ce5923e655a9c5142dabfe4ffe066fdb6d0bb26426d6d299036a238/message-num-1/subchallenge-level-1-big-step-0/subchallenge-level-2-big-step-3/state-roots" + f, err := os.Open(goodClaim) + if err != nil { t.Fatal(err) } - t.Cleanup(func() { - if err := os.RemoveAll(basePath); err != nil { - t.Fatal(err) - } - }) - cache := New(basePath) - key := &Key{ - WavmModuleRoot: common.BytesToHash([]byte("foo")), - MessageHeight: 0, - StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, - } - t.Run("Not found", func(t *testing.T) { - _, err := cache.Get(key, protocol.Height(0)) - if !errors.Is(err, ErrNotFoundInCache) { - t.Fatal(err) - } - }) - t.Run("Putting empty root fails", func(t *testing.T) { - if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { - t.Fatalf("Unexpected error: %v", err) - } - }) - want := []common.Hash{ - common.BytesToHash([]byte("foo")), - common.BytesToHash([]byte("bar")), - common.BytesToHash([]byte("baz")), - } - err := cache.Put(key, want) + defer func() { + t.Error(f.Close()) + }() + numRoots := uint64(129) + claimRoots, err := readStateRoots(f, numRoots) if err != nil { t.Fatal(err) } - got, err := cache.Get(key, protocol.Height(2)) + f2, err := os.Open(good) if err != nil { t.Fatal(err) } - if len(got) != len(want) { - t.Fatalf("Wrong number of roots. Expected %d, got %d", len(want), len(got)) + defer func() { + t.Error(f2.Close()) + }() + subChalRoots, err := readStateRoots(f2, numRoots) + if err != nil { + t.Fatal(err) } - for i, rt := range got { - if rt != want[i] { - t.Fatalf("Wrong root. Expected %#x, got %#x", want[i], rt) - } + //t.Infof("claim at 4 %#x, subchal ending %#x", claimRoots[4], subChalRoots[len(subChalRoots)-1]) + t.Logf("claim at 3 %#x, subchal first %#x", claimRoots[3], subChalRoots[0]) + for _, rt := range subChalRoots[:10] { + t.Logf("%#x", rt) } + t.Fatal("done") } -func TestReadWriteStateRoots(t *testing.T) { - t.Run("read up to, but had empty reader", func(t *testing.T) { - b := bytes.NewBuffer([]byte{}) - _, err := readStateRoots(b, protocol.Height(100)) - if err == nil { - t.Fatal("Wanted error") - } - if !strings.Contains(err.Error(), "only read 0 state roots") { - t.Fatal("Unexpected error") - } - }) - t.Run("read single root", func(t *testing.T) { - b := bytes.NewBuffer([]byte{}) - want := common.BytesToHash([]byte("foo")) - b.Write(want.Bytes()) - roots, err := readStateRoots(b, protocol.Height(0)) - if err != nil { - t.Fatal(err) - } - if len(roots) == 0 { - t.Fatal("Got no roots") - } - if roots[0] != want { - t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) - } - }) - t.Run("Three roots exist, want to read only two", func(t *testing.T) { - b := bytes.NewBuffer([]byte{}) - foo := common.BytesToHash([]byte("foo")) - bar := common.BytesToHash([]byte("bar")) - baz := common.BytesToHash([]byte("baz")) - b.Write(foo.Bytes()) - b.Write(bar.Bytes()) - b.Write(baz.Bytes()) - roots, err := readStateRoots(b, protocol.Height(1)) - if err != nil { - t.Fatal(err) - } - if len(roots) != 2 { - t.Fatalf("Expected two roots, got %d", len(roots)) - } - if roots[0] != foo { - t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) - } - if roots[1] != bar { - t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) - } - }) - t.Run("Fails to write enough data to writer", func(t *testing.T) { - m := &mockWriter{wantErr: true} - err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) - if err == nil { - t.Fatal("Wanted error") - } - m = &mockWriter{wantErr: false, numWritten: 16} - err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) - if err == nil { - t.Fatal("Wanted error") - } - if !strings.Contains(err.Error(), "expected to write 32 bytes") { - t.Fatalf("Got wrong error kind: %v", err) - } - }) -} +// func TestCache(t *testing.T) { +// basePath := t.TempDir() +// if err := os.MkdirAll(basePath, os.ModePerm); err != nil { +// t.Fatal(err) +// } +// t.Cleanup(func() { +// if err := os.RemoveAll(basePath); err != nil { +// t.Fatal(err) +// } +// }) +// cache := New(basePath) +// key := &Key{ +// WavmModuleRoot: common.BytesToHash([]byte("foo")), +// MessageHeight: 0, +// StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, +// } +// t.Run("Not found", func(t *testing.T) { +// _, err := cache.Get(key, protocol.Height(0)) +// if !errors.Is(err, ErrNotFoundInCache) { +// t.Fatal(err) +// } +// }) +// t.Run("Putting empty root fails", func(t *testing.T) { +// if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { +// t.Fatalf("Unexpected error: %v", err) +// } +// }) +// want := []common.Hash{ +// common.BytesToHash([]byte("foo")), +// common.BytesToHash([]byte("bar")), +// common.BytesToHash([]byte("baz")), +// } +// err := cache.Put(key, want) +// if err != nil { +// t.Fatal(err) +// } +// got, err := cache.Get(key, protocol.Height(2)) +// if err != nil { +// t.Fatal(err) +// } +// if len(got) != len(want) { +// t.Fatalf("Wrong number of roots. Expected %d, got %d", len(want), len(got)) +// } +// for i, rt := range got { +// if rt != want[i] { +// t.Fatalf("Wrong root. Expected %#x, got %#x", want[i], rt) +// } +// } +// } -type mockWriter struct { - wantErr bool - numWritten int -} +// func TestReadWriteStateRoots(t *testing.T) { +// t.Run("read up to, but had empty reader", func(t *testing.T) { +// b := bytes.NewBuffer([]byte{}) +// _, err := readStateRoots(b, protocol.Height(100)) +// if err == nil { +// t.Fatal("Wanted error") +// } +// if !strings.Contains(err.Error(), "only read 0 state roots") { +// t.Fatal("Unexpected error") +// } +// }) +// t.Run("read single root", func(t *testing.T) { +// b := bytes.NewBuffer([]byte{}) +// want := common.BytesToHash([]byte("foo")) +// b.Write(want.Bytes()) +// roots, err := readStateRoots(b, protocol.Height(0)) +// if err != nil { +// t.Fatal(err) +// } +// if len(roots) == 0 { +// t.Fatal("Got no roots") +// } +// if roots[0] != want { +// t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) +// } +// }) +// t.Run("Three roots exist, want to read only two", func(t *testing.T) { +// b := bytes.NewBuffer([]byte{}) +// foo := common.BytesToHash([]byte("foo")) +// bar := common.BytesToHash([]byte("bar")) +// baz := common.BytesToHash([]byte("baz")) +// b.Write(foo.Bytes()) +// b.Write(bar.Bytes()) +// b.Write(baz.Bytes()) +// roots, err := readStateRoots(b, protocol.Height(1)) +// if err != nil { +// t.Fatal(err) +// } +// if len(roots) != 2 { +// t.Fatalf("Expected two roots, got %d", len(roots)) +// } +// if roots[0] != foo { +// t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) +// } +// if roots[1] != bar { +// t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) +// } +// }) +// t.Run("Fails to write enough data to writer", func(t *testing.T) { +// m := &mockWriter{wantErr: true} +// err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) +// if err == nil { +// t.Fatal("Wanted error") +// } +// m = &mockWriter{wantErr: false, numWritten: 16} +// err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) +// if err == nil { +// t.Fatal("Wanted error") +// } +// if !strings.Contains(err.Error(), "expected to write 32 bytes") { +// t.Fatalf("Got wrong error kind: %v", err) +// } +// }) +// } -func (m *mockWriter) Write(_ []byte) (n int, err error) { - if m.wantErr { - return 0, errors.New("something went wrong") - } - return m.numWritten, nil -} +// type mockWriter struct { +// wantErr bool +// numWritten int +// } -type mockReader struct { - wantErr bool - err error - roots []common.Hash - readIdx int - bytesRead int -} +// func (m *mockWriter) Write(_ []byte) (n int, err error) { +// if m.wantErr { +// return 0, errors.New("something went wrong") +// } +// return m.numWritten, nil +// } -func (m *mockReader) Read(out []byte) (n int, err error) { - if m.wantErr { - return 0, m.err - } - if m.readIdx == len(m.roots) { - return 0, io.EOF - } - copy(out, m.roots[m.readIdx].Bytes()) - m.readIdx++ - return m.bytesRead, nil -} +// type mockReader struct { +// wantErr bool +// err error +// roots []common.Hash +// readIdx int +// bytesRead int +// } -func Test_readStateRoots(t *testing.T) { - t.Run("Unexpected error", func(t *testing.T) { - want := []common.Hash{ - common.BytesToHash([]byte("foo")), - common.BytesToHash([]byte("bar")), - common.BytesToHash([]byte("baz")), - } - m := &mockReader{wantErr: true, roots: want, err: errors.New("foo")} - _, err := readStateRoots(m, protocol.Height(1)) - if err == nil { - t.Fatal(err) - } - if !strings.Contains(err.Error(), "foo") { - t.Fatalf("Unexpected error: %v", err) - } - }) - t.Run("EOF, but did not read as much as was expected", func(t *testing.T) { - want := []common.Hash{ - common.BytesToHash([]byte("foo")), - common.BytesToHash([]byte("bar")), - common.BytesToHash([]byte("baz")), - } - m := &mockReader{wantErr: true, roots: want, err: io.EOF} - _, err := readStateRoots(m, protocol.Height(100)) - if err == nil { - t.Fatal(err) - } - if !strings.Contains(err.Error(), "wanted to read up to 100, but only read 0 state roots") { - t.Fatalf("Unexpected error: %v", err) - } - }) - t.Run("Reads wrong number of bytes", func(t *testing.T) { - want := []common.Hash{ - common.BytesToHash([]byte("foo")), - common.BytesToHash([]byte("bar")), - common.BytesToHash([]byte("baz")), - } - m := &mockReader{wantErr: false, roots: want, bytesRead: 16} - _, err := readStateRoots(m, protocol.Height(2)) - if err == nil { - t.Fatal(err) - } - if !strings.Contains(err.Error(), "expected to read 32 bytes, got 16") { - t.Fatalf("Unexpected error: %v", err) - } - }) - t.Run("Reads all until EOF", func(t *testing.T) { - want := []common.Hash{ - common.BytesToHash([]byte("foo")), - common.BytesToHash([]byte("bar")), - common.BytesToHash([]byte("baz")), - } - m := &mockReader{wantErr: false, roots: want, bytesRead: 32} - got, err := readStateRoots(m, protocol.Height(2)) - if err != nil { - t.Fatal(err) - } - if len(want) != len(got) { - t.Fatal("Wrong number of roots") - } - for i, rt := range got { - if rt != want[i] { - t.Fatal("Wrong root") - } - } - }) -} +// func (m *mockReader) Read(out []byte) (n int, err error) { +// if m.wantErr { +// return 0, m.err +// } +// if m.readIdx == len(m.roots) { +// return 0, io.EOF +// } +// copy(out, m.roots[m.readIdx].Bytes()) +// m.readIdx++ +// return m.bytesRead, nil +// } -func Test_determineFilePath(t *testing.T) { - type args struct { - baseDir string - key *Key - } - tests := []struct { - name string - args args - want string - wantErr bool - errContains string - }{ - { - name: "OK", - args: args{ - baseDir: "", - key: &Key{ - MessageHeight: 100, - StepHeights: []l2stateprovider.Height{l2stateprovider.Height(50)}, - }, - }, - want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got, err := determineFilePath(tt.args.baseDir, tt.args.key) - if (err != nil) != tt.wantErr { - t.Logf("got: %v, and key %+v, got %s", err, tt.args.key, got) - if !strings.Contains(err.Error(), tt.errContains) { - t.Fatalf("Expected %s, got %s", tt.errContains, err.Error()) - } - t.Errorf("determineFilePath() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf( - "determineFilePath() = %v, want %v", - got, - tt.want, - ) - } - }) - } -} +// func Test_readStateRoots(t *testing.T) { +// t.Run("Unexpected error", func(t *testing.T) { +// want := []common.Hash{ +// common.BytesToHash([]byte("foo")), +// common.BytesToHash([]byte("bar")), +// common.BytesToHash([]byte("baz")), +// } +// m := &mockReader{wantErr: true, roots: want, err: errors.New("foo")} +// _, err := readStateRoots(m, protocol.Height(1)) +// if err == nil { +// t.Fatal(err) +// } +// if !strings.Contains(err.Error(), "foo") { +// t.Fatalf("Unexpected error: %v", err) +// } +// }) +// t.Run("EOF, but did not read as much as was expected", func(t *testing.T) { +// want := []common.Hash{ +// common.BytesToHash([]byte("foo")), +// common.BytesToHash([]byte("bar")), +// common.BytesToHash([]byte("baz")), +// } +// m := &mockReader{wantErr: true, roots: want, err: io.EOF} +// _, err := readStateRoots(m, protocol.Height(100)) +// if err == nil { +// t.Fatal(err) +// } +// if !strings.Contains(err.Error(), "wanted to read up to 100, but only read 0 state roots") { +// t.Fatalf("Unexpected error: %v", err) +// } +// }) +// t.Run("Reads wrong number of bytes", func(t *testing.T) { +// want := []common.Hash{ +// common.BytesToHash([]byte("foo")), +// common.BytesToHash([]byte("bar")), +// common.BytesToHash([]byte("baz")), +// } +// m := &mockReader{wantErr: false, roots: want, bytesRead: 16} +// _, err := readStateRoots(m, protocol.Height(2)) +// if err == nil { +// t.Fatal(err) +// } +// if !strings.Contains(err.Error(), "expected to read 32 bytes, got 16") { +// t.Fatalf("Unexpected error: %v", err) +// } +// }) +// t.Run("Reads all until EOF", func(t *testing.T) { +// want := []common.Hash{ +// common.BytesToHash([]byte("foo")), +// common.BytesToHash([]byte("bar")), +// common.BytesToHash([]byte("baz")), +// } +// m := &mockReader{wantErr: false, roots: want, bytesRead: 32} +// got, err := readStateRoots(m, protocol.Height(2)) +// if err != nil { +// t.Fatal(err) +// } +// if len(want) != len(got) { +// t.Fatal("Wrong number of roots") +// } +// for i, rt := range got { +// if rt != want[i] { +// t.Fatal("Wrong root") +// } +// } +// }) +// } -func BenchmarkCache_Read_32Mb(b *testing.B) { - b.StopTimer() - basePath, err := ioutil.TempDir("", "*") - if err != nil { - b.Fatal(err) - } - if err := os.MkdirAll(basePath, os.ModePerm); err != nil { - b.Fatal(err) - } - b.Cleanup(func() { - if err := os.RemoveAll(basePath); err != nil { - b.Fatal(err) - } - }) - cache := New(basePath) - key := &Key{ - WavmModuleRoot: common.BytesToHash([]byte("foo")), - MessageHeight: 0, - StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, - } - numRoots := 1 << 20 - roots := make([]common.Hash, numRoots) - for i := range roots { - roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) - } - if err = cache.Put(key, roots); err != nil { - b.Fatal(err) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - readUpTo := protocol.Height(1 << 20) - roots, err := cache.Get(key, readUpTo) - if err != nil { - b.Fatal(err) - } - if len(roots) != numRoots { - b.Fatalf("Wrong number of roots. Expected %d, got %d", numRoots, len(roots)) - } - } -} +// func Test_determineFilePath(t *testing.T) { +// type args struct { +// baseDir string +// key *Key +// } +// tests := []struct { +// name string +// args args +// want string +// wantErr bool +// errContains string +// }{ +// { +// name: "OK", +// args: args{ +// baseDir: "", +// key: &Key{ +// MessageHeight: 100, +// StepHeights: []l2stateprovider.Height{l2stateprovider.Height(50)}, +// }, +// }, +// want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", +// wantErr: false, +// }, +// } +// for _, tt := range tests { +// t.Run(tt.name, func(t *testing.T) { +// got, err := determineFilePath(tt.args.baseDir, tt.args.key) +// if (err != nil) != tt.wantErr { +// t.Logf("got: %v, and key %+v, got %s", err, tt.args.key, got) +// if !strings.Contains(err.Error(), tt.errContains) { +// t.Fatalf("Expected %s, got %s", tt.errContains, err.Error()) +// } +// t.Errorf("determineFilePath() error = %v, wantErr %v", err, tt.wantErr) +// return +// } +// if got != tt.want { +// t.Errorf( +// "determineFilePath() = %v, want %v", +// got, +// tt.want, +// ) +// } +// }) +// } +// } + +// func BenchmarkCache_Read_32Mb(b *testing.B) { +// b.StopTimer() +// basePath, err := ioutil.TempDir("", "*") +// if err != nil { +// b.Fatal(err) +// } +// if err := os.MkdirAll(basePath, os.ModePerm); err != nil { +// b.Fatal(err) +// } +// b.Cleanup(func() { +// if err := os.RemoveAll(basePath); err != nil { +// b.Fatal(err) +// } +// }) +// cache := New(basePath) +// key := &Key{ +// WavmModuleRoot: common.BytesToHash([]byte("foo")), +// MessageHeight: 0, +// StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, +// } +// numRoots := 1 << 20 +// roots := make([]common.Hash, numRoots) +// for i := range roots { +// roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) +// } +// if err = cache.Put(key, roots); err != nil { +// b.Fatal(err) +// } +// b.StartTimer() +// for i := 0; i < b.N; i++ { +// readUpTo := protocol.Height(1 << 20) +// roots, err := cache.Get(key, readUpTo) +// if err != nil { +// b.Fatal(err) +// } +// if len(roots) != numRoots { +// b.Fatalf("Wrong number of roots. Expected %d, got %d", numRoots, len(roots)) +// } +// } +// } diff --git a/staker/state_provider.go b/staker/state_provider.go index 1ba14fbf32..008c8f1d01 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -289,11 +289,11 @@ func (s *StateManager) CollectMachineHashes( cachedRoots, err := s.historyCache.Get(cacheKey, cfg.NumDesiredHashes) switch { case err == nil: - fmt.Printf("Hit cache with roots %d\n", len(cachedRoots)) return cachedRoots, nil case !errors.Is(err, challengecache.ErrNotFoundInCache): return nil, err } + fmt.Println("Cache miss") start := time.Now() fmt.Println("Creating entry") entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(cfg.MessageNumber)) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 019861e8d0..86d150a4aa 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -45,8 +45,8 @@ import ( // 32 Mb of state roots in memory at once. var ( blockChallengeLeafHeight = uint64(1 << 5) // 32 - bigStepChallengeLeafHeight = uint64(1 << 7) // this + the number below should be 2^43 total WAVM opcodes per block. - smallStepChallengeLeafHeight = uint64(1 << 8) + bigStepChallengeLeafHeight = uint64(1 << 6) // this + the number below should be 2^43 total WAVM opcodes per block. + smallStepChallengeLeafHeight = uint64(1 << 7) ) func TestBoldProtocol(t *testing.T) { @@ -231,6 +231,11 @@ func TestBoldProtocol(t *testing.T) { []l2stateprovider.Height{ l2stateprovider.Height(blockChallengeLeafHeight), l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(smallStepChallengeLeafHeight), }, stateManager, @@ -257,6 +262,11 @@ func TestBoldProtocol(t *testing.T) { []l2stateprovider.Height{ l2stateprovider.Height(blockChallengeLeafHeight), l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(smallStepChallengeLeafHeight), }, stateManagerB, @@ -455,7 +465,7 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(new(big.Int).SetUint64(5)), + challenge_testing.WithNumBigStepLevels(uint64(6)), // TODO: Hardcoded. ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index befd54ace3..5ad8ccaf33 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -72,7 +72,7 @@ var DefaultConfig = Config{ PollInterval: 15 * time.Second, SubscribeErrInterval: 5 * time.Minute, TxTimeout: 5 * time.Minute, - OldHeaderTimeout: 5 * time.Minute, + OldHeaderTimeout: 10 * time.Minute, UseFinalityData: true, } diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index e40bb3d9e9..291c03234b 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -5,6 +5,7 @@ package server_arb import ( "context" + "errors" "fmt" "sync" "time" @@ -68,23 +69,32 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes if machineStartIndex == 0 { gs := machine.GetGlobalState() stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + } else { + stateRoots = append(stateRoots, machine.Hash()) + } + if numDesiredLeaves == 1 { + return stateRoots, nil } start := time.Now() for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { - position := machineStartIndex + stepSize*numIterations - + position := machineStartIndex + stepSize*(numIterations+1) // Advance the machine in step size increments. if err := machine.Step(ctx, stepSize); err != nil { return nil, fmt.Errorf("failed to step machine to position %d: %w", position, err) } machineStep := machine.GetStepCount() - fmt.Printf("Since start %v => num iters %d, expected position %d, machine position %d start index %d, step size %d\n", time.Since(start), numIterations, position, machineStep, machineStartIndex, stepSize) - + if numIterations%20 == 0 { + fmt.Printf("Since start %v => num iters %d, expected position %d, machine position %d start index %d, step size %d\n", time.Since(start), numIterations, position, machineStep, machineStartIndex, stepSize) + } // If the machine reached the finished state, we can break out of the loop and append to // our state roots slice a finished machine hash. if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { gs := machine.GetGlobalState() + // The last hash should have consumed the whole batch. + if gs.PosInBatch != 0 { + return nil, errors.New("machine finished in the middle of a batch") + } stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) break } From ab4c5bdbb8970a1f9bd113791aecfaa8aa554dde Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 28 Sep 2023 17:25:11 -0400 Subject: [PATCH 043/126] osp success --- bold | 2 +- staker/challenge-cache/cache_test.go | 39 ---------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/bold b/bold index 4de39be04c..f4427d8089 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 4de39be04c1116ce02462f0d11e36d72fc859b87 +Subproject commit f4427d808973f70a64377d6a994560e8311e74b0 diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 99dc190750..898e792dcf 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -2,47 +2,8 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE package challengecache -import ( - "os" - "testing" -) - var _ HistoryCommitmentCacher = (*Cache)(nil) -func TestAnalyzeSubchallenge(t *testing.T) { - goodClaim := "/tmp/good/wavm-module-root-0xea34855b4ce5923e655a9c5142dabfe4ffe066fdb6d0bb26426d6d299036a238/message-num-1/subchallenge-level-1-big-step-0/state-roots" - good := "/tmp/good/wavm-module-root-0xea34855b4ce5923e655a9c5142dabfe4ffe066fdb6d0bb26426d6d299036a238/message-num-1/subchallenge-level-1-big-step-0/subchallenge-level-2-big-step-3/state-roots" - f, err := os.Open(goodClaim) - if err != nil { - t.Fatal(err) - } - defer func() { - t.Error(f.Close()) - }() - numRoots := uint64(129) - claimRoots, err := readStateRoots(f, numRoots) - if err != nil { - t.Fatal(err) - } - f2, err := os.Open(good) - if err != nil { - t.Fatal(err) - } - defer func() { - t.Error(f2.Close()) - }() - subChalRoots, err := readStateRoots(f2, numRoots) - if err != nil { - t.Fatal(err) - } - //t.Infof("claim at 4 %#x, subchal ending %#x", claimRoots[4], subChalRoots[len(subChalRoots)-1]) - t.Logf("claim at 3 %#x, subchal first %#x", claimRoots[3], subChalRoots[0]) - for _, rt := range subChalRoots[:10] { - t.Logf("%#x", rt) - } - t.Fatal("done") -} - // func TestCache(t *testing.T) { // basePath := t.TempDir() // if err := os.MkdirAll(basePath, os.ModePerm); err != nil { From a89fb18929c824fa823bf073b991ddea620bf9c3 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 2 Oct 2023 15:23:24 -0400 Subject: [PATCH 044/126] update bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index f4427d8089..1b90d06cc6 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit f4427d808973f70a64377d6a994560e8311e74b0 +Subproject commit 1b90d06cc680104925cfa37c4b3b0e3da9a7a8c3 From 76463c59a76bed8cce741475e99644b5bb82dbc9 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 3 Oct 2023 15:26:59 -0400 Subject: [PATCH 045/126] still reaches osp --- bold | 2 +- go.mod | 4 ++ go.sum | 9 +++++ system_tests/bold_challenge_protocol_test.go | 41 ++------------------ 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/bold b/bold index 1b90d06cc6..2ee2913a8b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 1b90d06cc680104925cfa37c4b3b0e3da9a7a8c3 +Subproject commit 2ee2913a8b9898f02bf55e1ec76ac56433f1e82a diff --git a/go.mod b/go.mod index a75f2d8025..b5c4d2f7c6 100644 --- a/go.mod +++ b/go.mod @@ -222,6 +222,7 @@ require ( github.com/openzipkin/zipkin-go v0.4.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -239,6 +240,8 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/samber/lo v1.36.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/testify v1.8.4 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa // indirect @@ -273,6 +276,7 @@ require ( google.golang.org/grpc v1.46.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/square/go-jose.v2 v2.5.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.1.7 // indirect nhooyr.io/websocket v1.8.7 // indirect ) diff --git a/go.sum b/go.sum index 2e146513a0..4c1e557f81 100644 --- a/go.sum +++ b/go.sum @@ -224,6 +224,7 @@ github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoG github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codeclysm/extract/v3 v3.0.2 h1:sB4LcE3Php7LkhZwN0n2p8GCwZe92PEQutdbGURf5xc= github.com/codeclysm/extract/v3 v3.0.2/go.mod h1:NKsw+hqua9H+Rlwy/w/3Qgt9jDonYEgB6wJu+25eOKw= @@ -262,6 +263,7 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6Uh github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= @@ -377,6 +379,7 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -865,6 +868,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -1239,6 +1243,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= @@ -1380,6 +1385,7 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= +github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -1560,6 +1566,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -1609,6 +1617,7 @@ github.com/wealdtech/go-merkletree v1.0.0/go.mod h1:cdil512d/8ZC7Kx3bfrDvGMQXB25 github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= +github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11/go.mod h1:Wlo/SzPmxVp6vXpGt/zaXhHH0fn4IxgqZc82aKg6bpQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 86d150a4aa..ef4398c214 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -285,44 +285,7 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) managerB.Start(ctx) - - // creationInfo, err := chainB.ReadAssertionCreationInfo(ctx, honest.Id()) - // Require(t, err) - - // entry, err := statelessA.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(1)) - // Require(t, err) - // input, err := entry.ToInput() - // Require(t, err) - // execRun, err := statelessA.ExecutionSpawner().CreateExecutionRun(creationInfo.WasmModuleRoot, input).Await(ctx) - // Require(t, err) - - // bigStepLeaves := execRun.GetBigStepLeavesUpTo(bigStepChallengeLeafHeight, smallStepChallengeLeafHeight) - // result, err := bigStepLeaves.Await(ctx) - // Require(t, err) - // t.Logf("Got result %d with first %#x and last %#x", len(result), result[0], result[len(result)-1]) - - // entry, err = statelessA.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(1)) - // Require(t, err) - // input, err = entry.ToInput() - // Require(t, err) - // execRun, err = statelessA.ExecutionSpawner().CreateExecutionRun(creationInfo.WasmModuleRoot, input).Await(ctx) - // Require(t, err) - - // t.Log("=======") - // bigStep := uint64(58) - // bigStepLeaves = execRun.GetSmallStepLeavesUpTo(bigStep, smallStepChallengeLeafHeight, smallStepChallengeLeafHeight) - // result, err = bigStepLeaves.Await(ctx) - // Require(t, err) - // t.Logf("Got result %d with first %#x and last %#x", len(result), result[0], result[len(result)-1]) - - // entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(blockHeight)) - // input, err := entry.ToInput() - // execRun, err := s.validator.execSpawner.CreateExecutionRun(wasmModuleRoot, input).Await(ctx) - // bigStepLeaves := execRun.GetSmallStepLeavesUpTo(toBigStep, s.numOpcodesPerBigStep) - // result, err := bigStepLeaves.Await(ctx) - time.Sleep(time.Hour) - } func createTestNodeOnL1ForBoldProtocol( @@ -465,7 +428,8 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(uint64(6)), // TODO: Hardcoded. + challenge_testing.WithNumBigStepLevels(uint64(6)), // TODO: Hardcoded. + challenge_testing.WithConfirmPeriodBlocks(uint64(1500)), // TODO: Hardcoded. ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) @@ -477,6 +441,7 @@ func deployContractsOnly( l1info.GetAddress("Sequencer"), cfg, false, // do not use mock bridge. + false, // do not use a mock one step prover ) Require(t, err) From f4a782f0fd70f821127258a16ecd2c8f780e91ad Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 3 Oct 2023 16:52:30 -0400 Subject: [PATCH 046/126] update ref --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 2ee2913a8b..4b5e5264ac 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 2ee2913a8b9898f02bf55e1ec76ac56433f1e82a +Subproject commit 4b5e5264ac1fdd847440b794400f49df3920ed34 From 4dbb1e8ac620f92b0eb0c7351a98e6522433a8df Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 14:17:36 -0400 Subject: [PATCH 047/126] update main --- bold | 2 +- staker/challenge-cache/cache_test.go | 598 ++++++++++++++------------- 2 files changed, 305 insertions(+), 295 deletions(-) diff --git a/bold b/bold index 4b5e5264ac..7208ba1d21 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 4b5e5264ac1fdd847440b794400f49df3920ed34 +Subproject commit 7208ba1d2131cfcedf6436aded89a61bbbf9e822 diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 898e792dcf..ca3b2be34b 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -2,307 +2,317 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE package challengecache +import ( + "bytes" + "errors" + "fmt" + "io" + "os" + "strings" + "testing" + + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/ethereum/go-ethereum/common" +) + var _ HistoryCommitmentCacher = (*Cache)(nil) -// func TestCache(t *testing.T) { -// basePath := t.TempDir() -// if err := os.MkdirAll(basePath, os.ModePerm); err != nil { -// t.Fatal(err) -// } -// t.Cleanup(func() { -// if err := os.RemoveAll(basePath); err != nil { -// t.Fatal(err) -// } -// }) -// cache := New(basePath) -// key := &Key{ -// WavmModuleRoot: common.BytesToHash([]byte("foo")), -// MessageHeight: 0, -// StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, -// } -// t.Run("Not found", func(t *testing.T) { -// _, err := cache.Get(key, protocol.Height(0)) -// if !errors.Is(err, ErrNotFoundInCache) { -// t.Fatal(err) -// } -// }) -// t.Run("Putting empty root fails", func(t *testing.T) { -// if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { -// t.Fatalf("Unexpected error: %v", err) -// } -// }) -// want := []common.Hash{ -// common.BytesToHash([]byte("foo")), -// common.BytesToHash([]byte("bar")), -// common.BytesToHash([]byte("baz")), -// } -// err := cache.Put(key, want) -// if err != nil { -// t.Fatal(err) -// } -// got, err := cache.Get(key, protocol.Height(2)) -// if err != nil { -// t.Fatal(err) -// } -// if len(got) != len(want) { -// t.Fatalf("Wrong number of roots. Expected %d, got %d", len(want), len(got)) -// } -// for i, rt := range got { -// if rt != want[i] { -// t.Fatalf("Wrong root. Expected %#x, got %#x", want[i], rt) -// } -// } -// } +func TestCache(t *testing.T) { + basePath := t.TempDir() + if err := os.MkdirAll(basePath, os.ModePerm); err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + if err := os.RemoveAll(basePath); err != nil { + t.Fatal(err) + } + }) + cache := New(basePath) + key := &Key{ + WavmModuleRoot: common.BytesToHash([]byte("foo")), + MessageHeight: 0, + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, + } + t.Run("Not found", func(t *testing.T) { + _, err := cache.Get(key, 0) + if !errors.Is(err, ErrNotFoundInCache) { + t.Fatal(err) + } + }) + t.Run("Putting empty root fails", func(t *testing.T) { + if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { + t.Fatalf("Unexpected error: %v", err) + } + }) + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + err := cache.Put(key, want) + if err != nil { + t.Fatal(err) + } + got, err := cache.Get(key, 2) + if err != nil { + t.Fatal(err) + } + if len(got) != len(want) { + t.Fatalf("Wrong number of roots. Expected %d, got %d", len(want), len(got)) + } + for i, rt := range got { + if rt != want[i] { + t.Fatalf("Wrong root. Expected %#x, got %#x", want[i], rt) + } + } +} -// func TestReadWriteStateRoots(t *testing.T) { -// t.Run("read up to, but had empty reader", func(t *testing.T) { -// b := bytes.NewBuffer([]byte{}) -// _, err := readStateRoots(b, protocol.Height(100)) -// if err == nil { -// t.Fatal("Wanted error") -// } -// if !strings.Contains(err.Error(), "only read 0 state roots") { -// t.Fatal("Unexpected error") -// } -// }) -// t.Run("read single root", func(t *testing.T) { -// b := bytes.NewBuffer([]byte{}) -// want := common.BytesToHash([]byte("foo")) -// b.Write(want.Bytes()) -// roots, err := readStateRoots(b, protocol.Height(0)) -// if err != nil { -// t.Fatal(err) -// } -// if len(roots) == 0 { -// t.Fatal("Got no roots") -// } -// if roots[0] != want { -// t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) -// } -// }) -// t.Run("Three roots exist, want to read only two", func(t *testing.T) { -// b := bytes.NewBuffer([]byte{}) -// foo := common.BytesToHash([]byte("foo")) -// bar := common.BytesToHash([]byte("bar")) -// baz := common.BytesToHash([]byte("baz")) -// b.Write(foo.Bytes()) -// b.Write(bar.Bytes()) -// b.Write(baz.Bytes()) -// roots, err := readStateRoots(b, protocol.Height(1)) -// if err != nil { -// t.Fatal(err) -// } -// if len(roots) != 2 { -// t.Fatalf("Expected two roots, got %d", len(roots)) -// } -// if roots[0] != foo { -// t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) -// } -// if roots[1] != bar { -// t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) -// } -// }) -// t.Run("Fails to write enough data to writer", func(t *testing.T) { -// m := &mockWriter{wantErr: true} -// err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) -// if err == nil { -// t.Fatal("Wanted error") -// } -// m = &mockWriter{wantErr: false, numWritten: 16} -// err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) -// if err == nil { -// t.Fatal("Wanted error") -// } -// if !strings.Contains(err.Error(), "expected to write 32 bytes") { -// t.Fatalf("Got wrong error kind: %v", err) -// } -// }) -// } +func TestReadWriteStateRoots(t *testing.T) { + t.Run("read up to, but had empty reader", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + _, err := readStateRoots(b, 100) + if err == nil { + t.Fatal("Wanted error") + } + if !strings.Contains(err.Error(), "only read 0 state roots") { + t.Fatal("Unexpected error") + } + }) + t.Run("read single root", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + want := common.BytesToHash([]byte("foo")) + b.Write(want.Bytes()) + roots, err := readStateRoots(b, 0) + if err != nil { + t.Fatal(err) + } + if len(roots) == 0 { + t.Fatal("Got no roots") + } + if roots[0] != want { + t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) + } + }) + t.Run("Three roots exist, want to read only two", func(t *testing.T) { + b := bytes.NewBuffer([]byte{}) + foo := common.BytesToHash([]byte("foo")) + bar := common.BytesToHash([]byte("bar")) + baz := common.BytesToHash([]byte("baz")) + b.Write(foo.Bytes()) + b.Write(bar.Bytes()) + b.Write(baz.Bytes()) + roots, err := readStateRoots(b, 1) + if err != nil { + t.Fatal(err) + } + if len(roots) != 2 { + t.Fatalf("Expected two roots, got %d", len(roots)) + } + if roots[0] != foo { + t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) + } + if roots[1] != bar { + t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) + } + }) + t.Run("Fails to write enough data to writer", func(t *testing.T) { + m := &mockWriter{wantErr: true} + err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) + if err == nil { + t.Fatal("Wanted error") + } + m = &mockWriter{wantErr: false, numWritten: 16} + err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) + if err == nil { + t.Fatal("Wanted error") + } + if !strings.Contains(err.Error(), "expected to write 32 bytes") { + t.Fatalf("Got wrong error kind: %v", err) + } + }) +} -// type mockWriter struct { -// wantErr bool -// numWritten int -// } +type mockWriter struct { + wantErr bool + numWritten int +} -// func (m *mockWriter) Write(_ []byte) (n int, err error) { -// if m.wantErr { -// return 0, errors.New("something went wrong") -// } -// return m.numWritten, nil -// } +func (m *mockWriter) Write(_ []byte) (n int, err error) { + if m.wantErr { + return 0, errors.New("something went wrong") + } + return m.numWritten, nil +} -// type mockReader struct { -// wantErr bool -// err error -// roots []common.Hash -// readIdx int -// bytesRead int -// } +type mockReader struct { + wantErr bool + err error + roots []common.Hash + readIdx int + bytesRead int +} -// func (m *mockReader) Read(out []byte) (n int, err error) { -// if m.wantErr { -// return 0, m.err -// } -// if m.readIdx == len(m.roots) { -// return 0, io.EOF -// } -// copy(out, m.roots[m.readIdx].Bytes()) -// m.readIdx++ -// return m.bytesRead, nil -// } +func (m *mockReader) Read(out []byte) (n int, err error) { + if m.wantErr { + return 0, m.err + } + if m.readIdx == len(m.roots) { + return 0, io.EOF + } + copy(out, m.roots[m.readIdx].Bytes()) + m.readIdx++ + return m.bytesRead, nil +} -// func Test_readStateRoots(t *testing.T) { -// t.Run("Unexpected error", func(t *testing.T) { -// want := []common.Hash{ -// common.BytesToHash([]byte("foo")), -// common.BytesToHash([]byte("bar")), -// common.BytesToHash([]byte("baz")), -// } -// m := &mockReader{wantErr: true, roots: want, err: errors.New("foo")} -// _, err := readStateRoots(m, protocol.Height(1)) -// if err == nil { -// t.Fatal(err) -// } -// if !strings.Contains(err.Error(), "foo") { -// t.Fatalf("Unexpected error: %v", err) -// } -// }) -// t.Run("EOF, but did not read as much as was expected", func(t *testing.T) { -// want := []common.Hash{ -// common.BytesToHash([]byte("foo")), -// common.BytesToHash([]byte("bar")), -// common.BytesToHash([]byte("baz")), -// } -// m := &mockReader{wantErr: true, roots: want, err: io.EOF} -// _, err := readStateRoots(m, protocol.Height(100)) -// if err == nil { -// t.Fatal(err) -// } -// if !strings.Contains(err.Error(), "wanted to read up to 100, but only read 0 state roots") { -// t.Fatalf("Unexpected error: %v", err) -// } -// }) -// t.Run("Reads wrong number of bytes", func(t *testing.T) { -// want := []common.Hash{ -// common.BytesToHash([]byte("foo")), -// common.BytesToHash([]byte("bar")), -// common.BytesToHash([]byte("baz")), -// } -// m := &mockReader{wantErr: false, roots: want, bytesRead: 16} -// _, err := readStateRoots(m, protocol.Height(2)) -// if err == nil { -// t.Fatal(err) -// } -// if !strings.Contains(err.Error(), "expected to read 32 bytes, got 16") { -// t.Fatalf("Unexpected error: %v", err) -// } -// }) -// t.Run("Reads all until EOF", func(t *testing.T) { -// want := []common.Hash{ -// common.BytesToHash([]byte("foo")), -// common.BytesToHash([]byte("bar")), -// common.BytesToHash([]byte("baz")), -// } -// m := &mockReader{wantErr: false, roots: want, bytesRead: 32} -// got, err := readStateRoots(m, protocol.Height(2)) -// if err != nil { -// t.Fatal(err) -// } -// if len(want) != len(got) { -// t.Fatal("Wrong number of roots") -// } -// for i, rt := range got { -// if rt != want[i] { -// t.Fatal("Wrong root") -// } -// } -// }) -// } +func Test_readStateRoots(t *testing.T) { + t.Run("Unexpected error", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: true, roots: want, err: errors.New("foo")} + _, err := readStateRoots(m, 1) + if err == nil { + t.Fatal(err) + } + if !strings.Contains(err.Error(), "foo") { + t.Fatalf("Unexpected error: %v", err) + } + }) + t.Run("EOF, but did not read as much as was expected", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: true, roots: want, err: io.EOF} + _, err := readStateRoots(m, 100) + if err == nil { + t.Fatal(err) + } + if !strings.Contains(err.Error(), "wanted to read up to 100, but only read 0 state roots") { + t.Fatalf("Unexpected error: %v", err) + } + }) + t.Run("Reads wrong number of bytes", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: false, roots: want, bytesRead: 16} + _, err := readStateRoots(m, 2) + if err == nil { + t.Fatal(err) + } + if !strings.Contains(err.Error(), "expected to read 32 bytes, got 16") { + t.Fatalf("Unexpected error: %v", err) + } + }) + t.Run("Reads all until EOF", func(t *testing.T) { + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), + } + m := &mockReader{wantErr: false, roots: want, bytesRead: 32} + got, err := readStateRoots(m, 2) + if err != nil { + t.Fatal(err) + } + if len(want) != len(got) { + t.Fatal("Wrong number of roots") + } + for i, rt := range got { + if rt != want[i] { + t.Fatal("Wrong root") + } + } + }) +} -// func Test_determineFilePath(t *testing.T) { -// type args struct { -// baseDir string -// key *Key -// } -// tests := []struct { -// name string -// args args -// want string -// wantErr bool -// errContains string -// }{ -// { -// name: "OK", -// args: args{ -// baseDir: "", -// key: &Key{ -// MessageHeight: 100, -// StepHeights: []l2stateprovider.Height{l2stateprovider.Height(50)}, -// }, -// }, -// want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", -// wantErr: false, -// }, -// } -// for _, tt := range tests { -// t.Run(tt.name, func(t *testing.T) { -// got, err := determineFilePath(tt.args.baseDir, tt.args.key) -// if (err != nil) != tt.wantErr { -// t.Logf("got: %v, and key %+v, got %s", err, tt.args.key, got) -// if !strings.Contains(err.Error(), tt.errContains) { -// t.Fatalf("Expected %s, got %s", tt.errContains, err.Error()) -// } -// t.Errorf("determineFilePath() error = %v, wantErr %v", err, tt.wantErr) -// return -// } -// if got != tt.want { -// t.Errorf( -// "determineFilePath() = %v, want %v", -// got, -// tt.want, -// ) -// } -// }) -// } -// } +func Test_determineFilePath(t *testing.T) { + type args struct { + baseDir string + key *Key + } + tests := []struct { + name string + args args + want string + wantErr bool + errContains string + }{ + { + name: "OK", + args: args{ + baseDir: "", + key: &Key{ + MessageHeight: 100, + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(50)}, + }, + }, + want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := determineFilePath(tt.args.baseDir, tt.args.key) + if (err != nil) != tt.wantErr { + t.Logf("got: %v, and key %+v, got %s", err, tt.args.key, got) + if !strings.Contains(err.Error(), tt.errContains) { + t.Fatalf("Expected %s, got %s", tt.errContains, err.Error()) + } + t.Errorf("determineFilePath() error = %v, wantErr %v", err, tt.wantErr) + return + } + if got != tt.want { + t.Errorf( + "determineFilePath() = %v, want %v", + got, + tt.want, + ) + } + }) + } +} -// func BenchmarkCache_Read_32Mb(b *testing.B) { -// b.StopTimer() -// basePath, err := ioutil.TempDir("", "*") -// if err != nil { -// b.Fatal(err) -// } -// if err := os.MkdirAll(basePath, os.ModePerm); err != nil { -// b.Fatal(err) -// } -// b.Cleanup(func() { -// if err := os.RemoveAll(basePath); err != nil { -// b.Fatal(err) -// } -// }) -// cache := New(basePath) -// key := &Key{ -// WavmModuleRoot: common.BytesToHash([]byte("foo")), -// MessageHeight: 0, -// StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, -// } -// numRoots := 1 << 20 -// roots := make([]common.Hash, numRoots) -// for i := range roots { -// roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) -// } -// if err = cache.Put(key, roots); err != nil { -// b.Fatal(err) -// } -// b.StartTimer() -// for i := 0; i < b.N; i++ { -// readUpTo := protocol.Height(1 << 20) -// roots, err := cache.Get(key, readUpTo) -// if err != nil { -// b.Fatal(err) -// } -// if len(roots) != numRoots { -// b.Fatalf("Wrong number of roots. Expected %d, got %d", numRoots, len(roots)) -// } -// } -// } +func BenchmarkCache_Read_32Mb(b *testing.B) { + b.StopTimer() + basePath := os.TempDir() + if err := os.MkdirAll(basePath, os.ModePerm); err != nil { + b.Fatal(err) + } + b.Cleanup(func() { + if err := os.RemoveAll(basePath); err != nil { + b.Fatal(err) + } + }) + cache := New(basePath) + key := &Key{ + WavmModuleRoot: common.BytesToHash([]byte("foo")), + MessageHeight: 0, + StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, + } + numRoots := 1 << 20 + roots := make([]common.Hash, numRoots) + for i := range roots { + roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) + } + if err := cache.Put(key, roots); err != nil { + b.Fatal(err) + } + b.StartTimer() + for i := 0; i < b.N; i++ { + readUpTo := uint64(1 << 20) + roots, err := cache.Get(key, readUpTo) + if err != nil { + b.Fatal(err) + } + if len(roots) != numRoots { + b.Fatalf("Wrong number of roots. Expected %d, got %d", numRoots, len(roots)) + } + } +} From 3dff3cad4e8d33d403e137050b81134c1fa9f416 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 14:58:58 -0400 Subject: [PATCH 048/126] cache tests --- staker/challenge-cache/cache_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index ca3b2be34b..bc9a3b2250 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -53,7 +53,7 @@ func TestCache(t *testing.T) { if err != nil { t.Fatal(err) } - got, err := cache.Get(key, 2) + got, err := cache.Get(key, 3) if err != nil { t.Fatal(err) } @@ -82,7 +82,7 @@ func TestReadWriteStateRoots(t *testing.T) { b := bytes.NewBuffer([]byte{}) want := common.BytesToHash([]byte("foo")) b.Write(want.Bytes()) - roots, err := readStateRoots(b, 0) + roots, err := readStateRoots(b, 1) if err != nil { t.Fatal(err) } @@ -101,7 +101,7 @@ func TestReadWriteStateRoots(t *testing.T) { b.Write(foo.Bytes()) b.Write(bar.Bytes()) b.Write(baz.Bytes()) - roots, err := readStateRoots(b, 1) + roots, err := readStateRoots(b, 2) if err != nil { t.Fatal(err) } @@ -191,7 +191,7 @@ func Test_readStateRoots(t *testing.T) { if err == nil { t.Fatal(err) } - if !strings.Contains(err.Error(), "wanted to read up to 100, but only read 0 state roots") { + if !strings.Contains(err.Error(), "wanted to read 100") { t.Fatalf("Unexpected error: %v", err) } }) @@ -217,7 +217,7 @@ func Test_readStateRoots(t *testing.T) { common.BytesToHash([]byte("baz")), } m := &mockReader{wantErr: false, roots: want, bytesRead: 32} - got, err := readStateRoots(m, 2) + got, err := readStateRoots(m, 3) if err != nil { t.Fatal(err) } From 8620dadc0b4e31144961a2d74cdba3ad035316e6 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 15:09:43 -0400 Subject: [PATCH 049/126] comments, todos --- staker/challenge-cache/cache.go | 1 - staker/state_provider.go | 23 +++++++++-------------- validator/server_arb/execution_run.go | 15 ++++++++------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 4586c087b4..3f619b817e 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -141,7 +141,6 @@ func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { log.Error("Could not close file after writing", "err", err, "file", fName) } }() - fmt.Printf("Writing %d state roots to file %s\n", len(stateRoots), fName) if err := writeStateRoots(f, stateRoots); err != nil { return err } diff --git a/staker/state_provider.go b/staker/state_provider.go index 008c8f1d01..881cc47c21 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -8,7 +8,6 @@ import ( "fmt" "strings" "sync" - "time" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" @@ -67,7 +66,6 @@ func (s *StateManager) ExecutionStateMsgCount(ctx context.Context, state *protoc return 0, fmt.Errorf("position in batch must be zero, but got %d", state.GlobalState.PosInBatch) } if state.GlobalState.Batch == 1 && state.GlobalState.PosInBatch == 0 { - // TODO: 1 is correct? return 1, nil } batch := state.GlobalState.Batch - 1 @@ -122,13 +120,16 @@ func (s *StateManager) executionStateAtMessageNumberImpl(_ context.Context, mess if err != nil { return &protocol.ExecutionState{}, err } + if globalState.PosInBatch != 0 { + return &protocol.ExecutionState{}, fmt.Errorf("position in batch must be zero, but got %d", globalState.PosInBatch) + } return &protocol.ExecutionState{ - GlobalState: protocol.GoGlobalState(globalState), - MachineStatus: protocol.MachineStatusFinished, // TODO: Why hardcode? + GlobalState: protocol.GoGlobalState(globalState), + // Batches with position 0 consume all the messages from the previous batch, so their machine status is finished. + MachineStatus: protocol.MachineStatusFinished, }, nil } -// TODO: Rename block to message. func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchCount uint64) ([]common.Hash, error) { if blockEnd < blockStart { return nil, fmt.Errorf("end block %v is less than start block %v", blockEnd, blockStart) @@ -137,8 +138,8 @@ func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchC if err != nil { return nil, err } - // TODO: Document why we cannot validate genesis. if batch == 0 { + // Genesis cannot be validated. If genesis is passed in, we start from batch index 1. batch += 1 } // The size is the number of elements being committed to. For example, if the height is 7, there will @@ -147,7 +148,7 @@ func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchC var stateRoots []common.Hash var lastStateRoot common.Hash - // TODO: Document why we cannot validate genesis. + // Genesis cannot be validated. If genesis is passed in, we start from block number 1. if blockStart == 0 { blockStart += 1 } @@ -293,9 +294,6 @@ func (s *StateManager) CollectMachineHashes( case !errors.Is(err, challengecache.ErrNotFoundInCache): return nil, err } - fmt.Println("Cache miss") - start := time.Now() - fmt.Println("Creating entry") entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(cfg.MessageNumber)) if err != nil { return nil, err @@ -304,7 +302,6 @@ func (s *StateManager) CollectMachineHashes( if err != nil { return nil, err } - fmt.Println("Creating run") execRun, err := s.validator.execSpawner.CreateExecutionRun(cfg.WasmModuleRoot, input).Await(ctx) if err != nil { return nil, err @@ -314,10 +311,8 @@ func (s *StateManager) CollectMachineHashes( if err != nil { return nil, err } - fmt.Printf("Took %v to compute %d items\n", time.Since(start), len(result)) - // TODO: Hacky workaround to avoid saving a history commitment to height 0. + // Do not save a history commitment of length 1 to the cache. if len(result) > 1 { - fmt.Printf("Writing key %+v and num items %d\n", cacheKey, len(result)) if err := s.historyCache.Put(cacheKey, result); err != nil { if !errors.Is(err, challengecache.ErrFileAlreadyExists) { return nil, err diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 291c03234b..2cf22d5552 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "sync" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -65,28 +64,29 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes if err != nil { return nil, err } + // If the machine is starting at index 0, we always want to start at the "Machine finished" global state status + // to align with the state roots that the inbox machine will produce. var stateRoots []common.Hash if machineStartIndex == 0 { gs := machine.GetGlobalState() stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) } else { + // Otherwise, we simply append the machine hash at the specified start index. stateRoots = append(stateRoots, machine.Hash()) } + + // If we only want 1 state root, we can return early. if numDesiredLeaves == 1 { return stateRoots, nil } - start := time.Now() for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { + // The absolute opcode position the machine should be in after stepping. position := machineStartIndex + stepSize*(numIterations+1) + // Advance the machine in step size increments. if err := machine.Step(ctx, stepSize); err != nil { return nil, fmt.Errorf("failed to step machine to position %d: %w", position, err) } - machineStep := machine.GetStepCount() - - if numIterations%20 == 0 { - fmt.Printf("Since start %v => num iters %d, expected position %d, machine position %d start index %d, step size %d\n", time.Since(start), numIterations, position, machineStep, machineStartIndex, stepSize) - } // If the machine reached the finished state, we can break out of the loop and append to // our state roots slice a finished machine hash. if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { @@ -99,6 +99,7 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes break } // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. + machineStep := machine.GetStepCount() if position != machineStep { machineRunning := machine.IsRunning() if machineRunning || machineStep > position { From 91abb0e5804b5ba537dd8b9a3a9a600ef980ca8e Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 15:27:12 -0400 Subject: [PATCH 050/126] builds --- staker/manager.go | 6 +++--- system_tests/bold_challenge_protocol_test.go | 7 +++---- util/headerreader/header_reader.go | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/staker/manager.go b/staker/manager.go index 8790a14374..f69136bca7 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -56,9 +56,9 @@ func NewManager( if err != nil { return nil, err } - challengeLeafHeights := make([]l2stateprovider.Height, numBigStepLevel.Uint64()+2) - for i := uint64(0); i <= numBigStepLevel.Uint64()+1; i++ { - leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, uint8(i)) + challengeLeafHeights := make([]l2stateprovider.Height, numBigStepLevel+2) + for i := uint8(0); i <= numBigStepLevel+1; i++ { + leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, i) if err != nil { return nil, err } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index ef4398c214..a16b3f3399 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -303,6 +303,7 @@ func createTestNodeOnL1ForBoldProtocol( ) { if nodeConfig == nil { nodeConfig = arbnode.ConfigDefaultL1Test() + nodeConfig.ParentChainReader.OldHeaderTimeout = time.Minute * 10 } if chainConfig == nil { chainConfig = params.ArbitrumDevTestChainConfig() @@ -428,7 +429,7 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(uint64(6)), // TODO: Hardcoded. + challenge_testing.WithNumBigStepLevels(uint8(6)), // TODO: Hardcoded. challenge_testing.WithConfirmPeriodBlocks(uint64(1500)), // TODO: Hardcoded. ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) @@ -577,9 +578,7 @@ func create2ndNodeWithConfigForBoldProtocol( ) (*ethclient.Client, *arbnode.Node, *solimpl.AssertionChain) { if nodeConfig == nil { nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() - } - if nodeConfig == nil { - nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() + nodeConfig.ParentChainReader.OldHeaderTimeout = 10 * time.Minute } nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 fatalErrChan := make(chan error, 10) diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index 5ad8ccaf33..befd54ace3 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -72,7 +72,7 @@ var DefaultConfig = Config{ PollInterval: 15 * time.Second, SubscribeErrInterval: 5 * time.Minute, TxTimeout: 5 * time.Minute, - OldHeaderTimeout: 10 * time.Minute, + OldHeaderTimeout: 5 * time.Minute, UseFinalityData: true, } From 5c7e04c03b257cb65f00bd24dc119a9a188701c8 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 17:14:07 -0400 Subject: [PATCH 051/126] update commit --- bold | 2 +- staker/challenge-cache/cache.go | 2 -- system_tests/bold_challenge_protocol_test.go | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bold b/bold index 7208ba1d21..aaebff4640 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 7208ba1d2131cfcedf6436aded89a61bbbf9e822 +Subproject commit aaebff46406ed273f8a4afaf7e1e41b6875e4c8e diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 3f619b817e..d260122851 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -87,8 +87,6 @@ func (c *Cache) Get( lookup *Key, numToRead uint64, ) ([]common.Hash, error) { - // TODO: Hack, need to figure out why it is being set to 0 in some places - lookup.MessageHeight = 1 fName, err := determineFilePath(c.baseDir, lookup) if err != nil { return nil, err diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index a16b3f3399..ffbc5a350c 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -429,8 +429,8 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(uint8(6)), // TODO: Hardcoded. - challenge_testing.WithConfirmPeriodBlocks(uint64(1500)), // TODO: Hardcoded. + challenge_testing.WithNumBigStepLevels(uint8(6)), // TODO: Hardcoded. + challenge_testing.WithConfirmPeriodBlocks(uint64(500)), // TODO: Hardcoded. ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) From 32cf9fb5c3f6d4251a80b08ca2bd88774f487198 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 17:19:12 -0400 Subject: [PATCH 052/126] bold commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index aaebff4640..1c31f091a2 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit aaebff46406ed273f8a4afaf7e1e41b6875e4c8e +Subproject commit 1c31f091a29e7285219778b91ef0078e708c6432 From 5fc5b5f27f2d4da4dcddc7339009ff985e11b2a0 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 23:05:30 -0400 Subject: [PATCH 053/126] update bold ref --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 1c31f091a2..e96fb3e0cd 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 1c31f091a29e7285219778b91ef0078e708c6432 +Subproject commit e96fb3e0cd237cb1e15714b335c802d719cc0028 From 251d2f9d452401ef7563ed43fcab6093b7f85669 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 4 Oct 2023 23:45:26 -0400 Subject: [PATCH 054/126] tweak challenge period and ancestor blocks --- system_tests/bold_challenge_protocol_test.go | 12 +++++++++--- system_tests/common_test.go | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index ffbc5a350c..05aefc1ac1 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -285,7 +285,13 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) managerB.Start(ctx) - time.Sleep(time.Hour) + + // Every 10 seconds, send an L1 transaction. + for { + time.Sleep(time.Second * 10) + balance := big.NewInt(params.GWei) + TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + } } func createTestNodeOnL1ForBoldProtocol( @@ -429,8 +435,8 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(uint8(6)), // TODO: Hardcoded. - challenge_testing.WithConfirmPeriodBlocks(uint64(500)), // TODO: Hardcoded. + challenge_testing.WithNumBigStepLevels(uint8(6)), // TODO: Hardcoded. + challenge_testing.WithConfirmPeriodBlocks(uint64(70)), // TODO: Hardcoded. ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) diff --git a/system_tests/common_test.go b/system_tests/common_test.go index 9fd002bd94..2b9e5b325c 100644 --- a/system_tests/common_test.go +++ b/system_tests/common_test.go @@ -404,7 +404,7 @@ func createTestL1BlockChainWithConfig(t *testing.T, l1info info, stackConfig *no nodeConf := ethconfig.Defaults nodeConf.NetworkId = chainConfig.ChainID.Uint64() - l1Genesis := core.DeveloperGenesisBlock(0, 15_000_000, l1info.GetAddress("Faucet")) + l1Genesis := core.DeveloperGenesisBlock(0, 50_000_000, l1info.GetAddress("Faucet")) infoGenesis := l1info.GetGenesisAlloc() for acct, info := range infoGenesis { l1Genesis.Alloc[acct] = info From dd9fdf576a1310dcc4fd30c2428f7f3deca9b14c Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 5 Oct 2023 19:31:27 +0530 Subject: [PATCH 055/126] Empty-Commit From 94594587c908a305de1385a29a1e24f4e9a4c66e Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 5 Oct 2023 19:34:31 +0530 Subject: [PATCH 056/126] Empty-Commit From d76a2df337079d3316e1b15f0e03825005a77996 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 5 Oct 2023 19:36:26 +0530 Subject: [PATCH 057/126] update bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 100ace7af6..ce48f994c0 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 100ace7af61062dba68098d09e728a8aed5e6f6c +Subproject commit ce48f994c0cead5cfb724ced42e5541a24d8c4e0 From 372a166e92e120d1aedc703d2994ce473033fb94 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 5 Oct 2023 19:37:11 +0530 Subject: [PATCH 058/126] Empty-Commit From f3cd9fd82c1e041d9b6356e5c55a9aff38b68fdb Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 5 Oct 2023 19:44:30 +0530 Subject: [PATCH 059/126] update --- staker/manager.go | 6 +++--- system_tests/manager_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/staker/manager.go b/staker/manager.go index 8790a14374..f69136bca7 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -56,9 +56,9 @@ func NewManager( if err != nil { return nil, err } - challengeLeafHeights := make([]l2stateprovider.Height, numBigStepLevel.Uint64()+2) - for i := uint64(0); i <= numBigStepLevel.Uint64()+1; i++ { - leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, uint8(i)) + challengeLeafHeights := make([]l2stateprovider.Height, numBigStepLevel+2) + for i := uint8(0); i <= numBigStepLevel+1; i++ { + leafHeight, err := managerBinding.GetLayerZeroEndHeight(&callOpts, i) if err != nil { return nil, err } diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index 5b8759cc64..5703fba7cc 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -69,7 +69,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), transferGas, ) - _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, l2chainConfig, nil, nil, l2info) + _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, nil, l2chainConfig, nil, l2info) BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) l2info.GenerateAccount("BackgroundUser") balance := big.NewInt(params.Ether) @@ -95,7 +95,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, l2node.InboxReader, l2node.InboxTracker, l2node.TxStreamer, - l2node.Execution.Recorder, + l2node.Execution, l2node.ArbDB, nil, StaticFetcherFrom(t, &blockValidatorConfig), From 9ae6b433cafd0c5e5593cd6b7b004af868518052 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 5 Oct 2023 10:16:05 -0400 Subject: [PATCH 060/126] fix delay --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 18 +++++++++++------- validator/server_arb/execution_run.go | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bold b/bold index e96fb3e0cd..7fd0ac76f7 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e96fb3e0cd237cb1e15714b335c802d719cc0028 +Subproject commit 7fd0ac76f736ff0c467ebc83fedd8635ca86d928 diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 05aefc1ac1..f7def6bcee 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -45,8 +45,8 @@ import ( // 32 Mb of state roots in memory at once. var ( blockChallengeLeafHeight = uint64(1 << 5) // 32 - bigStepChallengeLeafHeight = uint64(1 << 6) // this + the number below should be 2^43 total WAVM opcodes per block. - smallStepChallengeLeafHeight = uint64(1 << 7) + bigStepChallengeLeafHeight = uint64(1 << 5) // testing 5 big step levels, 2^5 each, with small step equalting to 2^31 total. + smallStepChallengeLeafHeight = uint64(1 << 6) ) func TestBoldProtocol(t *testing.T) { @@ -235,7 +235,6 @@ func TestBoldProtocol(t *testing.T) { l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(bigStepChallengeLeafHeight), - l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(smallStepChallengeLeafHeight), }, stateManager, @@ -266,7 +265,6 @@ func TestBoldProtocol(t *testing.T) { l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(bigStepChallengeLeafHeight), - l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(smallStepChallengeLeafHeight), }, stateManagerB, @@ -287,10 +285,16 @@ func TestBoldProtocol(t *testing.T) { managerB.Start(ctx) // Every 10 seconds, send an L1 transaction. + delay := time.Second * 10 for { - time.Sleep(time.Second * 10) + time.Sleep(delay) balance := big.NewInt(params.GWei) TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + latestBlock, err := l1client.BlockNumber(ctx) + Require(t, err) + if latestBlock > 200 { + delay = time.Second + } } } @@ -435,8 +439,8 @@ func deployContractsOnly( BigStepChallengeHeight: bigStepChallengeLeafHeight, SmallStepChallengeHeight: smallStepChallengeLeafHeight, }), - challenge_testing.WithNumBigStepLevels(uint8(6)), // TODO: Hardcoded. - challenge_testing.WithConfirmPeriodBlocks(uint64(70)), // TODO: Hardcoded. + challenge_testing.WithNumBigStepLevels(uint8(5)), // TODO: Hardcoded. + challenge_testing.WithConfirmPeriodBlocks(uint64(150)), // TODO: Hardcoded. ) config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) Require(t, err) diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 2cf22d5552..b43e748d29 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -89,6 +89,7 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes } // If the machine reached the finished state, we can break out of the loop and append to // our state roots slice a finished machine hash. + machineStep := machine.GetStepCount() if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { gs := machine.GetGlobalState() // The last hash should have consumed the whole batch. @@ -96,10 +97,10 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes return nil, errors.New("machine finished in the middle of a batch") } stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + fmt.Printf("Machine total opcodes was %d\n", machineStep) break } // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. - machineStep := machine.GetStepCount() if position != machineStep { machineRunning := machine.IsRunning() if machineRunning || machineStep > position { From 1190c0de27769f8be03dff0bc6169d9bb7e52b89 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 5 Oct 2023 14:58:49 -0400 Subject: [PATCH 061/126] revamp --- bold | 2 +- staker/state_provider.go | 115 ++++++++++++++++------------------- system_tests/manager_test.go | 12 ++-- 3 files changed, 59 insertions(+), 70 deletions(-) diff --git a/bold b/bold index 7fd0ac76f7..e33ce17652 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 7fd0ac76f736ff0c467ebc83fedd8635ca86d928 +Subproject commit e33ce17652f9a7686da25cbc31ab8e578b26464d diff --git a/staker/state_provider.go b/staker/state_provider.go index 881cc47c21..86e0390823 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -61,39 +61,47 @@ func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challeng // ExecutionStateMsgCount If the state manager locally has this validated execution state. // Returns ErrNoExecutionState if not found, or ErrChainCatchingUp if not yet // validated / syncing. -func (s *StateManager) ExecutionStateMsgCount(ctx context.Context, state *protocol.ExecutionState) (uint64, error) { +func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *protocol.ExecutionState) error { if state.GlobalState.PosInBatch != 0 { - return 0, fmt.Errorf("position in batch must be zero, but got %d", state.GlobalState.PosInBatch) + return fmt.Errorf("position in batch must be zero, but got %d", state.GlobalState.PosInBatch) } + // We always agree with the genesis batch. if state.GlobalState.Batch == 1 && state.GlobalState.PosInBatch == 0 { - return 1, nil + return nil } batch := state.GlobalState.Batch - 1 messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) if err != nil { - return 0, err + return err } - validatedExecutionState, err := s.executionStateAtMessageNumberImpl(ctx, uint64(messageCount)-1) + validatedExecutionState, err := s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)-1) if err != nil { - return 0, err + return err } if validatedExecutionState.GlobalState.Batch < batch { - return 0, ErrChainCatchingUp + return ErrChainCatchingUp } res, err := s.validator.streamer.ResultAtCount(messageCount) if err != nil { - return 0, err + return err } if res.BlockHash != state.GlobalState.BlockHash || res.SendRoot != state.GlobalState.SendRoot { - return 0, l2stateprovider.ErrNoExecutionState + return l2stateprovider.ErrNoExecutionState } - return uint64(messageCount), nil + return nil } // ExecutionStateAtMessageNumber Produces the l2 state to assert at the message number specified. // Makes sure that PosInBatch is always 0 -func (s *StateManager) ExecutionStateAtMessageNumber(ctx context.Context, messageNumber uint64) (*protocol.ExecutionState, error) { - executionState, err := s.executionStateAtMessageNumberImpl(ctx, messageNumber) +func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchCount uint64) (*protocol.ExecutionState, error) { + if batchCount == 0 { + return nil, errors.New("batch count cannot be 0") + } + messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchCount - 1) + if err != nil { + return nil, err + } + executionState, err := s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)) if err != nil { return nil, err } @@ -104,19 +112,16 @@ func (s *StateManager) ExecutionStateAtMessageNumber(ctx context.Context, messag return executionState, nil } -func (s *StateManager) executionStateAtMessageNumberImpl(_ context.Context, messageNumber uint64) (*protocol.ExecutionState, error) { - batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(messageNumber)) +func (s *StateManager) executionStateAtMessageCountImpl(_ context.Context, messageCount uint64) (*protocol.ExecutionState, error) { + batchIndex, err := s.findBatchAfterMessageCount(messageCount) if err != nil { return &protocol.ExecutionState{}, err } - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) if err != nil { return &protocol.ExecutionState{}, err } - if batchMsgCount <= arbutil.MessageIndex(messageNumber) { - batch++ - } - globalState, err := s.getInfoAtMessageCountAndBatch(arbutil.MessageIndex(messageNumber), batch) + globalState, err := s.findGlobalStateFromMessageCountAndBatch(batchMsgCount, l2stateprovider.Batch(batchIndex)) if err != nil { return &protocol.ExecutionState{}, err } @@ -130,43 +135,36 @@ func (s *StateManager) executionStateAtMessageNumberImpl(_ context.Context, mess }, nil } -func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchCount uint64) ([]common.Hash, error) { - if blockEnd < blockStart { - return nil, fmt.Errorf("end block %v is less than start block %v", blockEnd, blockStart) +func (s *StateManager) globalStatesUpTo( + startHeight, + endHeight l2stateprovider.Height, + batchIndex l2stateprovider.Batch, +) ([]common.Hash, error) { + if endHeight < startHeight { + return nil, fmt.Errorf("end height %v is less than start height %v", endHeight, startHeight) } - batch, err := s.findBatchAfterMessageCount(arbutil.MessageIndex(blockStart)) + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batchIndex)) if err != nil { return nil, err } - if batch == 0 { - // Genesis cannot be validated. If genesis is passed in, we start from batch index 1. - batch += 1 - } // The size is the number of elements being committed to. For example, if the height is 7, there will // be 8 elements being committed to from [0, 7] inclusive. - desiredStatesLen := int(blockEnd - blockStart + 1) var stateRoots []common.Hash var lastStateRoot common.Hash // Genesis cannot be validated. If genesis is passed in, we start from block number 1. - if blockStart == 0 { - blockStart += 1 - } - for i := blockStart; i <= blockEnd; i++ { - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) + startMessageIndex := batchMsgCount - 1 + start := startMessageIndex + arbutil.MessageIndex(startHeight) + end := startMessageIndex + arbutil.MessageIndex(endHeight) + for i := start; i <= end; i++ { + messageCount := i + 1 + gs, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, batchIndex) if err != nil { return nil, err } - if batchMsgCount <= arbutil.MessageIndex(i) { - batch++ - } - gs, err := s.getInfoAtMessageCountAndBatch(arbutil.MessageIndex(i), batch) - if err != nil { - return nil, err - } - if gs.Batch >= nextBatchCount { - if gs.Batch > nextBatchCount || gs.PosInBatch > 0 { - return nil, fmt.Errorf("overran next batch count %v with global state batch %v position %v", nextBatchCount, gs.Batch, gs.PosInBatch) + if gs.Batch >= uint64(batchIndex) { + if gs.Batch > uint64(batchIndex) || gs.PosInBatch > 0 { + return nil, fmt.Errorf("overran next batch count %v with global state batch %v position %v", batchIndex, gs.Batch, gs.PosInBatch) } break } @@ -174,13 +172,14 @@ func (s *StateManager) statesUpTo(blockStart uint64, blockEnd uint64, nextBatchC stateRoots = append(stateRoots, stateRoot) lastStateRoot = stateRoot } - for len(stateRoots) < desiredStatesLen { + desiredStatesLen := uint64(endHeight - startHeight + 1) + for uint64(len(stateRoots)) < desiredStatesLen { stateRoots = append(stateRoots, lastStateRoot) } return stateRoots, nil } -func (s *StateManager) findBatchAfterMessageCount(msgCount arbutil.MessageIndex) (uint64, error) { +func (s *StateManager) findBatchAfterMessageCount(msgCount uint64) (uint64, error) { if msgCount == 0 { return 0, nil } @@ -209,10 +208,10 @@ func (s *StateManager) findBatchAfterMessageCount(msgCount arbutil.MessageIndex) return 0, fmt.Errorf("failed to get batch metadata while binary searching: %w", err) } } - if batchMsgCount < msgCount { + if uint64(batchMsgCount) < msgCount { low = mid + 1 - } else if batchMsgCount == msgCount { - return mid + 1, nil + } else if uint64(batchMsgCount) == msgCount { + return mid, nil } else if mid == low { // batchMsgCount > msgCount return mid, nil } else { // batchMsgCount > msgCount @@ -221,19 +220,11 @@ func (s *StateManager) findBatchAfterMessageCount(msgCount arbutil.MessageIndex) } } -func (s *StateManager) getInfoAtMessageCountAndBatch(messageCount arbutil.MessageIndex, batch uint64) (validator.GoGlobalState, error) { - globalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, batch) - if err != nil { - return validator.GoGlobalState{}, err - } - return globalState, nil -} - -func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batch uint64) (validator.GoGlobalState, error) { +func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batchIndex l2stateprovider.Batch) (validator.GoGlobalState, error) { var prevBatchMsgCount arbutil.MessageIndex var err error - if batch > 0 { - prevBatchMsgCount, err = s.validator.inboxTracker.GetBatchMessageCount(batch - 1) + if batchIndex > 0 { + prevBatchMsgCount, err = s.validator.inboxTracker.GetBatchMessageCount(uint64(batchIndex)) if err != nil { return validator.GoGlobalState{}, err } @@ -248,7 +239,7 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes return validator.GoGlobalState{ BlockHash: res.BlockHash, SendRoot: res.SendRoot, - Batch: batch, + Batch: uint64(batchIndex), PosInBatch: uint64(count - prevBatchMsgCount), }, nil } @@ -260,7 +251,7 @@ func (s *StateManager) L2MessageStatesUpTo( _ context.Context, from l2stateprovider.Height, upTo option.Option[l2stateprovider.Height], - batch l2stateprovider.Batch, + batchIndex l2stateprovider.Batch, ) ([]common.Hash, error) { var to l2stateprovider.Height if !upTo.IsNone() { @@ -269,7 +260,7 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, err := s.statesUpTo(uint64(from), uint64(to), uint64(batch)) + items, err := s.globalStatesUpTo(from, to, batchIndex) if err != nil { return nil, err } diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index 5b8759cc64..61cec55c9b 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -29,13 +29,10 @@ func TestExecutionStateMsgCount(t *testing.T) { l2node, l1stack, manager := setupManger(t, ctx) defer requireClose(t, l1stack) defer l2node.StopAndWait() - res, err := l2node.TxStreamer.ResultAtCount(1) + res, err := l2node.TxStreamer.ResultAtCount(2) Require(t, err) - msgCount, err := manager.ExecutionStateMsgCount(ctx, &protocol.ExecutionState{GlobalState: protocol.GoGlobalState{Batch: 1, BlockHash: res.BlockHash}}) + err = manager.AgreesWithExecutionState(ctx, &protocol.ExecutionState{GlobalState: protocol.GoGlobalState{Batch: 1, BlockHash: res.BlockHash}}) Require(t, err) - if msgCount != 1 { - Fail(t, "Unexpected msg batch", msgCount, "(expected 1)") - } } func TestExecutionStateAtMessageNumber(t *testing.T) { @@ -44,7 +41,7 @@ func TestExecutionStateAtMessageNumber(t *testing.T) { l2node, l1stack, manager := setupManger(t, ctx) defer requireClose(t, l1stack) defer l2node.StopAndWait() - res, err := l2node.TxStreamer.ResultAtCount(1) + res, err := l2node.TxStreamer.ResultAtCount(2) Require(t, err) expectedState := &protocol.ExecutionState{ GlobalState: protocol.GoGlobalState{ @@ -53,7 +50,8 @@ func TestExecutionStateAtMessageNumber(t *testing.T) { }, MachineStatus: protocol.MachineStatusFinished, } - executionState, err := manager.ExecutionStateAtMessageNumber(ctx, 1) + batchCount := expectedState.GlobalState.Batch + 1 + executionState, err := manager.ExecutionStateAfterBatchCount(ctx, batchCount) Require(t, err) if !reflect.DeepEqual(executionState, expectedState) { Fail(t, "Unexpected executionState", executionState, "(expected ", expectedState, ")") From 0e0ce2598cf584a984b1653ba42fccb01a25bce5 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 5 Oct 2023 16:26:49 -0400 Subject: [PATCH 062/126] amend provider --- staker/state_provider.go | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 86e0390823..410f4118dd 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -63,18 +63,18 @@ func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challeng // validated / syncing. func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *protocol.ExecutionState) error { if state.GlobalState.PosInBatch != 0 { - return fmt.Errorf("position in batch must be zero, but got %d", state.GlobalState.PosInBatch) + return fmt.Errorf("position in batch must be zero, but got %d: %+v", state.GlobalState.PosInBatch, state) } // We always agree with the genesis batch. if state.GlobalState.Batch == 1 && state.GlobalState.PosInBatch == 0 { return nil } - batch := state.GlobalState.Batch - 1 + batch := state.GlobalState.Batch messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) if err != nil { return err } - validatedExecutionState, err := s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)-1) + validatedExecutionState, err := s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)) if err != nil { return err } @@ -156,22 +156,34 @@ func (s *StateManager) globalStatesUpTo( startMessageIndex := batchMsgCount - 1 start := startMessageIndex + arbutil.MessageIndex(startHeight) end := startMessageIndex + arbutil.MessageIndex(endHeight) + + currBatch := batchIndex for i := start; i <= end; i++ { - messageCount := i + 1 - gs, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, batchIndex) + currMessageCount := i + 1 + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(currBatch)) if err != nil { return nil, err } - if gs.Batch >= uint64(batchIndex) { - if gs.Batch > uint64(batchIndex) || gs.PosInBatch > 0 { - return nil, fmt.Errorf("overran next batch count %v with global state batch %v position %v", batchIndex, gs.Batch, gs.PosInBatch) + if batchMsgCount < currMessageCount { + currBatch++ + } + gs, err := s.findGlobalStateFromMessageCountAndBatch(currMessageCount, currBatch) + if err != nil { + if strings.Contains(err.Error(), "no metadata for batch") { + break } - break + return nil, err } stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) stateRoots = append(stateRoots, stateRoot) lastStateRoot = stateRoot } + if len(stateRoots) == 1 { + fmt.Printf("Got state roots %#x\n", stateRoots[0]) + + } else if len(stateRoots) == 2 { + fmt.Printf("Got state roots %#x and %#x\n", stateRoots[0], stateRoots[1]) + } desiredStatesLen := uint64(endHeight - startHeight + 1) for uint64(len(stateRoots)) < desiredStatesLen { stateRoots = append(stateRoots, lastStateRoot) From 6893eb2606cfd6ce11af1f87b002da4c842ad9fc Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Fri, 6 Oct 2023 11:32:41 -0400 Subject: [PATCH 063/126] update bold ref --- bold | 2 +- staker/manager.go | 4 +- staker/state_provider.go | 57 +++++++++--------- system_tests/bold_challenge_protocol_test.go | 61 ++++++++++++++------ system_tests/manager_test.go | 2 +- 5 files changed, 78 insertions(+), 48 deletions(-) diff --git a/bold b/bold index e33ce17652..0a5d00f228 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e33ce17652f9a7686da25cbc31ab8e578b26464d +Subproject commit 0a5d00f2289cf41227424c4e06a47b4ea8f2a181 diff --git a/staker/manager.go b/staker/manager.go index f69136bca7..72731261d8 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -25,7 +25,8 @@ func NewManager( callOpts bind.CallOpts, client arbutil.L1Interface, statelessBlockValidator *StatelessBlockValidator, - historyCacheBaseDir string, + historyCacheBaseDir, + validatorName string, ) (*challengemanager.Manager, error) { chain, err := solimpl.NewAssertionChain( ctx, @@ -69,6 +70,7 @@ func NewManager( statelessBlockValidator, historyCacheBaseDir, challengeLeafHeights, + validatorName, ) if err != nil { return nil, err diff --git a/staker/state_provider.go b/staker/state_provider.go index 410f4118dd..2f1ea50498 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -46,15 +46,17 @@ type StateManager struct { validator *StatelessBlockValidator historyCache challengecache.HistoryCommitmentCacher challengeLeafHeights []l2stateprovider.Height + validatorName string sync.RWMutex } -func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challengeLeafHeights []l2stateprovider.Height) (*StateManager, error) { +func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challengeLeafHeights []l2stateprovider.Height, validatorName string) (*StateManager, error) { historyCache := challengecache.New(cacheBaseDir) return &StateManager{ validator: val, historyCache: historyCache, challengeLeafHeights: challengeLeafHeights, + validatorName: validatorName, }, nil } @@ -66,7 +68,7 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot return fmt.Errorf("position in batch must be zero, but got %d: %+v", state.GlobalState.PosInBatch, state) } // We always agree with the genesis batch. - if state.GlobalState.Batch == 1 && state.GlobalState.PosInBatch == 0 { + if state.GlobalState.Batch == 0 && state.GlobalState.PosInBatch == 0 { return nil } batch := state.GlobalState.Batch @@ -97,7 +99,8 @@ func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchC if batchCount == 0 { return nil, errors.New("batch count cannot be 0") } - messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchCount - 1) + batchIndex := batchCount - 1 + messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) if err != nil { return nil, err } @@ -105,9 +108,15 @@ func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchC if err != nil { return nil, err } + // If the execution state did not consume all messages in a batch, we then return + // the next batch's execution state. if executionState.GlobalState.PosInBatch != 0 { - executionState.GlobalState.Batch++ - executionState.GlobalState.PosInBatch = 0 + batchIndex++ + messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) + if err != nil { + return nil, err + } + return s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)) } return executionState, nil } @@ -125,9 +134,6 @@ func (s *StateManager) executionStateAtMessageCountImpl(_ context.Context, messa if err != nil { return &protocol.ExecutionState{}, err } - if globalState.PosInBatch != 0 { - return &protocol.ExecutionState{}, fmt.Errorf("position in batch must be zero, but got %d", globalState.PosInBatch) - } return &protocol.ExecutionState{ GlobalState: protocol.GoGlobalState(globalState), // Batches with position 0 consume all the messages from the previous batch, so their machine status is finished. @@ -138,12 +144,13 @@ func (s *StateManager) executionStateAtMessageCountImpl(_ context.Context, messa func (s *StateManager) globalStatesUpTo( startHeight, endHeight l2stateprovider.Height, - batchIndex l2stateprovider.Batch, + fromBatch l2stateprovider.Batch, + toBatch l2stateprovider.Batch, ) ([]common.Hash, error) { if endHeight < startHeight { return nil, fmt.Errorf("end height %v is less than start height %v", endHeight, startHeight) } - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batchIndex)) + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch)) if err != nil { return nil, err } @@ -156,8 +163,7 @@ func (s *StateManager) globalStatesUpTo( startMessageIndex := batchMsgCount - 1 start := startMessageIndex + arbutil.MessageIndex(startHeight) end := startMessageIndex + arbutil.MessageIndex(endHeight) - - currBatch := batchIndex + currBatch := fromBatch for i := start; i <= end; i++ { currMessageCount := i + 1 batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(currBatch)) @@ -169,21 +175,19 @@ func (s *StateManager) globalStatesUpTo( } gs, err := s.findGlobalStateFromMessageCountAndBatch(currMessageCount, currBatch) if err != nil { - if strings.Contains(err.Error(), "no metadata for batch") { - break - } return nil, err } + fmt.Printf("%s: appending to roots %+v, curr message count %d, curr batch %d\n", s.validatorName, gs, currMessageCount, currBatch) stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) stateRoots = append(stateRoots, stateRoot) lastStateRoot = stateRoot - } - if len(stateRoots) == 1 { - fmt.Printf("Got state roots %#x\n", stateRoots[0]) - } else if len(stateRoots) == 2 { - fmt.Printf("Got state roots %#x and %#x\n", stateRoots[0], stateRoots[1]) + if gs.Batch >= uint64(toBatch) { + break + } } + fmt.Printf("%s: from batch %d, to batch %d, start %d, end %d, total roots %d, first %#x\n", s.validatorName, fromBatch, toBatch, start, end, len(stateRoots), stateRoots[0]) + desiredStatesLen := uint64(endHeight - startHeight + 1) for uint64(len(stateRoots)) < desiredStatesLen { stateRoots = append(stateRoots, lastStateRoot) @@ -261,18 +265,19 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes // at each message number. func (s *StateManager) L2MessageStatesUpTo( _ context.Context, - from l2stateprovider.Height, - upTo option.Option[l2stateprovider.Height], - batchIndex l2stateprovider.Batch, + fromHeight l2stateprovider.Height, + toHeight option.Option[l2stateprovider.Height], + fromBatch, + toBatch l2stateprovider.Batch, ) ([]common.Hash, error) { var to l2stateprovider.Height - if !upTo.IsNone() { - to = upTo.Unwrap() + if !toHeight.IsNone() { + to = toHeight.Unwrap() } else { blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, err := s.globalStatesUpTo(from, to, batchIndex) + items, err := s.globalStatesUpTo(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index f7def6bcee..1930d5fb28 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -138,6 +138,7 @@ func TestBoldProtocol(t *testing.T) { l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(smallStepChallengeLeafHeight), }, + "good", ) Require(t, err) @@ -156,6 +157,7 @@ func TestBoldProtocol(t *testing.T) { l2stateprovider.Height(bigStepChallengeLeafHeight), l2stateprovider.Height(smallStepChallengeLeafHeight), }, + "evil", ) Require(t, err) @@ -216,11 +218,7 @@ func TestBoldProtocol(t *testing.T) { time.Sleep(10 * time.Second) - t.Log("Honest party posting assertion at batch 2, pos 0") - _, err = poster.PostAssertion(ctx) - Require(t, err) - - t.Log("Evil party posting rival assertion at batch 2, pos 0") + t.Log("Evil party posting assertion at batch 1, pos 0") _, err = posterB.PostAssertion(ctx) Require(t, err) @@ -239,20 +237,6 @@ func TestBoldProtocol(t *testing.T) { }, stateManager, ) - manager, err := challengemanager.New( - ctx, - assertionChain, - l1client, - provider, - assertionChain.RollupAddress(), - challengemanager.WithName("honest"), - challengemanager.WithMode(modes.DefensiveMode), - challengemanager.WithAssertionPostingInterval(time.Hour), - challengemanager.WithAssertionScanningInterval(time.Hour), - challengemanager.WithEdgeTrackerWakeInterval(time.Second), - ) - Require(t, err) - manager.Start(ctx) evilProvider := l2stateprovider.NewHistoryCommitmentProvider( stateManagerB, @@ -269,6 +253,45 @@ func TestBoldProtocol(t *testing.T) { }, stateManagerB, ) + + genesis, err := assertionChain.GenesisAssertionHash(ctx) + Require(t, err) + genesisInfo, err := assertionChain.ReadAssertionCreationInfo(ctx, protocol.AssertionHash{Hash: genesis}) + Require(t, err) + t.Logf("Genesis: %+v", protocol.GoExecutionStateFromSolidity(genesisInfo.AfterState)) + + execStateA, err := provider.ExecutionStateAfterBatchCount(ctx, 1) + Require(t, err) + + execStateB, err := evilProvider.ExecutionStateAfterBatchCount(ctx, 1) + Require(t, err) + + t.Logf("1 batches Exec a %+v", execStateA) + t.Logf("1 batches Exec b %+v", execStateB) + + execStateA, err = provider.ExecutionStateAfterBatchCount(ctx, 2) + Require(t, err) + + execStateB, err = evilProvider.ExecutionStateAfterBatchCount(ctx, 2) + Require(t, err) + + t.Logf("2 batches Exec a %+v", execStateA) + t.Logf("2 batches Exec b %+v", execStateB) + + manager, err := challengemanager.New( + ctx, + assertionChain, + l1client, + provider, + assertionChain.RollupAddress(), + challengemanager.WithName("honest"), + challengemanager.WithMode(modes.DefensiveMode), + challengemanager.WithAssertionPostingInterval(time.Hour), + challengemanager.WithAssertionScanningInterval(time.Hour), + challengemanager.WithEdgeTrackerWakeInterval(time.Second), + ) + Require(t, err) + manager.Start(ctx) managerB, err := challengemanager.New( ctx, chainB, diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go index 61cec55c9b..60543716a1 100644 --- a/system_tests/manager_test.go +++ b/system_tests/manager_test.go @@ -102,7 +102,7 @@ func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, Require(t, err) err = stateless.Start(ctx) Require(t, err) - manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) + manager, err := staker.NewStateManager(stateless, t.TempDir(), nil, "") Require(t, err) return l2node, l1stack, manager } From 584f1ca1b14ff599b4d11d5373d32dd3f385be56 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Fri, 6 Oct 2023 11:32:55 -0400 Subject: [PATCH 064/126] bold ref --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 0a5d00f228..520679e291 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 0a5d00f2289cf41227424c4e06a47b4ea8f2a181 +Subproject commit 520679e2914c75ba4c449b32b8007208619c4f9f From 2b8bad6594729aae992b4f365fcfd2f37b8475fd Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Fri, 6 Oct 2023 17:00:36 -0400 Subject: [PATCH 065/126] amend bold and post batches --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 270 +++++++++---------- 2 files changed, 132 insertions(+), 140 deletions(-) diff --git a/bold b/bold index 520679e291..0a91a36fb5 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 520679e2914c75ba4c449b32b8007208619c4f9f +Subproject commit 0a91a36fb572d99ca03d6e4b8b0f1aa17016a7f1 diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 1930d5fb28..2e554564b7 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -1,8 +1,8 @@ package arbtest import ( + "bytes" "context" - "encoding/hex" "encoding/json" "math/big" "testing" @@ -14,6 +14,7 @@ import ( challengemanager "github.com/OffchainLabs/bold/challenge-manager" modes "github.com/OffchainLabs/bold/challenge-manager/types" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/solgen/go/bridgegen" "github.com/OffchainLabs/bold/solgen/go/mocksgen" "github.com/OffchainLabs/bold/solgen/go/rollupgen" challenge_testing "github.com/OffchainLabs/bold/testing" @@ -27,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" + "github.com/offchainlabs/nitro/arbcompress" "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbnode/execution" "github.com/offchainlabs/nitro/arbos/l2pricing" @@ -60,12 +62,15 @@ func TestBoldProtocol(t *testing.T) { types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), transferGas, ) + ownerBal := big.NewInt(params.Ether) + ownerBal.Mul(ownerBal, big.NewInt(1_000_000)) + l2info.GenerateGenesisAccount("Owner", ownerBal) - _, l2nodeA, l2clientA, _, l1info, _, l1client, l1stack, assertionChain, stakeTokenAddr := createTestNodeOnL1ForBoldProtocol(t, ctx, true, nil, l2chainConfig, nil, l2info) + _, l2nodeA, _, _, l1info, _, l1client, l1stack, assertionChain, stakeTokenAddr := createTestNodeOnL1ForBoldProtocol(t, ctx, true, nil, l2chainConfig, nil, l2info) defer requireClose(t, l1stack) defer l2nodeA.StopAndWait() - l2clientB, l2nodeB, assertionChainB := create2ndNodeWithConfigForBoldProtocol(t, ctx, l2nodeA, l1stack, l1info, &l2info.ArbInitData, arbnode.ConfigDefaultL1Test(), nil, stakeTokenAddr) + _, l2nodeB, assertionChainB := create2ndNodeWithConfigForBoldProtocol(t, ctx, l2nodeA, l1stack, l1info, &l2info.ArbInitData, arbnode.ConfigDefaultL1Test(), nil, stakeTokenAddr) defer l2nodeB.StopAndWait() nodeAGenesis := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() @@ -73,7 +78,6 @@ func TestBoldProtocol(t *testing.T) { if nodeAGenesis != nodeBGenesis { Fail(t, "node A L2 genesis hash", nodeAGenesis, "!= node B L2 genesis hash", nodeBGenesis) } - bridgeBalancesToBoldL2s(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2clientA, l2clientB, ctx) deployAuth := l1info.GetDefaultTransactOpts("RollupOwner", ctx) @@ -175,22 +179,36 @@ func TestBoldProtocol(t *testing.T) { time.Hour, ) - t.Log("Sending a tx from faucet to L2 node A background user") - l2info.GenerateAccount("BackgroundUser") - tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big1, nil) - err = l2clientA.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2clientA, tx) - Require(t, err) + l2info.GenerateAccount("Destination") + sequencerTxOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) - t.Log("Sending a tx from faucet to L2 node B background user") - l2info.Accounts["Faucet"].Nonce = 0 - tx = l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, common.Big2, nil) - err = l2clientB.SendTransaction(ctx, tx) + honestSeqInbox := l1info.GetAddress("SequencerInbox") + evilSeqInbox := l1info.GetAddress("EvilSequencerInbox") + honestSeqInboxBinding, err := bridgegen.NewSequencerInbox(honestSeqInbox, l1client) Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2clientB, tx) + evilSeqInboxBinding, err := bridgegen.NewSequencerInbox(evilSeqInbox, l1client) Require(t, err) + // Post batches to the honest and evil sequencer inbox that are internally equal. + // This means the honest and evil sequencer inboxes will agree with all messages in the batch. + totalMessagesPosted := int64(0) + numMessagesPerBatch := int64(5) + divergeAt := int64(-1) + makeBoldBatch(t, l2nodeA, l2info, l1client, &sequencerTxOpts, honestSeqInboxBinding, honestSeqInbox, numMessagesPerBatch, divergeAt) + l2info.Accounts["Owner"].Nonce = 0 + makeBoldBatch(t, l2nodeB, l2info, l1client, &sequencerTxOpts, evilSeqInboxBinding, evilSeqInbox, numMessagesPerBatch, divergeAt) + totalMessagesPosted += numMessagesPerBatch + + // Next, we post another batch, this time containing more messages. + // We diverge at message index 5 within the evil node's batch. + l2info.Accounts["Owner"].Nonce = 5 + numMessagesPerBatch = int64(10) + makeBoldBatch(t, l2nodeA, l2info, l1client, &sequencerTxOpts, honestSeqInboxBinding, honestSeqInbox, numMessagesPerBatch, divergeAt) + l2info.Accounts["Owner"].Nonce = 5 + divergeAt = int64(5) + makeBoldBatch(t, l2nodeB, l2info, l1client, &sequencerTxOpts, evilSeqInboxBinding, evilSeqInbox, numMessagesPerBatch, divergeAt) + totalMessagesPosted += numMessagesPerBatch + bcA, err := l2nodeA.InboxTracker.GetBatchCount() Require(t, err) bcB, err := l2nodeB.InboxTracker.GetBatchCount() @@ -199,26 +217,44 @@ func TestBoldProtocol(t *testing.T) { Require(t, err) msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) Require(t, err) - accA, err := l2nodeA.InboxTracker.GetBatchAcc(bcA - 1) + + t.Logf("Node A batch count %d, msgs %d", bcA, msgA) + t.Logf("Node B batch count %d, msgs %d", bcB, msgB) + + for { + nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader() + nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader() + isCaughtUp := nodeALatest.Number.Uint64() == uint64(totalMessagesPosted) + areEqual := nodeALatest.Number.Uint64() == nodeBLatest.Number.Uint64() + if isCaughtUp && areEqual { + if nodeALatest.Hash() == nodeBLatest.Hash() { + Fatal(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) + } + break + } + } + + goodBridge, err := bridgegen.NewSequencerInbox(honestSeqInbox, l1client) Require(t, err) - accB, err := l2nodeB.InboxTracker.GetBatchAcc(bcB - 1) + totalGoodBatches, err := goodBridge.BatchCount(&bind.CallOpts{}) Require(t, err) - t.Logf("Node A, count %d, msgs %d, acc %s", bcA, msgA, accA) - t.Logf("Node B, count %d, msgs %d, acc %s", bcB, msgB, accB) - nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() - nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() - if nodeALatest == nodeBLatest { - Fail(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) - } + evilBridge, err := bridgegen.NewSequencerInbox(evilSeqInbox, l1client) + Require(t, err) + totalEvilBatches, err := evilBridge.BatchCount(&bind.CallOpts{}) + Require(t, err) + + t.Logf("Total good %d, total bad %d", totalGoodBatches.Uint64(), totalEvilBatches.Uint64()) t.Log("Honest party posting assertion at batch 1, pos 0") _, err = poster.PostAssertion(ctx) Require(t, err) - time.Sleep(10 * time.Second) + t.Log("Honest party posting assertion at batch 3, pos 0") + _, err = poster.PostAssertion(ctx) + Require(t, err) - t.Log("Evil party posting assertion at batch 1, pos 0") + t.Log("Evil party posting assertion at batch 3, pos 0") _, err = posterB.PostAssertion(ctx) Require(t, err) @@ -254,30 +290,6 @@ func TestBoldProtocol(t *testing.T) { stateManagerB, ) - genesis, err := assertionChain.GenesisAssertionHash(ctx) - Require(t, err) - genesisInfo, err := assertionChain.ReadAssertionCreationInfo(ctx, protocol.AssertionHash{Hash: genesis}) - Require(t, err) - t.Logf("Genesis: %+v", protocol.GoExecutionStateFromSolidity(genesisInfo.AfterState)) - - execStateA, err := provider.ExecutionStateAfterBatchCount(ctx, 1) - Require(t, err) - - execStateB, err := evilProvider.ExecutionStateAfterBatchCount(ctx, 1) - Require(t, err) - - t.Logf("1 batches Exec a %+v", execStateA) - t.Logf("1 batches Exec b %+v", execStateB) - - execStateA, err = provider.ExecutionStateAfterBatchCount(ctx, 2) - Require(t, err) - - execStateB, err = evilProvider.ExecutionStateAfterBatchCount(ctx, 2) - Require(t, err) - - t.Logf("2 batches Exec a %+v", execStateA) - t.Logf("2 batches Exec b %+v", execStateB) - manager, err := challengemanager.New( ctx, assertionChain, @@ -308,17 +320,17 @@ func TestBoldProtocol(t *testing.T) { managerB.Start(ctx) // Every 10 seconds, send an L1 transaction. - delay := time.Second * 10 - for { - time.Sleep(delay) - balance := big.NewInt(params.GWei) - TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) - latestBlock, err := l1client.BlockNumber(ctx) - Require(t, err) - if latestBlock > 200 { - delay = time.Second - } - } + // delay := time.Second * 10 + // for { + // time.Sleep(delay) + // balance := big.NewInt(params.GWei) + // TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + // latestBlock, err := l1client.BlockNumber(ctx) + // Require(t, err) + // if latestBlock > 200 { + // delay = time.Second + // } + // } } func createTestNodeOnL1ForBoldProtocol( @@ -533,71 +545,6 @@ func deployContractsOnly( }, chain } -func bridgeBalancesToBoldL2s( - t *testing.T, account string, amount *big.Int, l1info info, l2info info, l1client client, l2clientA client, l2clientB client, ctx context.Context, -) (*types.Transaction, *types.Receipt) { - t.Helper() - - // setup or validate the same account on l2info - l1acct := l1info.GetInfoWithPrivKey(account) - if l2info.Accounts[account] == nil { - l2info.SetFullAccountInfo(account, &AccountInfo{ - Address: l1acct.Address, - PrivateKey: l1acct.PrivateKey, - Nonce: 0, - }) - } else { - l2acct := l2info.GetInfoWithPrivKey(account) - if l2acct.PrivateKey.X.Cmp(l1acct.PrivateKey.X) != 0 || - l2acct.PrivateKey.Y.Cmp(l1acct.PrivateKey.Y) != 0 { - Fatal(t, "l2 account already exists and not compatible to l1") - } - } - - // check previous balance - l2Balance, err := l2clientA.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) - Require(t, err) - l2BalanceB, err := l2clientB.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) - Require(t, err) - - // send transaction - data, err := hex.DecodeString("0f4d14e9000000000000000000000000000000000000000000000000000082f79cd90000") - Require(t, err) - tx := l1info.PrepareTx(account, "Inbox", l1info.TransferGas*100, amount, data) - err = l1client.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l1client, tx) - Require(t, err) - - tx = l1info.PrepareTx(account, "EvilInbox", l1info.TransferGas*100, amount, data) - err = l1client.SendTransaction(ctx, tx) - Require(t, err) - res, err := EnsureTxSucceeded(ctx, l1client, tx) - Require(t, err) - _ = res - - // wait for balance to appear in l2 - l2Balance.Add(l2Balance, amount) - l2BalanceB.Add(l2BalanceB, amount) - for i := 0; true; i++ { - balanceA, err := l2clientA.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) - Require(t, err) - balanceB, err := l2clientB.BalanceAt(ctx, l2info.GetAddress("Faucet"), nil) - Require(t, err) - if balanceA.Cmp(l2Balance) >= 0 && balanceB.Cmp(l2BalanceB) >= 0 { - t.Log("Balance was bridged to two L2 nodes successfully") - break - } - TransferBalance(t, "Faucet", "User", big.NewInt(1), l1info, l1client, ctx) - if i > 50 { - Fatal(t, "bridging failed") - } - <-time.After(time.Millisecond * 100) - } - - return tx, res -} - func create2ndNodeWithConfigForBoldProtocol( t *testing.T, ctx context.Context, @@ -609,18 +556,24 @@ func create2ndNodeWithConfigForBoldProtocol( stackConfig *node.Config, stakeTokenAddr common.Address, ) (*ethclient.Client, *arbnode.Node, *solimpl.AssertionChain) { - if nodeConfig == nil { - nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() - nodeConfig.ParentChainReader.OldHeaderTimeout = 10 * time.Minute - } - nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 fatalErrChan := make(chan error, 10) l1rpcClient, err := l1stack.Attach() if err != nil { Fatal(t, err) } l1client := ethclient.NewClient(l1rpcClient) + chainConfig := first.Execution.ArbInterface.BlockChain().Config() + addresses, assertionChain := deployContractsOnly(t, ctx, l1info, l1client, chainConfig.ChainID, stakeTokenAddr) + + l1info.SetContract("EvilBridge", addresses.Bridge) + l1info.SetContract("EvilSequencerInbox", addresses.SequencerInbox) + l1info.SetContract("EvilInbox", addresses.Inbox) + if nodeConfig == nil { + nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() + nodeConfig.ParentChainReader.OldHeaderTimeout = 10 * time.Minute + } + nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 if stackConfig == nil { stackConfig = stackConfigForTest(t) } @@ -632,13 +585,6 @@ func create2ndNodeWithConfigForBoldProtocol( l2arbDb, err := l2stack.OpenDatabase("arbdb", 0, 0, "", false) Require(t, err) - chainConfig := first.Execution.ArbInterface.BlockChain().Config() - addresses, assertionChain := deployContractsOnly(t, ctx, l1info, l1client, chainConfig.ChainID, stakeTokenAddr) - - l1info.SetContract("EvilBridge", addresses.Bridge) - l1info.SetContract("EvilSequencerInbox", addresses.SequencerInbox) - l1info.SetContract("EvilInbox", addresses.Inbox) - AddDefaultValNode(t, ctx, nodeConfig, true) dataSigner := signature.DataSignerFromPrivateKey(l1info.GetInfoWithPrivKey("Sequencer").PrivateKey) @@ -661,3 +607,49 @@ func create2ndNodeWithConfigForBoldProtocol( return l2client, l2node, assertionChain } + +func makeBoldBatch( + t *testing.T, + l2Node *arbnode.Node, + l2Info *BlockchainTestInfo, + backend *ethclient.Client, + sequencer *bind.TransactOpts, + seqInbox *bridgegen.SequencerInbox, + seqInboxAddr common.Address, + messagesPerBatch, + divergeAtIndex int64, +) { + ctx := context.Background() + + batchBuffer := bytes.NewBuffer([]byte{}) + for i := int64(0); i < messagesPerBatch; i++ { + value := i + if i == divergeAtIndex { + value++ + } + err := writeTxToBatch(batchBuffer, l2Info.PrepareTx("Owner", "Destination", 1000000, big.NewInt(value), []byte{})) + Require(t, err) + } + compressed, err := arbcompress.CompressWell(batchBuffer.Bytes()) + Require(t, err) + message := append([]byte{0}, compressed...) + + seqNum := new(big.Int).Lsh(common.Big1, 256) + seqNum.Sub(seqNum, common.Big1) + tx, err := seqInbox.AddSequencerL2BatchFromOrigin0(sequencer, seqNum, message, big.NewInt(1), common.Address{}, big.NewInt(0), big.NewInt(0)) + Require(t, err) + receipt, err := EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + + nodeSeqInbox, err := arbnode.NewSequencerInbox(backend, seqInboxAddr, 0) + Require(t, err) + batches, err := nodeSeqInbox.LookupBatchesInRange(ctx, receipt.BlockNumber, receipt.BlockNumber) + Require(t, err) + if len(batches) == 0 { + Fatal(t, "batch not found after AddSequencerL2BatchFromOrigin") + } + err = l2Node.InboxTracker.AddSequencerBatches(ctx, backend, batches) + Require(t, err) + _, err = l2Node.InboxTracker.GetBatchMetadata(0) + Require(t, err, "failed to get batch metadata after adding batch:") +} From 80caa0fdcd57d86f40e9f9b398f1be09270bcea1 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 9 Oct 2023 12:05:11 -0400 Subject: [PATCH 066/126] attempts --- staker/state_provider.go | 42 +++++++++++++++----- system_tests/bold_challenge_protocol_test.go | 30 +++++++------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 2f1ea50498..3d7b335499 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -68,10 +68,20 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot return fmt.Errorf("position in batch must be zero, but got %d: %+v", state.GlobalState.PosInBatch, state) } // We always agree with the genesis batch. - if state.GlobalState.Batch == 0 && state.GlobalState.PosInBatch == 0 { + batch := state.GlobalState.Batch + if batch == 0 && state.GlobalState.PosInBatch == 0 { return nil } - batch := state.GlobalState.Batch + if batch == 1 && state.GlobalState.PosInBatch == 0 { + return nil + } + totalBatches, err := s.validator.inboxTracker.GetBatchCount() + if err != nil { + return err + } + if batch >= totalBatches { + batch = batch - 1 + } messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) if err != nil { return err @@ -83,6 +93,7 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot if validatedExecutionState.GlobalState.Batch < batch { return ErrChainCatchingUp } + fmt.Printf("Checking if we have result at count %d, batch %d\n", messageCount, batch) res, err := s.validator.streamer.ResultAtCount(messageCount) if err != nil { return err @@ -111,12 +122,9 @@ func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchC // If the execution state did not consume all messages in a batch, we then return // the next batch's execution state. if executionState.GlobalState.PosInBatch != 0 { - batchIndex++ - messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) - if err != nil { - return nil, err - } - return s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)) + fmt.Printf("%s: needing to increase: %+v\n", s.validatorName, executionState.GlobalState) + executionState.GlobalState.Batch += 1 + executionState.GlobalState.PosInBatch = 0 } return executionState, nil } @@ -150,7 +158,7 @@ func (s *StateManager) globalStatesUpTo( if endHeight < startHeight { return nil, fmt.Errorf("end height %v is less than start height %v", endHeight, startHeight) } - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch)) + batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) if err != nil { return nil, err } @@ -173,10 +181,22 @@ func (s *StateManager) globalStatesUpTo( if batchMsgCount < currMessageCount { currBatch++ } + totalBatches, err := s.validator.inboxTracker.GetBatchCount() + if err != nil { + return nil, err + } + if uint64(currBatch) >= totalBatches { + break + } gs, err := s.findGlobalStateFromMessageCountAndBatch(currMessageCount, currBatch) if err != nil { return nil, err } + fmt.Printf("%s: had pos in batch %d, but batch message count %d\n", s.validatorName, gs.PosInBatch, batchMsgCount) + if gs.PosInBatch == uint64(batchMsgCount)-1 { + gs.Batch += 1 + gs.PosInBatch = 0 + } fmt.Printf("%s: appending to roots %+v, curr message count %d, curr batch %d\n", s.validatorName, gs, currMessageCount, currBatch) stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) stateRoots = append(stateRoots, stateRoot) @@ -240,7 +260,7 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes var prevBatchMsgCount arbutil.MessageIndex var err error if batchIndex > 0 { - prevBatchMsgCount, err = s.validator.inboxTracker.GetBatchMessageCount(uint64(batchIndex)) + prevBatchMsgCount, err = s.validator.inboxTracker.GetBatchMessageCount(uint64(batchIndex) - 1) if err != nil { return validator.GoGlobalState{}, err } @@ -250,7 +270,7 @@ func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.Mes } res, err := s.validator.streamer.ResultAtCount(count) if err != nil { - return validator.GoGlobalState{}, err + return validator.GoGlobalState{}, fmt.Errorf("%s: could not check if we have result at count %d: %w", s.validatorName, count, err) } return validator.GoGlobalState{ BlockHash: res.BlockHash, diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 2e554564b7..c0c6432e45 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -244,17 +244,17 @@ func TestBoldProtocol(t *testing.T) { totalEvilBatches, err := evilBridge.BatchCount(&bind.CallOpts{}) Require(t, err) - t.Logf("Total good %d, total bad %d", totalGoodBatches.Uint64(), totalEvilBatches.Uint64()) + t.Logf("Total good batches %d, total bad batches %d", totalGoodBatches.Uint64(), totalEvilBatches.Uint64()) t.Log("Honest party posting assertion at batch 1, pos 0") _, err = poster.PostAssertion(ctx) Require(t, err) - t.Log("Honest party posting assertion at batch 3, pos 0") + t.Log("Honest party posting assertion at batch 2, pos 0") _, err = poster.PostAssertion(ctx) Require(t, err) - t.Log("Evil party posting assertion at batch 3, pos 0") + t.Log("Evil party posting assertion at batch 2, pos 0") _, err = posterB.PostAssertion(ctx) Require(t, err) @@ -319,18 +319,18 @@ func TestBoldProtocol(t *testing.T) { Require(t, err) managerB.Start(ctx) - // Every 10 seconds, send an L1 transaction. - // delay := time.Second * 10 - // for { - // time.Sleep(delay) - // balance := big.NewInt(params.GWei) - // TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) - // latestBlock, err := l1client.BlockNumber(ctx) - // Require(t, err) - // if latestBlock > 200 { - // delay = time.Second - // } - // } + //Every 10 seconds, send an L1 transaction. + delay := time.Second * 10 + for { + time.Sleep(delay) + balance := big.NewInt(params.GWei) + TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + latestBlock, err := l1client.BlockNumber(ctx) + Require(t, err) + if latestBlock > 200 { + delay = time.Second + } + } } func createTestNodeOnL1ForBoldProtocol( From 042ed077d1a89d9340e8a6f98e7c08e8b18b0429 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 9 Oct 2023 18:41:21 -0400 Subject: [PATCH 067/126] include msg checks --- staker/state_provider.go | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/staker/state_provider.go b/staker/state_provider.go index 3d7b335499..53a56f4c04 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -149,6 +149,45 @@ func (s *StateManager) executionStateAtMessageCountImpl(_ context.Context, messa }, nil } +func (s *StateManager) statesUpTo( + fromBatch, + toBatch l2stateprovider.Batch, +) ([]common.Hash, error) { + // The last message's batch count. + prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) + if err != nil { + return nil, err + } + gs, err := s.findGlobalStateFromMessageCountAndBatch(prevBatchMsgCount, fromBatch-1) + if err != nil { + return nil, err + } + if gs.PosInBatch == 0 { + return nil, errors.New("final state of batch cannot be at position zero") + } + // The start state root of our history commitment starts at `batch: fromBatch, pos: 0` using the state + // from the last batch. + gs.Batch += 1 + gs.PosInBatch = 0 + stateRoots := []common.Hash{ + crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), + } + // TODO: Figure out if we need to end early. + + // Figure out the total number of messages we want to look over. + endBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(toBatch)) + if err != nil { + return nil, err + } + + totalMessagesInRange := (endBatchMsgCount - prevBatchMsgCount) + 1 + + // TODO: Check if it is > the max height we care about. + + // From there, we compute the final state of the last batch. + return stateRoots, nil +} + func (s *StateManager) globalStatesUpTo( startHeight, endHeight l2stateprovider.Height, @@ -206,6 +245,17 @@ func (s *StateManager) globalStatesUpTo( break } } + if len(stateRoots) > 1 { + gs, err := s.findGlobalStateFromMessageCountAndBatch(16, 2) + if err != nil { + return nil, err + } + gs.Batch = 3 + gs.PosInBatch = 0 + fmt.Printf("Appending %+v\n", gs) + stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) + stateRoots = append(stateRoots, stateRoot) + } fmt.Printf("%s: from batch %d, to batch %d, start %d, end %d, total roots %d, first %#x\n", s.validatorName, fromBatch, toBatch, start, end, len(stateRoots), stateRoots[0]) desiredStatesLen := uint64(endHeight - startHeight + 1) From 484ff9831057293e2fb8ba97eec2a967756f15ba Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 10 Oct 2023 14:38:12 -0400 Subject: [PATCH 068/126] include unit test passing execution global state range checks --- staker/state_provider.go | 292 ++++++++++++---------------- system_tests/state_provider_test.go | 131 +++++++++++++ 2 files changed, 254 insertions(+), 169 deletions(-) create mode 100644 system_tests/state_provider_test.go diff --git a/staker/state_provider.go b/staker/state_provider.go index 53a56f4c04..678fdd43a2 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -6,7 +6,6 @@ import ( "context" "errors" "fmt" - "strings" "sync" "github.com/ethereum/go-ethereum/accounts/abi" @@ -42,6 +41,14 @@ var ( ErrChainCatchingUp = errors.New("chain catching up") ) +type Opt func(*StateManager) + +func DisableCache() Opt { + return func(sm *StateManager) { + sm.historyCache = nil + } +} + type StateManager struct { validator *StatelessBlockValidator historyCache challengecache.HistoryCommitmentCacher @@ -50,14 +57,24 @@ type StateManager struct { sync.RWMutex } -func NewStateManager(val *StatelessBlockValidator, cacheBaseDir string, challengeLeafHeights []l2stateprovider.Height, validatorName string) (*StateManager, error) { +func NewStateManager( + val *StatelessBlockValidator, + cacheBaseDir string, + challengeLeafHeights []l2stateprovider.Height, + validatorName string, + opts ...Opt, +) (*StateManager, error) { historyCache := challengecache.New(cacheBaseDir) - return &StateManager{ + sm := &StateManager{ validator: val, historyCache: historyCache, challengeLeafHeights: challengeLeafHeights, validatorName: validatorName, - }, nil + } + for _, o := range opts { + o(sm) + } + return sm, nil } // ExecutionStateMsgCount If the state manager locally has this validated execution state. @@ -86,19 +103,14 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot if err != nil { return err } - validatedExecutionState, err := s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)) + validatedGlobalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, l2stateprovider.Batch(batch)) if err != nil { return err } - if validatedExecutionState.GlobalState.Batch < batch { + if validatedGlobalState.Batch < batch { return ErrChainCatchingUp } - fmt.Printf("Checking if we have result at count %d, batch %d\n", messageCount, batch) - res, err := s.validator.streamer.ResultAtCount(messageCount) - if err != nil { - return err - } - if res.BlockHash != state.GlobalState.BlockHash || res.SendRoot != state.GlobalState.SendRoot { + if state.GlobalState.BlockHash != validatedGlobalState.BlockHash || state.GlobalState.SendRoot != state.GlobalState.SendRoot { return l2stateprovider.ErrNoExecutionState } return nil @@ -115,55 +127,48 @@ func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchC if err != nil { return nil, err } - executionState, err := s.executionStateAtMessageCountImpl(ctx, uint64(messageCount)) + globalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, l2stateprovider.Batch(batchIndex)) if err != nil { return nil, err } + executionState := &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState(globalState), + MachineStatus: protocol.MachineStatusFinished, + } // If the execution state did not consume all messages in a batch, we then return // the next batch's execution state. if executionState.GlobalState.PosInBatch != 0 { - fmt.Printf("%s: needing to increase: %+v\n", s.validatorName, executionState.GlobalState) executionState.GlobalState.Batch += 1 executionState.GlobalState.PosInBatch = 0 } return executionState, nil } -func (s *StateManager) executionStateAtMessageCountImpl(_ context.Context, messageCount uint64) (*protocol.ExecutionState, error) { - batchIndex, err := s.findBatchAfterMessageCount(messageCount) - if err != nil { - return &protocol.ExecutionState{}, err - } - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) - if err != nil { - return &protocol.ExecutionState{}, err +func (s *StateManager) StatesInBatchRange( + fromHeight, + toHeight l2stateprovider.Height, + fromBatch, + toBatch l2stateprovider.Batch, +) ([]common.Hash, []validator.GoGlobalState, error) { + // Check integrity of the arguments. + if fromBatch > toBatch { + return nil, nil, fmt.Errorf("from batch %v is greater than to batch %v", fromBatch, toBatch) } - globalState, err := s.findGlobalStateFromMessageCountAndBatch(batchMsgCount, l2stateprovider.Batch(batchIndex)) - if err != nil { - return &protocol.ExecutionState{}, err + if fromHeight > toHeight { + return nil, nil, fmt.Errorf("from height %v is greater than to height %v", fromHeight, toHeight) } - return &protocol.ExecutionState{ - GlobalState: protocol.GoGlobalState(globalState), - // Batches with position 0 consume all the messages from the previous batch, so their machine status is finished. - MachineStatus: protocol.MachineStatusFinished, - }, nil -} -func (s *StateManager) statesUpTo( - fromBatch, - toBatch l2stateprovider.Batch, -) ([]common.Hash, error) { // The last message's batch count. prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) if err != nil { - return nil, err + return nil, nil, err } gs, err := s.findGlobalStateFromMessageCountAndBatch(prevBatchMsgCount, fromBatch-1) if err != nil { - return nil, err + return nil, nil, err } if gs.PosInBatch == 0 { - return nil, errors.New("final state of batch cannot be at position zero") + return nil, nil, errors.New("final state of batch cannot be at position zero") } // The start state root of our history commitment starts at `batch: fromBatch, pos: 0` using the state // from the last batch. @@ -172,140 +177,87 @@ func (s *StateManager) statesUpTo( stateRoots := []common.Hash{ crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), } - // TODO: Figure out if we need to end early. + globalStates := []validator.GoGlobalState{gs} - // Figure out the total number of messages we want to look over. - endBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(toBatch)) - if err != nil { - return nil, err - } - - totalMessagesInRange := (endBatchMsgCount - prevBatchMsgCount) + 1 - - // TODO: Check if it is > the max height we care about. - - // From there, we compute the final state of the last batch. - return stateRoots, nil -} - -func (s *StateManager) globalStatesUpTo( - startHeight, - endHeight l2stateprovider.Height, - fromBatch l2stateprovider.Batch, - toBatch l2stateprovider.Batch, -) ([]common.Hash, error) { - if endHeight < startHeight { - return nil, fmt.Errorf("end height %v is less than start height %v", endHeight, startHeight) - } - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) - if err != nil { - return nil, err - } - // The size is the number of elements being committed to. For example, if the height is 7, there will - // be 8 elements being committed to from [0, 7] inclusive. - var stateRoots []common.Hash - var lastStateRoot common.Hash - - // Genesis cannot be validated. If genesis is passed in, we start from block number 1. - startMessageIndex := batchMsgCount - 1 - start := startMessageIndex + arbutil.MessageIndex(startHeight) - end := startMessageIndex + arbutil.MessageIndex(endHeight) - currBatch := fromBatch - for i := start; i <= end; i++ { - currMessageCount := i + 1 - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(currBatch)) + // Check if there are enough messages in the range to satisfy our request. + totalDesiredHashes := (toHeight - fromHeight) + 1 + for batch := fromBatch; batch < toBatch; batch++ { + msgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batch)) if err != nil { - return nil, err + return nil, nil, err } - if batchMsgCount < currMessageCount { - currBatch++ - } - totalBatches, err := s.validator.inboxTracker.GetBatchCount() - if err != nil { - return nil, err - } - if uint64(currBatch) >= totalBatches { - break - } - gs, err := s.findGlobalStateFromMessageCountAndBatch(currMessageCount, currBatch) - if err != nil { - return nil, err - } - fmt.Printf("%s: had pos in batch %d, but batch message count %d\n", s.validatorName, gs.PosInBatch, batchMsgCount) - if gs.PosInBatch == uint64(batchMsgCount)-1 { - gs.Batch += 1 - gs.PosInBatch = 0 - } - fmt.Printf("%s: appending to roots %+v, curr message count %d, curr batch %d\n", s.validatorName, gs, currMessageCount, currBatch) - stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) - stateRoots = append(stateRoots, stateRoot) - lastStateRoot = stateRoot + var lastGlobalState validator.GoGlobalState - if gs.Batch >= uint64(toBatch) { - break - } - } - if len(stateRoots) > 1 { - gs, err := s.findGlobalStateFromMessageCountAndBatch(16, 2) - if err != nil { - return nil, err + msgsInBatch := msgCount - prevBatchMsgCount + for i := uint64(1); i <= uint64(msgsInBatch); i++ { + msgIndex := uint64(prevBatchMsgCount) + i + gs, err := s.findGlobalStateFromMessageCountAndBatch(arbutil.MessageIndex(msgIndex), batch) + if err != nil { + return nil, nil, err + } + globalStates = append(globalStates, gs) + stateRoots = append(stateRoots, + crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), + ) + lastGlobalState = gs } - gs.Batch = 3 - gs.PosInBatch = 0 - fmt.Printf("Appending %+v\n", gs) - stateRoot := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) - stateRoots = append(stateRoots, stateRoot) + prevBatchMsgCount = msgCount + lastGlobalState.Batch += 1 + lastGlobalState.PosInBatch = 0 + stateRoots = append(stateRoots, + crypto.Keccak256Hash([]byte("Machine finished:"), lastGlobalState.Hash().Bytes()), + ) + globalStates = append(globalStates, lastGlobalState) } - fmt.Printf("%s: from batch %d, to batch %d, start %d, end %d, total roots %d, first %#x\n", s.validatorName, fromBatch, toBatch, start, end, len(stateRoots), stateRoots[0]) - desiredStatesLen := uint64(endHeight - startHeight + 1) - for uint64(len(stateRoots)) < desiredStatesLen { - stateRoots = append(stateRoots, lastStateRoot) + for uint64(len(stateRoots)) < uint64(totalDesiredHashes) { + stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) } - return stateRoots, nil -} -func (s *StateManager) findBatchAfterMessageCount(msgCount uint64) (uint64, error) { - if msgCount == 0 { - return 0, nil - } - low := uint64(0) - batchCount, err := s.validator.inboxTracker.GetBatchCount() - if err != nil { - return 0, err - } - high := batchCount - for { - // Binary search invariants: - // - messageCount(high) >= msgCount - // - messageCount(low-1) < msgCount - // - high >= low - if high < low { - return 0, fmt.Errorf("when attempting to find batch for message count %v high %v < low %v", msgCount, high, low) - } - mid := (low + high) / 2 - batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(mid) - if err != nil { - // TODO: There is a circular dep with the error in inbox_tracker.go, we - // should move it somewhere else and use errors.Is. - if strings.Contains(err.Error(), "accumulator not found") { - high = mid - } else { - return 0, fmt.Errorf("failed to get batch metadata while binary searching: %w", err) - } - } - if uint64(batchMsgCount) < msgCount { - low = mid + 1 - } else if uint64(batchMsgCount) == msgCount { - return mid, nil - } else if mid == low { // batchMsgCount > msgCount - return mid, nil - } else { // batchMsgCount > msgCount - high = mid - } - } + return stateRoots, globalStates, nil } +// func (s *StateManager) findBatchAfterMessageCount(msgCount uint64) (uint64, error) { +// if msgCount == 0 { +// return 0, nil +// } +// low := uint64(0) +// batchCount, err := s.validator.inboxTracker.GetBatchCount() +// if err != nil { +// return 0, err +// } +// high := batchCount +// for { +// // Binary search invariants: +// // - messageCount(high) >= msgCount +// // - messageCount(low-1) < msgCount +// // - high >= low +// if high < low { +// return 0, fmt.Errorf("when attempting to find batch for message count %v high %v < low %v", msgCount, high, low) +// } +// mid := (low + high) / 2 +// batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(mid) +// if err != nil { +// // TODO: There is a circular dep with the error in inbox_tracker.go, we +// // should move it somewhere else and use errors.Is. +// if strings.Contains(err.Error(), "accumulator not found") { +// high = mid +// } else { +// return 0, fmt.Errorf("failed to get batch metadata while binary searching: %w", err) +// } +// } +// if uint64(batchMsgCount) < msgCount { +// low = mid + 1 +// } else if uint64(batchMsgCount) == msgCount { +// return mid, nil +// } else if mid == low { // batchMsgCount > msgCount +// return mid, nil +// } else { // batchMsgCount > msgCount +// high = mid +// } +// } +// } + func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batchIndex l2stateprovider.Batch) (validator.GoGlobalState, error) { var prevBatchMsgCount arbutil.MessageIndex var err error @@ -347,7 +299,7 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, err := s.globalStatesUpTo(fromHeight, to, fromBatch, toBatch) + items, _, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } @@ -365,12 +317,14 @@ func (s *StateManager) CollectMachineHashes( MessageHeight: protocol.Height(cfg.MessageNumber), StepHeights: cfg.StepHeights, } - cachedRoots, err := s.historyCache.Get(cacheKey, cfg.NumDesiredHashes) - switch { - case err == nil: - return cachedRoots, nil - case !errors.Is(err, challengecache.ErrNotFoundInCache): - return nil, err + if s.historyCache != nil { + cachedRoots, err := s.historyCache.Get(cacheKey, cfg.NumDesiredHashes) + switch { + case err == nil: + return cachedRoots, nil + case !errors.Is(err, challengecache.ErrNotFoundInCache): + return nil, err + } } entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(cfg.MessageNumber)) if err != nil { @@ -390,7 +344,7 @@ func (s *StateManager) CollectMachineHashes( return nil, err } // Do not save a history commitment of length 1 to the cache. - if len(result) > 1 { + if len(result) > 1 && s.historyCache != nil { if err := s.historyCache.Put(cacheKey, result); err != nil { if !errors.Is(err, challengecache.ErrFileAlreadyExists) { return nil, err diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go new file mode 100644 index 0000000000..56dd01b7e6 --- /dev/null +++ b/system_tests/state_provider_test.go @@ -0,0 +1,131 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE +package arbtest + +import ( + "context" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + + "github.com/offchainlabs/nitro/arbnode" + "github.com/offchainlabs/nitro/arbos/l2pricing" + "github.com/offchainlabs/nitro/arbutil" + "github.com/offchainlabs/nitro/staker" + "github.com/offchainlabs/nitro/util" + "github.com/offchainlabs/nitro/validator/valnode" + + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/solgen/go/bridgegen" +) + +func TestStateProvider_GetStatesInBatchRange(t *testing.T) { + ctx, cancelCtx := context.WithCancel(context.Background()) + defer cancelCtx() + l2node, l1info, l2info, l1stack, l1client, stateManager := setupBoldStateProvider(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + l2info.GenerateAccount("Destination") + sequencerTxOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) + + seqInbox := l1info.GetAddress("SequencerInbox") + seqInboxBinding, err := bridgegen.NewSequencerInbox(seqInbox, l1client) + Require(t, err) + + // We will make two batches, with 5 messages in each batch. + numMessagesPerBatch := int64(5) + divergeAt := int64(-1) // No divergence. + makeBoldBatch(t, l2node, l2info, l1client, &sequencerTxOpts, seqInboxBinding, seqInbox, numMessagesPerBatch, divergeAt) + makeBoldBatch(t, l2node, l2info, l1client, &sequencerTxOpts, seqInboxBinding, seqInbox, numMessagesPerBatch, divergeAt) + + bridgeBinding, err := bridgegen.NewBridge(l1info.GetAddress("Bridge"), l1client) + Require(t, err) + totalBatchesBig, err := bridgeBinding.SequencerMessageCount(&bind.CallOpts{Context: ctx}) + Require(t, err) + totalBatches := totalBatchesBig.Uint64() + totalMessageCount, err := l2node.InboxTracker.GetBatchMessageCount(totalBatches - 1) + Require(t, err) + + // Wait until the validator has validated the batches. + for { + if _, err := l2node.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)); err == nil { + break + } + } + + fromBatch := l2stateprovider.Batch(1) + toBatch := l2stateprovider.Batch(3) + fromHeight := l2stateprovider.Height(0) + toHeight := l2stateprovider.Height(16) + stateRoots, states, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) + Require(t, err) + + if len(stateRoots) != 17 { + Fatal(t, "wrong number of state roots") + } + if len(states) == 0 { + Fatal(t, "no states returned") + } + firstState := states[0] + if firstState.Batch != 1 && firstState.PosInBatch != 0 { + Fatal(t, "wrong first state") + } + lastState := states[len(states)-1] + if lastState.Batch != 1 && lastState.PosInBatch != 0 { + Fatal(t, "wrong last state") + } +} + +func setupBoldStateProvider(t *testing.T, ctx context.Context) (*arbnode.Node, *BlockchainTestInfo, *BlockchainTestInfo, *node.Node, *ethclient.Client, *staker.StateManager) { + var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs + l2chainConfig := params.ArbitrumDevTestChainConfig() + l2info := NewBlockChainTestInfo( + t, + types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), + transferGas, + ) + ownerBal := big.NewInt(params.Ether) + ownerBal.Mul(ownerBal, big.NewInt(1_000_000)) + l2info.GenerateGenesisAccount("Owner", ownerBal) + + _, l2node, _, _, l1info, _, l1client, l1stack, _, _ := createTestNodeOnL1ForBoldProtocol(t, ctx, true, nil, l2chainConfig, nil, l2info) + + valConfig := staker.L1ValidatorConfig{} + valConfig.Strategy = "MakeNodes" + valnode.TestValidationConfig.UseJit = false + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + + stateless, err := staker.NewStatelessBlockValidator( + l2node.InboxReader, + l2node.InboxTracker, + l2node.TxStreamer, + l2node.Execution.Recorder, + l2node.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = stateless.Start(ctx) + Require(t, err) + + stateManager, err := staker.NewStateManager( + stateless, + "", + []l2stateprovider.Height{ + l2stateprovider.Height(blockChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(smallStepChallengeLeafHeight), + }, + "good", + staker.DisableCache(), + ) + Require(t, err) + return l2node, l1info, l2info, l1stack, l1client, stateManager +} From 7fd8b7cfdfa6b5bf3c40d5af8e4205134ad49398 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 10 Oct 2023 15:11:21 -0400 Subject: [PATCH 069/126] added coverage and simplified the state provider logic --- staker/state_provider.go | 69 +++------ system_tests/bold_challenge_protocol_test.go | 2 +- system_tests/manager_test.go | 113 --------------- system_tests/state_provider_test.go | 144 ++++++++++++++++--- 4 files changed, 140 insertions(+), 188 deletions(-) delete mode 100644 system_tests/manager_test.go diff --git a/staker/state_provider.go b/staker/state_provider.go index 678fdd43a2..5d95d2e0e1 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -85,32 +85,36 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot return fmt.Errorf("position in batch must be zero, but got %d: %+v", state.GlobalState.PosInBatch, state) } // We always agree with the genesis batch. - batch := state.GlobalState.Batch - if batch == 0 && state.GlobalState.PosInBatch == 0 { + batchIndex := state.GlobalState.Batch + if batchIndex == 0 && state.GlobalState.PosInBatch == 0 { return nil } - if batch == 1 && state.GlobalState.PosInBatch == 0 { + // We always agree with the init message. + if batchIndex == 1 && state.GlobalState.PosInBatch == 0 { return nil } + + // Because an execution state from the assertion chain fully consumes the preceding batch, + // we actually want to check if we agree with the last state of the preceding batch, so + // we decrement the batch index by 1. + batchIndex -= 1 + totalBatches, err := s.validator.inboxTracker.GetBatchCount() if err != nil { return err } - if batch >= totalBatches { - batch = batch - 1 + if batchIndex >= totalBatches { + return ErrChainCatchingUp } - messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batch) + messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) if err != nil { return err } - validatedGlobalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, l2stateprovider.Batch(batch)) + validatedGlobalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, l2stateprovider.Batch(batchIndex)) if err != nil { return err } - if validatedGlobalState.Batch < batch { - return ErrChainCatchingUp - } - if state.GlobalState.BlockHash != validatedGlobalState.BlockHash || state.GlobalState.SendRoot != state.GlobalState.SendRoot { + if state.GlobalState.BlockHash != validatedGlobalState.BlockHash || state.GlobalState.SendRoot != validatedGlobalState.SendRoot { return l2stateprovider.ErrNoExecutionState } return nil @@ -120,7 +124,7 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot // Makes sure that PosInBatch is always 0 func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchCount uint64) (*protocol.ExecutionState, error) { if batchCount == 0 { - return nil, errors.New("batch count cannot be 0") + return nil, errors.New("batch count cannot be zero") } batchIndex := batchCount - 1 messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) @@ -217,47 +221,6 @@ func (s *StateManager) StatesInBatchRange( return stateRoots, globalStates, nil } -// func (s *StateManager) findBatchAfterMessageCount(msgCount uint64) (uint64, error) { -// if msgCount == 0 { -// return 0, nil -// } -// low := uint64(0) -// batchCount, err := s.validator.inboxTracker.GetBatchCount() -// if err != nil { -// return 0, err -// } -// high := batchCount -// for { -// // Binary search invariants: -// // - messageCount(high) >= msgCount -// // - messageCount(low-1) < msgCount -// // - high >= low -// if high < low { -// return 0, fmt.Errorf("when attempting to find batch for message count %v high %v < low %v", msgCount, high, low) -// } -// mid := (low + high) / 2 -// batchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(mid) -// if err != nil { -// // TODO: There is a circular dep with the error in inbox_tracker.go, we -// // should move it somewhere else and use errors.Is. -// if strings.Contains(err.Error(), "accumulator not found") { -// high = mid -// } else { -// return 0, fmt.Errorf("failed to get batch metadata while binary searching: %w", err) -// } -// } -// if uint64(batchMsgCount) < msgCount { -// low = mid + 1 -// } else if uint64(batchMsgCount) == msgCount { -// return mid, nil -// } else if mid == low { // batchMsgCount > msgCount -// return mid, nil -// } else { // batchMsgCount > msgCount -// high = mid -// } -// } -// } - func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batchIndex l2stateprovider.Batch) (validator.GoGlobalState, error) { var prevBatchMsgCount arbutil.MessageIndex var err error diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index c0c6432e45..49cf566fe1 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -76,7 +76,7 @@ func TestBoldProtocol(t *testing.T) { nodeAGenesis := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() nodeBGenesis := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() if nodeAGenesis != nodeBGenesis { - Fail(t, "node A L2 genesis hash", nodeAGenesis, "!= node B L2 genesis hash", nodeBGenesis) + Fatal(t, "node A L2 genesis hash", nodeAGenesis, "!= node B L2 genesis hash", nodeBGenesis) } deployAuth := l1info.GetDefaultTransactOpts("RollupOwner", ctx) diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go deleted file mode 100644 index 60543716a1..0000000000 --- a/system_tests/manager_test.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2023, Offchain Labs, Inc. -// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE -package arbtest - -import ( - "context" - "math/big" - "reflect" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - - "github.com/offchainlabs/nitro/arbnode" - "github.com/offchainlabs/nitro/arbos/l2pricing" - "github.com/offchainlabs/nitro/staker" - "github.com/offchainlabs/nitro/util" - "github.com/offchainlabs/nitro/util/testhelpers" - "github.com/offchainlabs/nitro/validator/valnode" - - protocol "github.com/OffchainLabs/bold/chain-abstraction" -) - -func TestExecutionStateMsgCount(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - res, err := l2node.TxStreamer.ResultAtCount(2) - Require(t, err) - err = manager.AgreesWithExecutionState(ctx, &protocol.ExecutionState{GlobalState: protocol.GoGlobalState{Batch: 1, BlockHash: res.BlockHash}}) - Require(t, err) -} - -func TestExecutionStateAtMessageNumber(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - res, err := l2node.TxStreamer.ResultAtCount(2) - Require(t, err) - expectedState := &protocol.ExecutionState{ - GlobalState: protocol.GoGlobalState{ - Batch: 1, - BlockHash: res.BlockHash, - }, - MachineStatus: protocol.MachineStatusFinished, - } - batchCount := expectedState.GlobalState.Batch + 1 - executionState, err := manager.ExecutionStateAfterBatchCount(ctx, batchCount) - Require(t, err) - if !reflect.DeepEqual(executionState, expectedState) { - Fail(t, "Unexpected executionState", executionState, "(expected ", expectedState, ")") - } - Require(t, err) -} - -func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, *staker.StateManager) { - var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs - l2chainConfig := params.ArbitrumDevTestChainConfig() - l2info := NewBlockChainTestInfo( - t, - types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), - transferGas, - ) - _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, l2chainConfig, nil, nil, l2info) - BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) - l2info.GenerateAccount("BackgroundUser") - balance := big.NewInt(params.Ether) - balance.Mul(balance, big.NewInt(100)) - tx := l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, balance, nil) - err := l2client.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2client, tx) - Require(t, err) - - for i := uint64(0); i < 10; i++ { - l2info.Accounts["BackgroundUser"].Nonce = i - tx = l2info.PrepareTx("BackgroundUser", "BackgroundUser", l2info.TransferGas, common.Big0, nil) - err = l2client.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2client, tx) - Require(t, err) - } - - _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) - blockValidatorConfig := staker.TestBlockValidatorConfig - stateless, err := staker.NewStatelessBlockValidator( - l2node.InboxReader, - l2node.InboxTracker, - l2node.TxStreamer, - l2node.Execution.Recorder, - l2node.ArbDB, - nil, - StaticFetcherFrom(t, &blockValidatorConfig), - valStack, - ) - Require(t, err) - err = stateless.Start(ctx) - Require(t, err) - manager, err := staker.NewStateManager(stateless, t.TempDir(), nil, "") - Require(t, err) - return l2node, l1stack, manager -} - -func Fail(t *testing.T, printables ...interface{}) { - t.Helper() - testhelpers.FailImpl(t, printables...) -} diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 56dd01b7e6..20e65f555e 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -4,7 +4,9 @@ package arbtest import ( "context" + "errors" "math/big" + "strings" "testing" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -20,11 +22,12 @@ import ( "github.com/offchainlabs/nitro/util" "github.com/offchainlabs/nitro/validator/valnode" + protocol "github.com/OffchainLabs/bold/chain-abstraction" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/solgen/go/bridgegen" ) -func TestStateProvider_GetStatesInBatchRange(t *testing.T) { +func TestStateProvider_BOLD(t *testing.T) { ctx, cancelCtx := context.WithCancel(context.Background()) defer cancelCtx() l2node, l1info, l2info, l1stack, l1client, stateManager := setupBoldStateProvider(t, ctx) @@ -58,27 +61,126 @@ func TestStateProvider_GetStatesInBatchRange(t *testing.T) { } } - fromBatch := l2stateprovider.Batch(1) - toBatch := l2stateprovider.Batch(3) - fromHeight := l2stateprovider.Height(0) - toHeight := l2stateprovider.Height(16) - stateRoots, states, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) - Require(t, err) + t.Run("StatesInBatchRange", func(t *testing.T) { + fromBatch := l2stateprovider.Batch(1) + toBatch := l2stateprovider.Batch(3) + fromHeight := l2stateprovider.Height(0) + toHeight := l2stateprovider.Height(16) + stateRoots, states, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) + Require(t, err) - if len(stateRoots) != 17 { - Fatal(t, "wrong number of state roots") - } - if len(states) == 0 { - Fatal(t, "no states returned") - } - firstState := states[0] - if firstState.Batch != 1 && firstState.PosInBatch != 0 { - Fatal(t, "wrong first state") - } - lastState := states[len(states)-1] - if lastState.Batch != 1 && lastState.PosInBatch != 0 { - Fatal(t, "wrong last state") - } + if len(stateRoots) != 17 { + Fatal(t, "wrong number of state roots") + } + if len(states) == 0 { + Fatal(t, "no states returned") + } + firstState := states[0] + if firstState.Batch != 1 && firstState.PosInBatch != 0 { + Fatal(t, "wrong first state") + } + lastState := states[len(states)-1] + if lastState.Batch != 1 && lastState.PosInBatch != 0 { + Fatal(t, "wrong last state") + } + }) + t.Run("AgreesWithExecutionState", func(t *testing.T) { + // Non-zero position in batch shoould fail. + err = stateManager.AgreesWithExecutionState(ctx, &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState{ + Batch: 0, + PosInBatch: 1, + }, + MachineStatus: protocol.MachineStatusFinished, + }) + if err == nil { + Fatal(t, "should not agree with execution state") + } + if !strings.Contains(err.Error(), "position in batch must be zero") { + Fatal(t, "wrong error message") + } + + // Always agrees with genesis. + err = stateManager.AgreesWithExecutionState(ctx, &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState{ + Batch: 0, + PosInBatch: 0, + }, + MachineStatus: protocol.MachineStatusFinished, + }) + Require(t, err) + + // Always agrees with the init message. + err = stateManager.AgreesWithExecutionState(ctx, &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState{ + Batch: 1, + PosInBatch: 0, + }, + MachineStatus: protocol.MachineStatusFinished, + }) + Require(t, err) + + // Chain catching up if it has not seen batch 10. + err = stateManager.AgreesWithExecutionState(ctx, &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState{ + Batch: 10, + PosInBatch: 0, + }, + MachineStatus: protocol.MachineStatusFinished, + }) + if err == nil { + Fatal(t, "should not agree with execution state") + } + if !errors.Is(err, staker.ErrChainCatchingUp) { + Fatal(t, "wrong error") + } + + // Check if we agree with the last posted batch to the inbox. + result, err := l2node.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)) + Require(t, err) + + state := &protocol.ExecutionState{ + GlobalState: protocol.GoGlobalState{ + BlockHash: result.BlockHash, + SendRoot: result.SendRoot, + Batch: 3, + PosInBatch: 0, + }, + MachineStatus: protocol.MachineStatusFinished, + } + err = stateManager.AgreesWithExecutionState(ctx, state) + Require(t, err) + + // See if we agree with one batch immediately after that and see that we fail with + // "ErrChainCatchingUp". + state.GlobalState.Batch += 1 + + err = stateManager.AgreesWithExecutionState(ctx, state) + if err == nil { + Fatal(t, "should not agree with execution state") + } + if !errors.Is(err, staker.ErrChainCatchingUp) { + Fatal(t, "wrong error") + } + }) + t.Run("ExecutionStateAfterBatchCount", func(t *testing.T) { + _, err = stateManager.ExecutionStateAfterBatchCount(ctx, 0) + if err == nil { + Fatal(t, "should have failed") + } + if !strings.Contains(err.Error(), "batch count cannot be zero") { + Fatal(t, "wrong error message") + } + + execState, err := stateManager.ExecutionStateAfterBatchCount(ctx, totalBatches) + Require(t, err) + + // We should agree with the last posted batch to the inbox based on our + // retrieved execution state. + err = stateManager.AgreesWithExecutionState(ctx, execState) + Require(t, err) + Fatal(t, "failed for no reason") + }) } func setupBoldStateProvider(t *testing.T, ctx context.Context) (*arbnode.Node, *BlockchainTestInfo, *BlockchainTestInfo, *node.Node, *ethclient.Client, *staker.StateManager) { From 036953b528255cb23a92e4061403c8ef7315942d Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 10 Oct 2023 15:45:47 -0400 Subject: [PATCH 070/126] back to posting block chal edges --- staker/state_provider.go | 15 ++++++++++- system_tests/bold_challenge_protocol_test.go | 28 ++++++++++++++------ system_tests/state_provider_test.go | 2 +- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index 5d95d2e0e1..e1040cd26d 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -103,6 +103,9 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot if err != nil { return err } + + // If the batch index is >= the total number of batches we have in our inbox tracker, + // we are still catching up to the chain. if batchIndex >= totalBatches { return ErrChainCatchingUp } @@ -114,6 +117,7 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot if err != nil { return err } + // We check if the block hash and send root match at our expected result. if state.GlobalState.BlockHash != validatedGlobalState.BlockHash || state.GlobalState.SendRoot != validatedGlobalState.SendRoot { return l2stateprovider.ErrNoExecutionState } @@ -185,6 +189,12 @@ func (s *StateManager) StatesInBatchRange( // Check if there are enough messages in the range to satisfy our request. totalDesiredHashes := (toHeight - fromHeight) + 1 + + // We can return early if all we want is one hash. + if totalDesiredHashes == 1 { + return stateRoots, globalStates, nil + } + for batch := fromBatch; batch < toBatch; batch++ { msgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batch)) if err != nil { @@ -262,10 +272,13 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, _, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) + items, states, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } + first := states[0] + last := states[len(states)-1] + fmt.Printf("%s: first %+v, last %+v\n", s.validatorName, first, last) return items, nil } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 49cf566fe1..9a9fbb60b7 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -32,6 +32,7 @@ import ( "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbnode/execution" "github.com/offchainlabs/nitro/arbos/l2pricing" + "github.com/offchainlabs/nitro/arbutil" "github.com/offchainlabs/nitro/cmd/chaininfo" "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/statetransfer" @@ -221,6 +222,7 @@ func TestBoldProtocol(t *testing.T) { t.Logf("Node A batch count %d, msgs %d", bcA, msgA) t.Logf("Node B batch count %d, msgs %d", bcB, msgB) + // Wait for both nodes' chains to catch up. for { nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader() nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader() @@ -234,17 +236,27 @@ func TestBoldProtocol(t *testing.T) { } } - goodBridge, err := bridgegen.NewSequencerInbox(honestSeqInbox, l1client) + // Wait for the vaidator to validate the batches. + bridgeBinding, err := bridgegen.NewBridge(l1info.GetAddress("Bridge"), l1client) Require(t, err) - totalGoodBatches, err := goodBridge.BatchCount(&bind.CallOpts{}) + totalBatchesBig, err := bridgeBinding.SequencerMessageCount(&bind.CallOpts{Context: ctx}) Require(t, err) - - evilBridge, err := bridgegen.NewSequencerInbox(evilSeqInbox, l1client) - Require(t, err) - totalEvilBatches, err := evilBridge.BatchCount(&bind.CallOpts{}) + totalBatches := totalBatchesBig.Uint64() + totalMessageCount, err := l2nodeA.InboxTracker.GetBatchMessageCount(totalBatches - 1) Require(t, err) - t.Logf("Total good batches %d, total bad batches %d", totalGoodBatches.Uint64(), totalEvilBatches.Uint64()) + // Wait until the validator has validated the batches. + for { + _, err1 := l2nodeA.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)) + nodeAHasValidated := err1 == nil + + _, err2 := l2nodeB.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)) + nodeBHasValidated := err2 == nil + + if nodeAHasValidated && nodeBHasValidated { + break + } + } t.Log("Honest party posting assertion at batch 1, pos 0") _, err = poster.PostAssertion(ctx) @@ -319,7 +331,7 @@ func TestBoldProtocol(t *testing.T) { Require(t, err) managerB.Start(ctx) - //Every 10 seconds, send an L1 transaction. + // Every 10 seconds, send an L1 transaction to keep the chain moving. delay := time.Second * 10 for { time.Sleep(delay) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 20e65f555e..6563b3fac8 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -28,6 +28,7 @@ import ( ) func TestStateProvider_BOLD(t *testing.T) { + t.Parallel() ctx, cancelCtx := context.WithCancel(context.Background()) defer cancelCtx() l2node, l1info, l2info, l1stack, l1client, stateManager := setupBoldStateProvider(t, ctx) @@ -179,7 +180,6 @@ func TestStateProvider_BOLD(t *testing.T) { // retrieved execution state. err = stateManager.AgreesWithExecutionState(ctx, execState) Require(t, err) - Fatal(t, "failed for no reason") }) } From 72ef59487005c0251cb0684a5d7d1f64b5b72d53 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 10 Oct 2023 17:16:34 -0400 Subject: [PATCH 071/126] bisections working --- staker/state_provider.go | 19 +++++-- system_tests/state_provider_test.go | 83 +++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 4 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index e1040cd26d..c1660f00ca 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -224,6 +224,10 @@ func (s *StateManager) StatesInBatchRange( globalStates = append(globalStates, lastGlobalState) } + if uint64(len(stateRoots)) > uint64(totalDesiredHashes) { + return stateRoots[:totalDesiredHashes], globalStates, nil + } + for uint64(len(stateRoots)) < uint64(totalDesiredHashes) { stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) } @@ -272,13 +276,20 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, states, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) + items, _, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } - first := states[0] - last := states[len(states)-1] - fmt.Printf("%s: first %+v, last %+v\n", s.validatorName, first, last) + // fmt.Println("Num states", len(states)) + // for i, root := range items { + // var state validator.GoGlobalState + // if i >= len(states) { + // state = states[len(states)-1] + // } else { + // state = states[i] + // } + // fmt.Printf("%s: %s, %+v\n", s.validatorName, containers.Trunc(root.Bytes()), state) + // } return items, nil } diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 6563b3fac8..3e9f95bc55 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/node" @@ -23,10 +24,92 @@ import ( "github.com/offchainlabs/nitro/validator/valnode" protocol "github.com/OffchainLabs/bold/chain-abstraction" + "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/solgen/go/bridgegen" + prefixproofs "github.com/OffchainLabs/bold/state-commitments/prefix-proofs" + mockmanager "github.com/OffchainLabs/bold/testing/mocks/state-provider" ) +func TestStateProvider_BOLD_Bisections(t *testing.T) { + t.Parallel() + ctx, cancelCtx := context.WithCancel(context.Background()) + defer cancelCtx() + l2node, l1info, l2info, l1stack, l1client, stateManager := setupBoldStateProvider(t, ctx) + defer requireClose(t, l1stack) + defer l2node.StopAndWait() + l2info.GenerateAccount("Destination") + sequencerTxOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) + + seqInbox := l1info.GetAddress("SequencerInbox") + seqInboxBinding, err := bridgegen.NewSequencerInbox(seqInbox, l1client) + Require(t, err) + + // We will make two batches, with 5 messages in each batch. + numMessagesPerBatch := int64(5) + divergeAt := int64(-1) // No divergence. + makeBoldBatch(t, l2node, l2info, l1client, &sequencerTxOpts, seqInboxBinding, seqInbox, numMessagesPerBatch, divergeAt) + numMessagesPerBatch = int64(10) + makeBoldBatch(t, l2node, l2info, l1client, &sequencerTxOpts, seqInboxBinding, seqInbox, numMessagesPerBatch, divergeAt) + + bridgeBinding, err := bridgegen.NewBridge(l1info.GetAddress("Bridge"), l1client) + Require(t, err) + totalBatchesBig, err := bridgeBinding.SequencerMessageCount(&bind.CallOpts{Context: ctx}) + Require(t, err) + totalBatches := totalBatchesBig.Uint64() + totalMessageCount, err := l2node.InboxTracker.GetBatchMessageCount(totalBatches - 1) + Require(t, err) + + // Wait until the validator has validated the batches. + for { + if _, err := l2node.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)); err == nil { + break + } + } + + historyCommitter := l2stateprovider.NewHistoryCommitmentProvider( + stateManager, + stateManager, + stateManager, []l2stateprovider.Height{ + 1 << 5, + 1 << 5, + 1 << 5, + }, + stateManager, + ) + bisectionHeight := l2stateprovider.Height(16) + request := &l2stateprovider.HistoryCommitmentRequest{ + WasmModuleRoot: common.Hash{}, + FromBatch: 1, + ToBatch: 3, + UpperChallengeOriginHeights: []l2stateprovider.Height{}, + FromHeight: 0, + UpToHeight: option.Some(bisectionHeight), + } + bisectionCommitment, err := historyCommitter.HistoryCommitment(ctx, request) + Require(t, err) + + request.UpToHeight = option.None[l2stateprovider.Height]() + packedProof, err := historyCommitter.PrefixProof(ctx, request, bisectionHeight) + Require(t, err) + + data, err := mockmanager.ProofArgs.Unpack(packedProof) + Require(t, err) + preExpansion := data[0].([][32]byte) + + hashes := make([]common.Hash, len(preExpansion)) + for i, h := range preExpansion { + hash := h + hashes[i] = common.Hash(hash) + } + + computed, err := prefixproofs.Root(hashes) + Require(t, err) + if computed != bisectionCommitment.Merkle { + Fatal(t, "wrong commitment") + } +} + func TestStateProvider_BOLD(t *testing.T) { t.Parallel() ctx, cancelCtx := context.WithCancel(context.Background()) From a22bd736c74d8f5cea68e67d957876835e7cad1c Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 10 Oct 2023 18:42:00 -0400 Subject: [PATCH 072/126] getting there --- bold | 2 +- staker/state_provider.go | 37 +++++++++++--------- system_tests/bold_challenge_protocol_test.go | 4 ++- validator/server_arb/execution_run.go | 16 ++++----- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/bold b/bold index 0a91a36fb5..19ad0011c4 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 0a91a36fb572d99ca03d6e4b8b0f1aa17016a7f1 +Subproject commit 19ad0011c4a8b1578e81461d8335ffb09c5d7438 diff --git a/staker/state_provider.go b/staker/state_provider.go index c1660f00ca..6c8117de72 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" protocol "github.com/OffchainLabs/bold/chain-abstraction" + "github.com/OffchainLabs/bold/containers" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/offchainlabs/nitro/arbutil" @@ -191,7 +192,7 @@ func (s *StateManager) StatesInBatchRange( totalDesiredHashes := (toHeight - fromHeight) + 1 // We can return early if all we want is one hash. - if totalDesiredHashes == 1 { + if totalDesiredHashes == 1 && fromHeight == 0 && toHeight == 0 { return stateRoots, globalStates, nil } @@ -224,15 +225,17 @@ func (s *StateManager) StatesInBatchRange( globalStates = append(globalStates, lastGlobalState) } - if uint64(len(stateRoots)) > uint64(totalDesiredHashes) { - return stateRoots[:totalDesiredHashes], globalStates, nil - } - for uint64(len(stateRoots)) < uint64(totalDesiredHashes) { stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) } - return stateRoots, globalStates, nil + fmt.Printf("%s: Slicing from height %d to height %d\n", s.validatorName, fromHeight, toHeight) + finalRoots := stateRoots[fromHeight : toHeight+1] + finalStates := globalStates[fromHeight : toHeight+1] + for i, gs := range finalStates { + fmt.Printf("%s: finalroot %s, gs %+v\n", s.validatorName, containers.Trunc(finalRoots[i].Bytes()), gs) + } + return stateRoots[fromHeight : toHeight+1], globalStates[fromHeight : toHeight+1], nil } func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batchIndex l2stateprovider.Batch) (validator.GoGlobalState, error) { @@ -276,20 +279,20 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, _, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) + items, states, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } - // fmt.Println("Num states", len(states)) - // for i, root := range items { - // var state validator.GoGlobalState - // if i >= len(states) { - // state = states[len(states)-1] - // } else { - // state = states[i] - // } - // fmt.Printf("%s: %s, %+v\n", s.validatorName, containers.Trunc(root.Bytes()), state) - // } + fmt.Println("Num states", len(states)) + for i, root := range items { + var state validator.GoGlobalState + if i >= len(states) { + state = states[len(states)-1] + } else { + state = states[i] + } + fmt.Printf("%d => %s: %s, %+v\n", i, s.validatorName, containers.Trunc(root.Bytes()), state) + } return items, nil } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 9a9fbb60b7..fbda63dccb 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -104,7 +104,9 @@ func TestBoldProtocol(t *testing.T) { valConfig := staker.L1ValidatorConfig{} valConfig.Strategy = "MakeNodes" - _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + valCfg := valnode.TestValidationConfig + valCfg.UseJit = false + _, valStack := createTestValidationNode(t, ctx, &valCfg) blockValidatorConfig := staker.TestBlockValidatorConfig statelessA, err := staker.NewStatelessBlockValidator( diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index b43e748d29..8eb0cbae12 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -5,13 +5,13 @@ package server_arb import ( "context" - "errors" "fmt" "sync" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + boldcontainers "github.com/OffchainLabs/bold/containers" "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" @@ -69,7 +69,9 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes var stateRoots []common.Hash if machineStartIndex == 0 { gs := machine.GetGlobalState() - stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) + stateRoots = append(stateRoots, hash) + fmt.Printf("Initial machine global state %s, %+v\n", boldcontainers.Trunc(hash.Bytes()), gs) } else { // Otherwise, we simply append the machine hash at the specified start index. stateRoots = append(stateRoots, machine.Hash()) @@ -79,6 +81,7 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes if numDesiredLeaves == 1 { return stateRoots, nil } + fmt.Printf("Num desired leaves: %+v, step size %d\n", numDesiredLeaves, stepSize) for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { // The absolute opcode position the machine should be in after stepping. position := machineStartIndex + stepSize*(numIterations+1) @@ -92,12 +95,9 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes machineStep := machine.GetStepCount() if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { gs := machine.GetGlobalState() - // The last hash should have consumed the whole batch. - if gs.PosInBatch != 0 { - return nil, errors.New("machine finished in the middle of a batch") - } - stateRoots = append(stateRoots, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) - fmt.Printf("Machine total opcodes was %d\n", machineStep) + hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) + stateRoots = append(stateRoots, hash) + fmt.Printf("Last machine global state %s, %+v\n", boldcontainers.Trunc(hash.Bytes()), gs) break } // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. From 33c1bf0ee9e0cb022f3b3c21c927ea6895fcfcd6 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Tue, 10 Oct 2023 21:58:41 -0400 Subject: [PATCH 073/126] challenge working again --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 19ad0011c4..9083c2d647 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 19ad0011c4a8b1578e81461d8335ffb09c5d7438 +Subproject commit 9083c2d647bb7306823cd9b8669b81668d7a4d9f From c59b84e6cf82a3aa605d010f7a087421af006bda Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 19:26:28 -0400 Subject: [PATCH 074/126] update bold commit --- bold | 2 +- staker/state_provider.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bold b/bold index 9083c2d647..71ec0a0347 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 9083c2d647bb7306823cd9b8669b81668d7a4d9f +Subproject commit 71ec0a0347911d06606581491a9eecc69da9cfd4 diff --git a/staker/state_provider.go b/staker/state_provider.go index 6c8117de72..4ab57bccea 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -125,7 +125,7 @@ func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *prot return nil } -// ExecutionStateAtMessageNumber Produces the l2 state to assert at the message number specified. +// ExecutionStateAfterBatchCount Produces the l2 state to assert at the message number specified. // Makes sure that PosInBatch is always 0 func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchCount uint64) (*protocol.ExecutionState, error) { if batchCount == 0 { From f35f401ff277f838e612af149ab0461a519e3632 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 19:27:08 -0400 Subject: [PATCH 075/126] update bold commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 71ec0a0347..1fd0b26c80 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 71ec0a0347911d06606581491a9eecc69da9cfd4 +Subproject commit 1fd0b26c80aafc6f635da7a72fb97b3fc8d16d3f From 927dba25f2752b4466a11c5d8bd2e1a6ddd8c134 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 19:36:44 -0400 Subject: [PATCH 076/126] log await confirmation of assertion --- staker/challenge-cache/cache.go | 4 +- system_tests/bold_challenge_protocol_test.go | 39 +++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index d260122851..923dbd26ce 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -52,6 +52,7 @@ var ( messageNumberPrefix = "message-num" bigStepPrefix = "big-step" challengeLevelPrefix = "subchallenge-level" + srvlog = log.New("service", "bold-history-commit-cache") ) // HistoryCommitmentCacher can retrieve history commitment state roots given lookup keys. @@ -92,9 +93,10 @@ func (c *Cache) Get( return nil, err } if _, err := os.Stat(fName); err != nil { - fmt.Printf("Not found %s\n", fName) + srvlog.Warn("Cache miss", log.Ctx{"fileName": fName}) return nil, ErrNotFoundInCache } + srvlog.Debug("Cache hit", log.Ctx{"fileName": fName}) f, err := os.Open(fName) if err != nil { return nil, err diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index fbda63dccb..6ceb385a5f 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -265,7 +265,7 @@ func TestBoldProtocol(t *testing.T) { Require(t, err) t.Log("Honest party posting assertion at batch 2, pos 0") - _, err = poster.PostAssertion(ctx) + expectedWinnerAssertion, err := poster.PostAssertion(ctx) Require(t, err) t.Log("Evil party posting assertion at batch 2, pos 0") @@ -334,15 +334,36 @@ func TestBoldProtocol(t *testing.T) { managerB.Start(ctx) // Every 10 seconds, send an L1 transaction to keep the chain moving. - delay := time.Second * 10 + go func() { + delay := time.Second * 10 + for { + select { + case <-ctx.Done(): + return + default: + time.Sleep(delay) + balance := big.NewInt(params.GWei) + TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + latestBlock, err := l1client.BlockNumber(ctx) + Require(t, err) + if latestBlock > 200 { + delay = time.Second + } + } + } + }() + + rollupUserLogic, err := rollupgen.NewRollupUserLogic(assertionChain.RollupAddress(), l1client) + Require(t, err) for { - time.Sleep(delay) - balance := big.NewInt(params.GWei) - TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) - latestBlock, err := l1client.BlockNumber(ctx) - Require(t, err) - if latestBlock > 200 { - delay = time.Second + expected, err := rollupUserLogic.GetAssertion(&bind.CallOpts{Context: ctx}, expectedWinnerAssertion.Id().Hash) + if err != nil { + t.Logf("Error getting assertion: %v", err) + continue + } + // Wait until the assertion is confirmed. + if expected.Status == uint8(2) { + return } } } From 952066c9564d7a16efaaf4071a9868016f0f30a1 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 19:37:22 -0400 Subject: [PATCH 077/126] add expectation --- system_tests/bold_challenge_protocol_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 6ceb385a5f..9ed8a6eaad 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -363,8 +363,10 @@ func TestBoldProtocol(t *testing.T) { } // Wait until the assertion is confirmed. if expected.Status == uint8(2) { + t.Log("Expected assertion was confirmed") return } + time.Sleep(time.Second * 5) } } From 34a587d0d8f5ea3fe5c3351fa047758cf8df69a2 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 20:07:59 -0400 Subject: [PATCH 078/126] execution fixes --- go.sum | 2 + staker/state_provider.go | 20 +---- system_tests/bold_challenge_protocol_test.go | 94 +++++++++++++------- system_tests/state_provider_test.go | 2 +- util/headerreader/header_reader.go | 4 +- 5 files changed, 67 insertions(+), 55 deletions(-) diff --git a/go.sum b/go.sum index 9acc79889c..0723231d2d 100644 --- a/go.sum +++ b/go.sum @@ -602,6 +602,8 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/golang-lru/v2 v2.0.2 h1:Dwmkdr5Nc/oBiXgJS3CDHNhJtIHkuZ3DZF5twqnfBdU= +github.com/hashicorp/golang-lru/v2 v2.0.2/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= diff --git a/staker/state_provider.go b/staker/state_provider.go index 4ab57bccea..b9f09e86c5 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -13,7 +13,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" protocol "github.com/OffchainLabs/bold/chain-abstraction" - "github.com/OffchainLabs/bold/containers" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/offchainlabs/nitro/arbutil" @@ -228,13 +227,6 @@ func (s *StateManager) StatesInBatchRange( for uint64(len(stateRoots)) < uint64(totalDesiredHashes) { stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) } - - fmt.Printf("%s: Slicing from height %d to height %d\n", s.validatorName, fromHeight, toHeight) - finalRoots := stateRoots[fromHeight : toHeight+1] - finalStates := globalStates[fromHeight : toHeight+1] - for i, gs := range finalStates { - fmt.Printf("%s: finalroot %s, gs %+v\n", s.validatorName, containers.Trunc(finalRoots[i].Bytes()), gs) - } return stateRoots[fromHeight : toHeight+1], globalStates[fromHeight : toHeight+1], nil } @@ -279,20 +271,10 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, states, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) + items, _, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } - fmt.Println("Num states", len(states)) - for i, root := range items { - var state validator.GoGlobalState - if i >= len(states) { - state = states[len(states)-1] - } else { - state = states[i] - } - fmt.Printf("%d => %s: %s, %+v\n", i, s.validatorName, containers.Trunc(root.Bytes()), state) - } return items, nil } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 9ed8a6eaad..81ff086973 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -30,10 +30,10 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/offchainlabs/nitro/arbcompress" "github.com/offchainlabs/nitro/arbnode" - "github.com/offchainlabs/nitro/arbnode/execution" "github.com/offchainlabs/nitro/arbos/l2pricing" "github.com/offchainlabs/nitro/arbutil" "github.com/offchainlabs/nitro/cmd/chaininfo" + "github.com/offchainlabs/nitro/execution/gethexec" "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/statetransfer" "github.com/offchainlabs/nitro/util" @@ -71,13 +71,35 @@ func TestBoldProtocol(t *testing.T) { defer requireClose(t, l1stack) defer l2nodeA.StopAndWait() + // Every 10 seconds, send an L1 transaction to keep the chain moving. + go func() { + delay := time.Second * 10 + for { + select { + case <-ctx.Done(): + return + default: + time.Sleep(delay) + balance := big.NewInt(params.GWei) + TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) + latestBlock, err := l1client.BlockNumber(ctx) + Require(t, err) + if latestBlock > 200 { + delay = time.Second + } + } + } + }() + _, l2nodeB, assertionChainB := create2ndNodeWithConfigForBoldProtocol(t, ctx, l2nodeA, l1stack, l1info, &l2info.ArbInitData, arbnode.ConfigDefaultL1Test(), nil, stakeTokenAddr) defer l2nodeB.StopAndWait() - nodeAGenesis := l2nodeA.Execution.Backend.APIBackend().CurrentHeader().Hash() - nodeBGenesis := l2nodeB.Execution.Backend.APIBackend().CurrentHeader().Hash() - if nodeAGenesis != nodeBGenesis { - Fatal(t, "node A L2 genesis hash", nodeAGenesis, "!= node B L2 genesis hash", nodeBGenesis) + nodeAMessage, err := l2nodeA.Execution.HeadMessageNumber() + Require(t, err) + nodeBMessage, err := l2nodeB.Execution.HeadMessageNumber() + Require(t, err) + if nodeAMessage != nodeBMessage { + Fatal(t, "node A L2 genesis hash", nodeAMessage, "!= node B L2 genesis hash", nodeBMessage) } deployAuth := l1info.GetDefaultTransactOpts("RollupOwner", ctx) @@ -113,7 +135,7 @@ func TestBoldProtocol(t *testing.T) { l2nodeA.InboxReader, l2nodeA.InboxTracker, l2nodeA.TxStreamer, - l2nodeA.Execution.Recorder, + l2nodeA.Execution, l2nodeA.ArbDB, nil, StaticFetcherFrom(t, &blockValidatorConfig), @@ -127,7 +149,7 @@ func TestBoldProtocol(t *testing.T) { l2nodeB.InboxReader, l2nodeB.InboxTracker, l2nodeB.TxStreamer, - l2nodeB.Execution.Recorder, + l2nodeB.Execution, l2nodeB.ArbDB, nil, StaticFetcherFrom(t, &blockValidatorConfig), @@ -225,9 +247,17 @@ func TestBoldProtocol(t *testing.T) { t.Logf("Node B batch count %d, msgs %d", bcB, msgB) // Wait for both nodes' chains to catch up. + nodeAExec, ok := l2nodeA.Execution.(*gethexec.ExecutionNode) + if !ok { + Fatal(t, "not geth execution node") + } + nodeBExec, ok := l2nodeB.Execution.(*gethexec.ExecutionNode) + if !ok { + Fatal(t, "not geth execution node") + } for { - nodeALatest := l2nodeA.Execution.Backend.APIBackend().CurrentHeader() - nodeBLatest := l2nodeB.Execution.Backend.APIBackend().CurrentHeader() + nodeALatest := nodeAExec.Backend.APIBackend().CurrentHeader() + nodeBLatest := nodeBExec.Backend.APIBackend().CurrentHeader() isCaughtUp := nodeALatest.Number.Uint64() == uint64(totalMessagesPosted) areEqual := nodeALatest.Number.Uint64() == nodeBLatest.Number.Uint64() if isCaughtUp && areEqual { @@ -333,26 +363,6 @@ func TestBoldProtocol(t *testing.T) { Require(t, err) managerB.Start(ctx) - // Every 10 seconds, send an L1 transaction to keep the chain moving. - go func() { - delay := time.Second * 10 - for { - select { - case <-ctx.Done(): - return - default: - time.Sleep(delay) - balance := big.NewInt(params.GWei) - TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) - latestBlock, err := l1client.BlockNumber(ctx) - Require(t, err) - if latestBlock > 200 { - delay = time.Second - } - } - } - }() - rollupUserLogic, err := rollupgen.NewRollupUserLogic(assertionChain.RollupAddress(), l1client) Require(t, err) for { @@ -385,8 +395,8 @@ func createTestNodeOnL1ForBoldProtocol( ) { if nodeConfig == nil { nodeConfig = arbnode.ConfigDefaultL1Test() - nodeConfig.ParentChainReader.OldHeaderTimeout = time.Minute * 10 } + nodeConfig.ParentChainReader.OldHeaderTimeout = time.Minute * 10 if chainConfig == nil { chainConfig = params.ArbitrumDevTestChainConfig() } @@ -458,8 +468,14 @@ func createTestNodeOnL1ForBoldProtocol( AddDefaultValNode(t, ctx, nodeConfig, true) + execConfig := gethexec.ConfigDefaultTest() + Require(t, execConfig.Validate()) + execConfigFetcher := func() *gethexec.Config { return execConfig } + execNode, err := gethexec.CreateExecutionNode(ctx, l2stack, l2chainDb, l2blockchain, l1client, execConfigFetcher) + Require(t, err) + currentNode, err = arbnode.CreateNode( - ctx, l2stack, l2chainDb, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain, l1client, + ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, addresses, sequencerTxOptsPtr, sequencerTxOptsPtr, dataSigner, fatalErrChan, ) Require(t, err) @@ -599,7 +615,11 @@ func create2ndNodeWithConfigForBoldProtocol( Fatal(t, err) } l1client := ethclient.NewClient(l1rpcClient) - chainConfig := first.Execution.ArbInterface.BlockChain().Config() + firstExec, ok := first.Execution.(*gethexec.ExecutionNode) + if !ok { + Fatal(t, "not geth execution node") + } + chainConfig := firstExec.ArbInterface.BlockChain().Config() addresses, assertionChain := deployContractsOnly(t, ctx, l1info, l1client, chainConfig.ChainID, stakeTokenAddr) l1info.SetContract("EvilBridge", addresses.Bridge) @@ -630,10 +650,16 @@ func create2ndNodeWithConfigForBoldProtocol( initReader := statetransfer.NewMemoryInitDataReader(l2InitData) initMessage := getInitMessage(ctx, t, l1client, first.DeployInfo) - l2blockchain, err := execution.WriteOrTestBlockChain(l2chainDb, nil, initReader, chainConfig, initMessage, arbnode.ConfigDefaultL2Test().TxLookupLimit, 0) + execConfig := gethexec.ConfigDefaultTest() + Require(t, execConfig.Validate()) + + l2blockchain, err := gethexec.WriteOrTestBlockChain(l2chainDb, nil, initReader, chainConfig, initMessage, execConfig.TxLookupLimit, 0) Require(t, err) - l2node, err := arbnode.CreateNode(ctx, l2stack, l2chainDb, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain, l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan) + execConfigFetcher := func() *gethexec.Config { return execConfig } + execNode, err := gethexec.CreateExecutionNode(ctx, l2stack, l2chainDb, l2blockchain, l1client, execConfigFetcher) + Require(t, err) + l2node, err := arbnode.CreateNode(ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan) Require(t, err) Require(t, l2node.Start(ctx)) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 3e9f95bc55..1836438713 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -290,7 +290,7 @@ func setupBoldStateProvider(t *testing.T, ctx context.Context) (*arbnode.Node, * l2node.InboxReader, l2node.InboxTracker, l2node.TxStreamer, - l2node.Execution.Recorder, + l2node.Execution, l2node.ArbDB, nil, StaticFetcherFrom(t, &blockValidatorConfig), diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index ff3b420a1c..0261dde173 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -313,7 +313,9 @@ func (s *HeaderReader) logIfHeaderIsOld() { } l1Timetamp := time.Unix(int64(storedHeader.Time), 0) headerTime := time.Since(l1Timetamp) - if headerTime >= s.config().OldHeaderTimeout { + oldHeaderTimeout := time.Minute * 10 + //if headerTime >= s.config().OldHeaderTimeout { + if headerTime >= oldHeaderTimeout { s.setError(fmt.Errorf("latest header is at least %v old", headerTime)) log.Error( "latest L1 block is old", "l1Block", storedHeader.Number, From 9e98383ada29577d4895ce159c629400443a8c79 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 20:16:53 -0400 Subject: [PATCH 079/126] update bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 1fd0b26c80..8c00ea9260 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 1fd0b26c80aafc6f635da7a72fb97b3fc8d16d3f +Subproject commit 8c00ea9260b2b49d47e2224b94b9b982683b1abc From ba5195cda178722641e0f77db14f08cd95afd7d2 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 20:52:20 -0400 Subject: [PATCH 080/126] update bold --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 2 +- validator/server_arb/execution_run.go | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/bold b/bold index 8c00ea9260..d91799667b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 8c00ea9260b2b49d47e2224b94b9b982683b1abc +Subproject commit d91799667ba2ff365d00ce6ad729d87b3e3b0cfd diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 81ff086973..55d1fb2873 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -84,7 +84,7 @@ func TestBoldProtocol(t *testing.T) { TransferBalance(t, "Faucet", "Asserter", balance, l1info, l1client, ctx) latestBlock, err := l1client.BlockNumber(ctx) Require(t, err) - if latestBlock > 200 { + if latestBlock > 150 { delay = time.Second } } diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 8eb0cbae12..2018ef7baa 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -11,7 +11,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - boldcontainers "github.com/OffchainLabs/bold/containers" "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" @@ -71,7 +70,6 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes gs := machine.GetGlobalState() hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) stateRoots = append(stateRoots, hash) - fmt.Printf("Initial machine global state %s, %+v\n", boldcontainers.Trunc(hash.Bytes()), gs) } else { // Otherwise, we simply append the machine hash at the specified start index. stateRoots = append(stateRoots, machine.Hash()) @@ -81,7 +79,6 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes if numDesiredLeaves == 1 { return stateRoots, nil } - fmt.Printf("Num desired leaves: %+v, step size %d\n", numDesiredLeaves, stepSize) for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { // The absolute opcode position the machine should be in after stepping. position := machineStartIndex + stepSize*(numIterations+1) @@ -97,7 +94,6 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes gs := machine.GetGlobalState() hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) stateRoots = append(stateRoots, hash) - fmt.Printf("Last machine global state %s, %+v\n", boldcontainers.Trunc(hash.Bytes()), gs) break } // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. From 44e3b178f784aae1811516e6e5848122377f3bd9 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 20:58:17 -0400 Subject: [PATCH 081/126] lint --- system_tests/bold_challenge_protocol_test.go | 26 ++++++++++++-------- system_tests/state_provider_test.go | 7 +++--- util/headerreader/header_reader.go | 4 +-- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 55d1fb2873..c0a5791359 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -124,8 +124,6 @@ func TestBoldProtocol(t *testing.T) { _, err = EnsureTxSucceeded(ctx, l1client, tx) Require(t, err) - valConfig := staker.L1ValidatorConfig{} - valConfig.Strategy = "MakeNodes" valCfg := valnode.TestValidationConfig valCfg.UseJit = false _, valStack := createTestValidationNode(t, ctx, &valCfg) @@ -433,7 +431,8 @@ func createTestNodeOnL1ForBoldProtocol( "WETH", ) Require(t, err) - EnsureTxSucceeded(ctx, l1client, tx) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) stakeTokenAddr = stakeToken value, ok := new(big.Int).SetString("10000", 10) if !ok { @@ -442,7 +441,8 @@ func createTestNodeOnL1ForBoldProtocol( l1TransactionOpts.Value = value tx, err = tokenBindings.Deposit(&l1TransactionOpts) Require(t, err) - EnsureTxSucceeded(ctx, l1client, tx) + _, err = EnsureTxSucceeded(ctx, l1client, tx) + Require(t, err) l1TransactionOpts.Value = nil addresses, assertionChainBindings := deployContractsOnly(t, ctx, l1info, l1client, chainConfig.ChainID, stakeToken) @@ -569,23 +569,29 @@ func deployContractsOnly( Require(t, err) tx, err := tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, asserter.From, seed) Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, addresses.Rollup, value) Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, chalManagerAddr, value) Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) tx, err = tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, evilAsserter.From, seed) Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) tx, err = tokenBindings.TestWETH9Transactor.Approve(&evilAsserter, addresses.Rollup, value) Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) tx, err = tokenBindings.TestWETH9Transactor.Approve(&evilAsserter, chalManagerAddr, value) Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) return &chaininfo.RollupAddresses{ Bridge: addresses.Bridge, diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 1836438713..3170fd0bff 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -95,7 +95,10 @@ func TestStateProvider_BOLD_Bisections(t *testing.T) { data, err := mockmanager.ProofArgs.Unpack(packedProof) Require(t, err) - preExpansion := data[0].([][32]byte) + preExpansion, ok := data[0].([][32]byte) + if !ok { + Fatal(t, "wrong type") + } hashes := make([]common.Hash, len(preExpansion)) for i, h := range preExpansion { @@ -280,8 +283,6 @@ func setupBoldStateProvider(t *testing.T, ctx context.Context) (*arbnode.Node, * _, l2node, _, _, l1info, _, l1client, l1stack, _, _ := createTestNodeOnL1ForBoldProtocol(t, ctx, true, nil, l2chainConfig, nil, l2info) - valConfig := staker.L1ValidatorConfig{} - valConfig.Strategy = "MakeNodes" valnode.TestValidationConfig.UseJit = false _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) blockValidatorConfig := staker.TestBlockValidatorConfig diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index 0261dde173..ff3b420a1c 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -313,9 +313,7 @@ func (s *HeaderReader) logIfHeaderIsOld() { } l1Timetamp := time.Unix(int64(storedHeader.Time), 0) headerTime := time.Since(l1Timetamp) - oldHeaderTimeout := time.Minute * 10 - //if headerTime >= s.config().OldHeaderTimeout { - if headerTime >= oldHeaderTimeout { + if headerTime >= s.config().OldHeaderTimeout { s.setError(fmt.Errorf("latest header is at least %v old", headerTime)) log.Error( "latest L1 block is old", "l1Block", storedHeader.Number, From 1e97c649e2c1ddab051ec22b5c5f7004d47e6798 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 21:00:46 -0400 Subject: [PATCH 082/126] up --- system_tests/bold_challenge_protocol_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index c0a5791359..ba42625db7 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -634,8 +634,8 @@ func create2ndNodeWithConfigForBoldProtocol( if nodeConfig == nil { nodeConfig = arbnode.ConfigDefaultL1NonSequencerTest() - nodeConfig.ParentChainReader.OldHeaderTimeout = 10 * time.Minute } + nodeConfig.ParentChainReader.OldHeaderTimeout = 10 * time.Minute nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 if stackConfig == nil { stackConfig = stackConfigForTest(t) From 13b9ba0bf956d89807afcc78ded60d2fa85ada54 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 21:01:19 -0400 Subject: [PATCH 083/126] clean --- system_tests/bold_challenge_protocol_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index ba42625db7..f04b1039c6 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -48,7 +48,7 @@ import ( // 32 Mb of state roots in memory at once. var ( blockChallengeLeafHeight = uint64(1 << 5) // 32 - bigStepChallengeLeafHeight = uint64(1 << 5) // testing 5 big step levels, 2^5 each, with small step equalting to 2^31 total. + bigStepChallengeLeafHeight = uint64(1 << 5) // 5 big step levels, 2^5 each, with small step equalting to 2^31 total. smallStepChallengeLeafHeight = uint64(1 << 6) ) From 51ee1058919209beb0fe7f37db316d6cd6880561 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 21:01:50 -0400 Subject: [PATCH 084/126] edit --- util/headerreader/header_reader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index ff3b420a1c..04b9cf2660 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -313,7 +313,8 @@ func (s *HeaderReader) logIfHeaderIsOld() { } l1Timetamp := time.Unix(int64(storedHeader.Time), 0) headerTime := time.Since(l1Timetamp) - if headerTime >= s.config().OldHeaderTimeout { + oldHeaderTimeout := time.Minute * 10 + if headerTime >= oldHeaderTimeout { s.setError(fmt.Errorf("latest header is at least %v old", headerTime)) log.Error( "latest L1 block is old", "l1Block", storedHeader.Number, From 9372f71285fd5cb99f662d679e50cd0275a43426 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 21:06:00 -0400 Subject: [PATCH 085/126] patch test --- system_tests/state_provider_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 3170fd0bff..56cf102525 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -152,11 +152,11 @@ func TestStateProvider_BOLD(t *testing.T) { fromBatch := l2stateprovider.Batch(1) toBatch := l2stateprovider.Batch(3) fromHeight := l2stateprovider.Height(0) - toHeight := l2stateprovider.Height(16) + toHeight := l2stateprovider.Height(14) stateRoots, states, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) Require(t, err) - if len(stateRoots) != 17 { + if len(stateRoots) != 15 { Fatal(t, "wrong number of state roots") } if len(states) == 0 { From d8e27d1d203d765ca2ee9d5db122b7d64ddaeaba Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 11 Oct 2023 22:32:03 -0400 Subject: [PATCH 086/126] buidls --- system_tests/bold_challenge_protocol_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index f04b1039c6..ee331d2fd2 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "io" "math/big" "testing" "time" @@ -28,9 +29,12 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" "github.com/offchainlabs/nitro/arbcompress" "github.com/offchainlabs/nitro/arbnode" + "github.com/offchainlabs/nitro/arbos" "github.com/offchainlabs/nitro/arbos/l2pricing" + "github.com/offchainlabs/nitro/arbstate" "github.com/offchainlabs/nitro/arbutil" "github.com/offchainlabs/nitro/cmd/chaininfo" "github.com/offchainlabs/nitro/execution/gethexec" @@ -696,7 +700,7 @@ func makeBoldBatch( if i == divergeAtIndex { value++ } - err := writeTxToBatch(batchBuffer, l2Info.PrepareTx("Owner", "Destination", 1000000, big.NewInt(value), []byte{})) + err := writeTxToBatchBold(batchBuffer, l2Info.PrepareTx("Owner", "Destination", 1000000, big.NewInt(value), []byte{})) Require(t, err) } compressed, err := arbcompress.CompressWell(batchBuffer.Bytes()) @@ -722,3 +726,16 @@ func makeBoldBatch( _, err = l2Node.InboxTracker.GetBatchMetadata(0) Require(t, err, "failed to get batch metadata after adding batch:") } + +func writeTxToBatchBold(writer io.Writer, tx *types.Transaction) error { + txData, err := tx.MarshalBinary() + if err != nil { + return err + } + var segment []byte + segment = append(segment, arbstate.BatchSegmentKindL2Message) + segment = append(segment, arbos.L2MessageKind_SignedTx) + segment = append(segment, txData...) + err = rlp.Encode(writer, segment) + return err +} From a3ebe4d9bd71eea9281c04ac2ac3dc71bc3b101f Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 12 Oct 2023 08:55:39 -0400 Subject: [PATCH 087/126] cleanup --- system_tests/bold_challenge_protocol_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index ee331d2fd2..f65c49cade 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -6,6 +6,7 @@ import ( "encoding/json" "io" "math/big" + "os" "testing" "time" @@ -58,6 +59,10 @@ var ( func TestBoldProtocol(t *testing.T) { t.Parallel() + t.Cleanup(func() { + Require(t, os.RemoveAll("/tmp/good")) + Require(t, os.RemoveAll("/tmp/evil")) + }) ctx, cancelCtx := context.WithCancel(context.Background()) defer cancelCtx() var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs From 9d8ff55c58976d8438f2b5677692a363550bfcf7 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 12 Oct 2023 09:36:28 -0400 Subject: [PATCH 088/126] sys test --- staker/challenge-cache/cache_test.go | 2 +- system_tests/bold_challenge_protocol_test.go | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index bc9a3b2250..53b8bf85c8 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -253,7 +253,7 @@ func Test_determineFilePath(t *testing.T) { StepHeights: []l2stateprovider.Height{l2stateprovider.Height(50)}, }, }, - want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/big-step-50/state-roots", + want: "wavm-module-root-0x0000000000000000000000000000000000000000000000000000000000000000/message-num-100/subchallenge-level-1-big-step-50/state-roots", wantErr: false, }, } diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index f65c49cade..a57e8c9545 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -1,3 +1,12 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For license information, see https://github.com/nitro/blob/master/LICENSE + +// race detection makes things slow and miss timeouts +//go:build challengetest +//go:build !race +// +build challengetest +// +build !race + package arbtest import ( @@ -58,7 +67,6 @@ var ( ) func TestBoldProtocol(t *testing.T) { - t.Parallel() t.Cleanup(func() { Require(t, os.RemoveAll("/tmp/good")) Require(t, os.RemoveAll("/tmp/evil")) From 93cfe2ec5f98d0156a84d13b48c959b0d53a1f44 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 12 Oct 2023 09:45:39 -0400 Subject: [PATCH 089/126] patch up --- system_tests/bold_challenge_protocol_test.go | 2 +- system_tests/state_provider_test.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index a57e8c9545..00f44237d1 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -1,4 +1,4 @@ -// Copyright 2023-2024, Offchain Labs, Inc. +// Copyright 2023, Offchain Labs, Inc. // For license information, see https://github.com/nitro/blob/master/LICENSE // race detection makes things slow and miss timeouts diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 56cf102525..6b678b7faa 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -1,5 +1,12 @@ // Copyright 2023, Offchain Labs, Inc. // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE + +// race detection makes things slow and miss timeouts +//go:build challengetest +//go:build !race +// +build challengetest +// +build !race + package arbtest import ( From 1ab39f085052248ce15dad687c62231cf0b07f2f Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 12 Oct 2023 09:51:56 -0400 Subject: [PATCH 090/126] build tag --- system_tests/bold_challenge_protocol_test.go | 5 +---- system_tests/state_provider_test.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 00f44237d1..d5f41f1b2f 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -2,10 +2,7 @@ // For license information, see https://github.com/nitro/blob/master/LICENSE // race detection makes things slow and miss timeouts -//go:build challengetest -//go:build !race -// +build challengetest -// +build !race +//go:build challengetest && !race package arbtest diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 6b678b7faa..6e59083c36 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -2,10 +2,7 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE // race detection makes things slow and miss timeouts -//go:build challengetest -//go:build !race -// +build challengetest -// +build !race +//go:build challengetest && !race package arbtest From 726983eeef08559583f2cfad7b98bbee11b81a2d Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 12 Oct 2023 10:22:01 -0400 Subject: [PATCH 091/126] update bold commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index d91799667b..ca28c93f17 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit d91799667ba2ff365d00ce6ad729d87b3e3b0cfd +Subproject commit ca28c93f17be872adb885f019ec9a18eb4a0114a From fb22037ae00561f3f3342f890790301f28f7d5b0 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 12 Oct 2023 15:38:22 -0400 Subject: [PATCH 092/126] update bold commit --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index ca28c93f17..37bdb25f80 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit ca28c93f17be872adb885f019ec9a18eb4a0114a +Subproject commit 37bdb25f807733b13a18176b4fb59d89256c89be From 044fc1a2e64ecb68d75cd93ae9fff426d147f4fe Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Fri, 13 Oct 2023 13:34:19 -0400 Subject: [PATCH 093/126] update test --- system_tests/bold_challenge_protocol_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index d5f41f1b2f..5d32380b8a 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -183,12 +183,13 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) - poster := assertions.NewPoster( + poster, err := assertions.NewPoster( assertionChain, stateManager, "good", time.Hour, ) + Require(t, err) stateManagerB, err := staker.NewStateManager( statelessB, @@ -209,12 +210,14 @@ func TestBoldProtocol(t *testing.T) { l1client, ) Require(t, err) - posterB := assertions.NewPoster( + + posterB, err := assertions.NewPoster( chainB, stateManagerB, "evil", time.Hour, ) + Require(t, err) l2info.GenerateAccount("Destination") sequencerTxOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) From de84dec053ecd5183ed575a7793776da1f0dea9f Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 18 Oct 2023 22:11:47 +0530 Subject: [PATCH 094/126] Use Mmap --- bold | 2 +- staker/challenge-cache/cache.go | 38 +++++++++------ staker/challenge-cache/cache_test.go | 50 +++++++++++-------- staker/state_provider.go | 59 ++++++++++++----------- system_tests/state_provider_test.go | 13 +---- system_tests/validation_mock_test.go | 7 ++- validator/interface.go | 4 +- validator/server_api/valiation_api.go | 4 +- validator/server_api/validation_client.go | 10 ++-- validator/server_arb/execution_run.go | 34 ++++++++----- 10 files changed, 125 insertions(+), 96 deletions(-) diff --git a/bold b/bold index 37bdb25f80..8b163f0125 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 37bdb25f807733b13a18176b4fb59d89256c89be +Subproject commit 8b163f01256d96fca732ea6beabb34559ea4cbb4 diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 923dbd26ce..f7d69d594e 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -39,6 +39,8 @@ import ( protocol "github.com/OffchainLabs/bold/chain-abstraction" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/mmap" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" ) @@ -57,8 +59,8 @@ var ( // HistoryCommitmentCacher can retrieve history commitment state roots given lookup keys. type HistoryCommitmentCacher interface { - Get(lookup *Key, numToRead uint64) ([]common.Hash, error) - Put(lookup *Key, stateRoots []common.Hash) error + Get(lookup *Key, numToRead uint64) (mmap.Mmap, error) + Put(lookup *Key, stateRoots mmap.Mmap) error } // Cache for history commitments on disk. @@ -87,7 +89,7 @@ type Key struct { func (c *Cache) Get( lookup *Key, numToRead uint64, -) ([]common.Hash, error) { +) (mmap.Mmap, error) { fName, err := determineFilePath(c.baseDir, lookup) if err != nil { return nil, err @@ -113,7 +115,7 @@ func (c *Cache) Get( // State roots are saved as files in a directory hierarchy for the cache. // This function first creates a temporary file, writes the state roots to it, and then renames the file // to the final directory to ensure atomic writes. -func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { +func (c *Cache) Put(lookup *Key, stateRoots mmap.Mmap) error { // We should error if trying to put 0 state roots to disk. if len(stateRoots) == 0 { return ErrNoStateRoots @@ -155,11 +157,15 @@ func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { } // Reads 32 bytes at a time from a reader up to a specified height. If none, then read all. -func readStateRoots(r io.Reader, numToRead uint64) ([]common.Hash, error) { +func readStateRoots(r io.Reader, numToRead uint64) (mmap.Mmap, error) { br := bufio.NewReader(r) - stateRoots := make([]common.Hash, 0) + stateRootsMmap, err := mmap.NewMmap(int(numToRead)) + if err != nil { + return nil, err + } buf := make([]byte, 0, 32) - for totalRead := uint64(0); totalRead < numToRead; totalRead++ { + var totalRead uint64 + for totalRead = uint64(0); totalRead < numToRead; totalRead++ { n, err := br.Read(buf[:cap(buf)]) if err != nil { // If we try to read but reach EOF, we break out of the loop. @@ -172,30 +178,30 @@ func readStateRoots(r io.Reader, numToRead uint64) ([]common.Hash, error) { if n != 32 { return nil, fmt.Errorf("expected to read 32 bytes, got %d bytes", n) } - stateRoots = append(stateRoots, common.BytesToHash(buf)) + stateRootsMmap.Set(int(totalRead), common.BytesToHash(buf)) } - if protocol.Height(numToRead) > protocol.Height(len(stateRoots)) { + if protocol.Height(numToRead) > protocol.Height(totalRead) { return nil, fmt.Errorf( "wanted to read %d roots, but only read %d state roots", numToRead, - len(stateRoots), + totalRead, ) } - return stateRoots, nil + return stateRootsMmap, nil } -func writeStateRoots(w io.Writer, stateRoots []common.Hash) error { - for i, rt := range stateRoots { - n, err := w.Write(rt[:]) +func writeStateRoots(w io.Writer, stateRoots mmap.Mmap) error { + for i := 0; i < stateRoots.Length(); i++ { + n, err := w.Write(stateRoots.Get(i).Bytes()) if err != nil { return err } - if n != len(rt) { + if n != len(stateRoots.Get(i)) { return fmt.Errorf( "for state root %d, wrote %d bytes, expected to write %d bytes", i, n, - len(rt), + len(stateRoots.Get(i)), ) } } diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 53b8bf85c8..2a09a2e731 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -12,6 +12,8 @@ import ( "testing" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/mmap" + "github.com/ethereum/go-ethereum/common" ) @@ -40,16 +42,18 @@ func TestCache(t *testing.T) { } }) t.Run("Putting empty root fails", func(t *testing.T) { - if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { + if err := cache.Put(key, mmap.Mmap{}); !errors.Is(err, ErrNoStateRoots) { t.Fatalf("Unexpected error: %v", err) } }) - want := []common.Hash{ - common.BytesToHash([]byte("foo")), - common.BytesToHash([]byte("bar")), - common.BytesToHash([]byte("baz")), + want, err := mmap.NewMmap(3) + want.Set(0, common.BytesToHash([]byte("foo"))) + want.Set(1, common.BytesToHash([]byte("bar"))) + want.Set(2, common.BytesToHash([]byte("baz"))) + if err != nil { + t.Fatal(err) } - err := cache.Put(key, want) + err = cache.Put(key, want) if err != nil { t.Fatal(err) } @@ -89,7 +93,7 @@ func TestReadWriteStateRoots(t *testing.T) { if len(roots) == 0 { t.Fatal("Got no roots") } - if roots[0] != want { + if roots.Get(0) != want { t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) } }) @@ -105,24 +109,29 @@ func TestReadWriteStateRoots(t *testing.T) { if err != nil { t.Fatal(err) } - if len(roots) != 2 { + if roots.Length() != 2 { t.Fatalf("Expected two roots, got %d", len(roots)) } - if roots[0] != foo { + if roots.Get(0) != foo { t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) } - if roots[1] != bar { + if roots.Get(1) != bar { t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) } }) t.Run("Fails to write enough data to writer", func(t *testing.T) { m := &mockWriter{wantErr: true} - err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) + stateRoots, err := mmap.NewMmap(1) + if err != nil { + t.Fatal(err) + } + stateRoots.Set(0, common.BytesToHash([]byte("foo"))) + err = writeStateRoots(m, stateRoots) if err == nil { t.Fatal("Wanted error") } m = &mockWriter{wantErr: false, numWritten: 16} - err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) + err = writeStateRoots(m, stateRoots) if err == nil { t.Fatal("Wanted error") } @@ -221,11 +230,11 @@ func Test_readStateRoots(t *testing.T) { if err != nil { t.Fatal(err) } - if len(want) != len(got) { + if len(want) != got.Length() { t.Fatal("Wrong number of roots") } - for i, rt := range got { - if rt != want[i] { + for i := 0; i < got.Length(); i++ { + if got.Get(i) != want[i] { t.Fatal("Wrong root") } } @@ -297,11 +306,14 @@ func BenchmarkCache_Read_32Mb(b *testing.B) { StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, } numRoots := 1 << 20 - roots := make([]common.Hash, numRoots) - for i := range roots { - roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) + rootsMmap, err := mmap.NewMmap(numRoots) + if err != nil { + b.Fatal(err) + } + for i := 0; i < numRoots; i++ { + rootsMmap.Set(i, common.BytesToHash([]byte(fmt.Sprintf("%d", i)))) } - if err := cache.Put(key, roots); err != nil { + if err := cache.Put(key, rootsMmap); err != nil { b.Fatal(err) } b.StartTimer() diff --git a/staker/state_provider.go b/staker/state_provider.go index b9f09e86c5..59d6c2e346 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -15,6 +15,8 @@ import ( protocol "github.com/OffchainLabs/bold/chain-abstraction" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/mmap" + "github.com/offchainlabs/nitro/arbutil" challengecache "github.com/offchainlabs/nitro/staker/challenge-cache" "github.com/offchainlabs/nitro/validator" @@ -157,48 +159,51 @@ func (s *StateManager) StatesInBatchRange( toHeight l2stateprovider.Height, fromBatch, toBatch l2stateprovider.Batch, -) ([]common.Hash, []validator.GoGlobalState, error) { +) (mmap.Mmap, error) { // Check integrity of the arguments. if fromBatch > toBatch { - return nil, nil, fmt.Errorf("from batch %v is greater than to batch %v", fromBatch, toBatch) + return nil, fmt.Errorf("from batch %v is greater than to batch %v", fromBatch, toBatch) } if fromHeight > toHeight { - return nil, nil, fmt.Errorf("from height %v is greater than to height %v", fromHeight, toHeight) + return nil, fmt.Errorf("from height %v is greater than to height %v", fromHeight, toHeight) } // The last message's batch count. prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) if err != nil { - return nil, nil, err + return nil, err } gs, err := s.findGlobalStateFromMessageCountAndBatch(prevBatchMsgCount, fromBatch-1) if err != nil { - return nil, nil, err + return nil, err } if gs.PosInBatch == 0 { - return nil, nil, errors.New("final state of batch cannot be at position zero") + return nil, errors.New("final state of batch cannot be at position zero") } // The start state root of our history commitment starts at `batch: fromBatch, pos: 0` using the state // from the last batch. gs.Batch += 1 gs.PosInBatch = 0 - stateRoots := []common.Hash{ - crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), - } - globalStates := []validator.GoGlobalState{gs} // Check if there are enough messages in the range to satisfy our request. totalDesiredHashes := (toHeight - fromHeight) + 1 + stateRootsMmap, err := mmap.NewMmap(int(totalDesiredHashes)) + numStateRoots := 0 + if err != nil { + return nil, err + } + stateRootsMmap.Set(0, crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + numStateRoots++ // We can return early if all we want is one hash. if totalDesiredHashes == 1 && fromHeight == 0 && toHeight == 0 { - return stateRoots, globalStates, nil + return stateRootsMmap, nil } for batch := fromBatch; batch < toBatch; batch++ { msgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batch)) if err != nil { - return nil, nil, err + return nil, err } var lastGlobalState validator.GoGlobalState @@ -207,27 +212,27 @@ func (s *StateManager) StatesInBatchRange( msgIndex := uint64(prevBatchMsgCount) + i gs, err := s.findGlobalStateFromMessageCountAndBatch(arbutil.MessageIndex(msgIndex), batch) if err != nil { - return nil, nil, err + return nil, err } - globalStates = append(globalStates, gs) - stateRoots = append(stateRoots, - crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), - ) + + stateRootsMmap.Set(numStateRoots, + crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes())) + numStateRoots++ lastGlobalState = gs } prevBatchMsgCount = msgCount lastGlobalState.Batch += 1 lastGlobalState.PosInBatch = 0 - stateRoots = append(stateRoots, - crypto.Keccak256Hash([]byte("Machine finished:"), lastGlobalState.Hash().Bytes()), - ) - globalStates = append(globalStates, lastGlobalState) + stateRootsMmap.Set(numStateRoots, + crypto.Keccak256Hash([]byte("Machine finished:"), lastGlobalState.Hash().Bytes())) + numStateRoots++ } - for uint64(len(stateRoots)) < uint64(totalDesiredHashes) { - stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) + lastStateRoot := stateRootsMmap.Get(numStateRoots - 1) + for i := numStateRoots; i < int(totalDesiredHashes); i++ { + stateRootsMmap.Set(i, lastStateRoot) } - return stateRoots[fromHeight : toHeight+1], globalStates[fromHeight : toHeight+1], nil + return stateRootsMmap.SubMmap(int(fromHeight), int(toHeight+1)), nil } func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batchIndex l2stateprovider.Batch) (validator.GoGlobalState, error) { @@ -263,7 +268,7 @@ func (s *StateManager) L2MessageStatesUpTo( toHeight option.Option[l2stateprovider.Height], fromBatch, toBatch l2stateprovider.Batch, -) ([]common.Hash, error) { +) (mmap.Mmap, error) { var to l2stateprovider.Height if !toHeight.IsNone() { to = toHeight.Unwrap() @@ -271,7 +276,7 @@ func (s *StateManager) L2MessageStatesUpTo( blockChallengeLeafHeight := s.challengeLeafHeights[0] to = blockChallengeLeafHeight } - items, _, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) + items, err := s.StatesInBatchRange(fromHeight, to, fromBatch, toBatch) if err != nil { return nil, err } @@ -281,7 +286,7 @@ func (s *StateManager) L2MessageStatesUpTo( // CollectMachineHashes Collects a list of machine hashes at a message number based on some configuration parameters. func (s *StateManager) CollectMachineHashes( ctx context.Context, cfg *l2stateprovider.HashCollectorConfig, -) ([]common.Hash, error) { +) (mmap.Mmap, error) { s.Lock() defer s.Unlock() cacheKey := &challengecache.Key{ diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 6e59083c36..5fec849c40 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -157,23 +157,12 @@ func TestStateProvider_BOLD(t *testing.T) { toBatch := l2stateprovider.Batch(3) fromHeight := l2stateprovider.Height(0) toHeight := l2stateprovider.Height(14) - stateRoots, states, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) + stateRoots, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) Require(t, err) if len(stateRoots) != 15 { Fatal(t, "wrong number of state roots") } - if len(states) == 0 { - Fatal(t, "no states returned") - } - firstState := states[0] - if firstState.Batch != 1 && firstState.PosInBatch != 0 { - Fatal(t, "wrong first state") - } - lastState := states[len(states)-1] - if lastState.Batch != 1 && lastState.PosInBatch != 0 { - Fatal(t, "wrong last state") - } }) t.Run("AgreesWithExecutionState", func(t *testing.T) { // Non-zero position in batch shoould fail. diff --git a/system_tests/validation_mock_test.go b/system_tests/validation_mock_test.go index 01a161bbbe..1ba8ccbff0 100644 --- a/system_tests/validation_mock_test.go +++ b/system_tests/validation_mock_test.go @@ -7,10 +7,13 @@ import ( "testing" "time" + "github.com/OffchainLabs/bold/mmap" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" + "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbos/arbostypes" "github.com/offchainlabs/nitro/arbutil" @@ -116,9 +119,9 @@ func (r *mockExecRun) GetStepAt(position uint64) containers.PromiseInterface[*va }, nil) } -func (r *mockExecRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { +func (r *mockExecRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] { // TODO: Add mock implementation for GetLeavesWithStepSize - return containers.NewReadyPromise[[]common.Hash](nil, nil) + return containers.NewReadyPromise[mmap.Mmap](nil, nil) } func (r *mockExecRun) GetLastStep() containers.PromiseInterface[*validator.MachineStepResult] { diff --git a/validator/interface.go b/validator/interface.go index da56be7ffb..2a1eb4f5d2 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -3,6 +3,8 @@ package validator import ( "context" + "github.com/OffchainLabs/bold/mmap" + "github.com/ethereum/go-ethereum/common" "github.com/offchainlabs/nitro/util/containers" @@ -30,7 +32,7 @@ type ExecutionSpawner interface { type ExecutionRun interface { GetStepAt(uint64) containers.PromiseInterface[*MachineStepResult] - GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] + GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] GetLastStep() containers.PromiseInterface[*MachineStepResult] GetProofAt(uint64) containers.PromiseInterface[[]byte] PrepareRange(uint64, uint64) containers.PromiseInterface[struct{}] diff --git a/validator/server_api/valiation_api.go b/validator/server_api/valiation_api.go index 1848897521..36aaeca1bf 100644 --- a/validator/server_api/valiation_api.go +++ b/validator/server_api/valiation_api.go @@ -13,6 +13,8 @@ import ( "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" "github.com/offchainlabs/nitro/validator/server_arb" + + "github.com/OffchainLabs/bold/mmap" ) const Namespace string = "validation" @@ -142,7 +144,7 @@ func (a *ExecServerAPI) GetStepAt(ctx context.Context, execid uint64, position u return MachineStepResultToJson(res), nil } -func (a *ExecServerAPI) GetLeavesWithStepSize(ctx context.Context, execid, fromStep, stepSize, numDesiredLeaves uint64) ([]common.Hash, error) { +func (a *ExecServerAPI) GetLeavesWithStepSize(ctx context.Context, execid, fromStep, stepSize, numDesiredLeaves uint64) (mmap.Mmap, error) { run, err := a.getRun(execid) if err != nil { return nil, err diff --git a/validator/server_api/validation_client.go b/validator/server_api/validation_client.go index ed055c3cfb..8d0ddf06ba 100644 --- a/validator/server_api/validation_client.go +++ b/validator/server_api/validation_client.go @@ -7,12 +7,12 @@ import ( "sync/atomic" "time" - "github.com/offchainlabs/nitro/validator" + "github.com/OffchainLabs/bold/mmap" "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/rpcclient" "github.com/offchainlabs/nitro/util/stopwaiter" - + "github.com/offchainlabs/nitro/validator" "github.com/offchainlabs/nitro/validator/server_common" "github.com/ethereum/go-ethereum/common" @@ -177,9 +177,9 @@ func (r *ExecutionClientRun) GetStepAt(pos uint64) containers.PromiseInterface[* }) } -func (r *ExecutionClientRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { - return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { - var resJson []common.Hash +func (r *ExecutionClientRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] { + return stopwaiter.LaunchPromiseThread[mmap.Mmap](r, func(ctx context.Context) (mmap.Mmap, error) { + var resJson mmap.Mmap err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getLeavesWithStepSize", r.id, machineStartIndex, stepSize, numDesiredLeaves) if err != nil { return nil, err diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 2018ef7baa..278dff52c3 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -8,7 +8,8 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/common" + "github.com/OffchainLabs/bold/mmap" + "github.com/ethereum/go-ethereum/crypto" "github.com/offchainlabs/nitro/util/containers" @@ -57,27 +58,33 @@ func (e *executionRun) GetStepAt(position uint64) containers.PromiseInterface[*v }) } -func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { - return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { +func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] { + return stopwaiter.LaunchPromiseThread[mmap.Mmap](e, func(ctx context.Context) (mmap.Mmap, error) { machine, err := e.cache.GetMachineAt(ctx, machineStartIndex) if err != nil { return nil, err } // If the machine is starting at index 0, we always want to start at the "Machine finished" global state status // to align with the state roots that the inbox machine will produce. - var stateRoots []common.Hash + stateRootsMmap, err := mmap.NewMmap(int(numDesiredLeaves)) + numStateRoots := 0 + if err != nil { + return nil, err + } if machineStartIndex == 0 { gs := machine.GetGlobalState() hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) - stateRoots = append(stateRoots, hash) + stateRootsMmap.Set(numStateRoots, hash) + numStateRoots++ } else { // Otherwise, we simply append the machine hash at the specified start index. - stateRoots = append(stateRoots, machine.Hash()) + stateRootsMmap.Set(numStateRoots, machine.Hash()) + numStateRoots++ } // If we only want 1 state root, we can return early. if numDesiredLeaves == 1 { - return stateRoots, nil + return stateRootsMmap, nil } for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { // The absolute opcode position the machine should be in after stepping. @@ -93,7 +100,8 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { gs := machine.GetGlobalState() hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) - stateRoots = append(stateRoots, hash) + stateRootsMmap.Set(numStateRoots, hash) + numStateRoots++ break } // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. @@ -103,16 +111,18 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes return nil, fmt.Errorf("machine is in wrong position want: %d, got: %d", position, machineStep) } } - stateRoots = append(stateRoots, machine.Hash()) + stateRootsMmap.Set(numStateRoots, machine.Hash()) + numStateRoots++ } // If the machine finished in less than the number of hashes we anticipate, we pad // to the expected value by repeating the last machine hash until the state roots are the correct // length. - for uint64(len(stateRoots)) < numDesiredLeaves { - stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) + lastStateRoot := stateRootsMmap.Get(numStateRoots - 1) + for i := numStateRoots; i < int(numDesiredLeaves); i++ { + stateRootsMmap.Set(numStateRoots, lastStateRoot) } - return stateRoots, nil + return stateRootsMmap, nil }) } From bd15d2b0604587af55e91c57cd1bd60d8fd00415 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 19 Oct 2023 23:09:10 +0530 Subject: [PATCH 095/126] use .Free() --- bold | 2 +- staker/challenge-cache/cache_test.go | 3 +++ staker/state_provider.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bold b/bold index 8b163f0125..3858969263 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 8b163f01256d96fca732ea6beabb34559ea4cbb4 +Subproject commit 38589692637b2990fb661c643a0718b66ef1a217 diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 2a09a2e731..0190067ebb 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -53,6 +53,7 @@ func TestCache(t *testing.T) { if err != nil { t.Fatal(err) } + defer want.Free() err = cache.Put(key, want) if err != nil { t.Fatal(err) @@ -125,6 +126,7 @@ func TestReadWriteStateRoots(t *testing.T) { if err != nil { t.Fatal(err) } + defer stateRoots.Free() stateRoots.Set(0, common.BytesToHash([]byte("foo"))) err = writeStateRoots(m, stateRoots) if err == nil { @@ -310,6 +312,7 @@ func BenchmarkCache_Read_32Mb(b *testing.B) { if err != nil { b.Fatal(err) } + defer rootsMmap.Free() for i := 0; i < numRoots; i++ { rootsMmap.Set(i, common.BytesToHash([]byte(fmt.Sprintf("%d", i)))) } diff --git a/staker/state_provider.go b/staker/state_provider.go index 59d6c2e346..7647766742 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -212,6 +212,7 @@ func (s *StateManager) StatesInBatchRange( msgIndex := uint64(prevBatchMsgCount) + i gs, err := s.findGlobalStateFromMessageCountAndBatch(arbutil.MessageIndex(msgIndex), batch) if err != nil { + stateRootsMmap.Free() return nil, err } From f202d2d202cf80deec38776a4659778be0120e96 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 10 Nov 2023 15:04:42 +0530 Subject: [PATCH 096/126] Clean up old cache files --- staker/challenge-cache/cache.go | 38 ++++++++++++++++++++++++++-- staker/challenge-cache/cache_test.go | 12 ++++++--- staker/state_provider.go | 5 +++- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 1a79ff507c..a2d54afe3b 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -34,6 +34,7 @@ import ( "io" "os" "path/filepath" + "time" protocol "github.com/OffchainLabs/bold/chain-abstraction" "github.com/OffchainLabs/bold/containers/option" @@ -62,11 +63,44 @@ type Cache struct { baseDir string } +func isOlderThanFourteenDays(t time.Time) bool { + return time.Now().Sub(t) > 14*24*time.Hour +} + +func deleteFilesOlderThanFourteenDays(dir string) error { + files, err := os.ReadDir(dir) + if err != nil { + return err + } + for _, file := range files { + fileInfo, err := file.Info() + if err != nil { + return err + } + if fileInfo.IsDir() { + if err := deleteFilesOlderThanFourteenDays(filepath.Join(dir, fileInfo.Name())); err != nil { + return err + } + } else { + if isOlderThanFourteenDays(fileInfo.ModTime()) { + if err := os.Remove(filepath.Join(dir, fileInfo.Name())); err != nil { + return err + } + } + } + } + return nil +} + // New cache from a base directory path. -func New(baseDir string) *Cache { +func New(baseDir string) (*Cache, error) { + err := deleteFilesOlderThanFourteenDays(baseDir) + if err != nil { + return nil, err + } return &Cache{ baseDir: baseDir, - } + }, nil } // Key for cache lookups includes the wavm module root of a challenge, as well diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index b9fec74b9c..32dc219cf8 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -29,7 +29,10 @@ func TestCache(t *testing.T) { t.Fatal(err) } }) - cache := New(basePath) + cache, err := New(basePath) + if err != nil { + t.Fatal(err) + } key := &Key{ WavmModuleRoot: common.BytesToHash([]byte("foo")), MessageHeight: 0, @@ -51,7 +54,7 @@ func TestCache(t *testing.T) { common.BytesToHash([]byte("bar")), common.BytesToHash([]byte("baz")), } - err := cache.Put(key, want) + err = cache.Put(key, want) if err != nil { t.Fatal(err) } @@ -295,7 +298,10 @@ func BenchmarkCache_Read_32Mb(b *testing.B) { b.Fatal(err) } }) - cache := New(basePath) + cache, err := New(basePath) + if err != nil { + b.Fatal(err) + } key := &Key{ WavmModuleRoot: common.BytesToHash([]byte("foo")), MessageHeight: 0, diff --git a/staker/state_provider.go b/staker/state_provider.go index 8caaaa3bb4..6106884632 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -47,7 +47,10 @@ type StateManager struct { } func NewStateManager(val *StatelessBlockValidator, blockValidator *BlockValidator, numOpcodesPerBigStep uint64, maxWavmOpcodes uint64, cacheBaseDir string) (*StateManager, error) { - historyCache := challengecache.New(cacheBaseDir) + historyCache, err := challengecache.New(cacheBaseDir) + if err != nil { + return nil, err + } return &StateManager{ validator: val, blockValidator: blockValidator, From 60a17ff3cea4f5d18dd47315beab8939ec3e2fa6 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 10 Nov 2023 15:21:44 +0530 Subject: [PATCH 097/126] fix lint --- staker/challenge-cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 0b764192e1..b2690b7182 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -68,7 +68,7 @@ type Cache struct { } func isOlderThanFourteenDays(t time.Time) bool { - return time.Now().Sub(t) > 14*24*time.Hour + return time.Since(t) > 14*24*time.Hour } func deleteFilesOlderThanFourteenDays(dir string) error { From 3eb482e649ab601d27faac7fcafed5fa3c7f0e0e Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 17:58:33 +0530 Subject: [PATCH 098/126] fix go.mod --- go.mod | 3 - go.sum | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 246 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 9668d533ec..1815528c65 100644 --- a/go.mod +++ b/go.mod @@ -234,7 +234,6 @@ require ( github.com/openzipkin/zipkin-go v0.4.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -252,7 +251,6 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/samber/lo v1.36.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect github.com/stretchr/testify v1.8.4 // indirect github.com/supranational/blst v0.3.11-0.20230406105308-e9dfc5ee724b // indirect github.com/urfave/cli/v2 v2.24.1 // indirect @@ -297,7 +295,6 @@ require ( google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/square/go-jose.v2 v2.5.1 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.1.7 // indirect nhooyr.io/websocket v1.8.7 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index d39339336e..7ecde76314 100644 --- a/go.sum +++ b/go.sum @@ -230,7 +230,6 @@ github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoG github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codeclysm/extract/v3 v3.0.2 h1:sB4LcE3Php7LkhZwN0n2p8GCwZe92PEQutdbGURf5xc= github.com/codeclysm/extract/v3 v3.0.2/go.mod h1:NKsw+hqua9H+Rlwy/w/3Qgt9jDonYEgB6wJu+25eOKw= @@ -275,7 +274,6 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6Uh github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= @@ -393,7 +391,6 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -616,8 +613,6 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= -github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/golang-lru/v2 v2.0.2 h1:Dwmkdr5Nc/oBiXgJS3CDHNhJtIHkuZ3DZF5twqnfBdU= github.com/hashicorp/golang-lru/v2 v2.0.2/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -634,10 +629,12 @@ github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZ github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goupnp v1.1.0 h1:gEe0Dp/lZmPZiDFzJJaOfUpOvv2MKUkoBX8lDrn9vKU= github.com/huin/goupnp v1.1.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= @@ -647,20 +644,25 @@ github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/C github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= +github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= github.com/ipfs/go-bitfield v1.0.0/go.mod h1:N/UiujQy+K+ceU1EF5EkVd1TNqevLrCQMIcAEPrdtus= +github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= github.com/ipfs/go-bitswap v0.6.0/go.mod h1:Hj3ZXdOC5wBJvENtdqsixmzzRukqd8EHLxZLZc3mzRA= +github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= +github.com/ipfs/go-block-format v0.1.1 h1:129vSO3zwbsYADcyQWcOYiuCpAqt462SFfqFHdFJhhI= github.com/ipfs/go-block-format v0.1.1/go.mod h1:+McEIT+g52p+zz5xGAABGSOKrzmrdX97bc0USBdWPUs= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= github.com/ipfs/go-blockservice v0.2.1/go.mod h1:k6SiwmgyYgs4M/qt+ww6amPeUH9EISLRBnvUurKJhi8= github.com/ipfs/go-blockservice v0.3.0/go.mod h1:P5ppi8IHDC7O+pA0AlGTF09jruB2h+oP3wVVaZl8sfk= +github.com/ipfs/go-blockservice v0.5.1 h1:9pAtkyKAz/skdHTh0kH8VulzWp+qmSDD0aI17TYP/s0= github.com/ipfs/go-blockservice v0.5.1/go.mod h1:VpMblFEqG67A/H2sHKAemeH9vlURVavlysbdUI632yk= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -670,7 +672,9 @@ github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67Fexh github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= +github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= +github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= github.com/ipfs/go-cidutil v0.1.0/go.mod h1:e7OEVBMIv9JaOxt9zaGEmAoSlXW9jdFZ5lP/0PwcfpA= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= @@ -682,76 +686,108 @@ github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13X github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= +github.com/ipfs/go-delegated-routing v0.7.0 h1:43FyMnKA+8XnyX68Fwg6aoGkqrf8NS5aG7p644s26PU= github.com/ipfs/go-delegated-routing v0.7.0/go.mod h1:u4zxjUWIe7APUW5ds9CfD0tJX3vM9JhIeNqA8kE4vHE= +github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= +github.com/ipfs/go-ds-badger v0.3.0 h1:xREL3V0EH9S219kFFueOYJJTcjgNSZ2HY1iSvN7U1Ro= github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= +github.com/ipfs/go-ds-flatfs v0.5.1 h1:ZCIO/kQOS/PSh3vcF1H6a8fkRGS7pOfwfPdx4n/KJH4= github.com/ipfs/go-ds-flatfs v0.5.1/go.mod h1:RWTV7oZD/yZYBKdbVIFXTX2fdY2Tbvl94NsWqmoyAX4= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= +github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo= github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= +github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ= github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9UvVh8V3JxE= +github.com/ipfs/go-fetcher v1.6.1 h1:UFuRVYX5AIllTiRhi5uK/iZkfhSpBCGX7L70nSZEmK8= github.com/ipfs/go-fetcher v1.6.1/go.mod h1:27d/xMV8bodjVs9pugh/RCjjK2OZ68UgAMspMdingNo= +github.com/ipfs/go-filestore v1.2.0 h1:O2wg7wdibwxkEDcl7xkuQsPvJFRBVgVSsOJ/GP6z3yU= github.com/ipfs/go-filestore v1.2.0/go.mod h1:HLJrCxRXquTeEEpde4lTLMaE/MYJZD7WHLkp9z6+FF8= +github.com/ipfs/go-fs-lock v0.0.7 h1:6BR3dajORFrFTkb5EpCUFIAypsoxpGpDSVUdFwzgL9U= github.com/ipfs/go-fs-lock v0.0.7/go.mod h1:Js8ka+FNYmgQRLrRXzU3CB/+Csr1BwrRilEcvYrHhhc= +github.com/ipfs/go-graphsync v0.14.1 h1:tvFpBY9LcehIB7zi5SZIa+7aoxBOrGbdekhOXdnlT70= github.com/ipfs/go-graphsync v0.14.1/go.mod h1:S6O/c5iXOXqDgrQgiZSgOTRUSiVvpKEhrzqFHKnLVcs= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.2.1/go.mod h1:jGesd8EtCM3/zPgx+qr0/feTXGUeRai6adgwC+Q+JvE= +github.com/ipfs/go-ipfs-blockstore v1.2.0 h1:n3WTeJ4LdICWs/0VSfjHrlqpPpl6MZ+ySd3j8qz0ykw= github.com/ipfs/go-ipfs-blockstore v1.2.0/go.mod h1:eh8eTFLiINYNSNawfZOC7HOxNTxpB1PFuA5E1m/7exE= +github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= +github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= +github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= github.com/ipfs/go-ipfs-ds-help v0.1.1/go.mod h1:SbBafGJuGsPI/QL3j9Fc5YPLeAu+SzOkI0gFwAg+mOs= +github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-interface v0.1.0/go.mod h1:ych7WPlyHqFvCi/uQI48zLZuAWVP5iTQPXEfVaw5WEI= +github.com/ipfs/go-ipfs-exchange-interface v0.2.0 h1:8lMSJmKogZYNo2jjhUs0izT+dck05pqUw4mWNW9Pw6Y= github.com/ipfs/go-ipfs-exchange-interface v0.2.0/go.mod h1:z6+RhJuDQbqKguVyslSOuVDhqF9JtTrO3eptSAiW2/Y= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= github.com/ipfs/go-ipfs-exchange-offline v0.1.1/go.mod h1:vTiBRIbzSwDD0OWm+i3xeT0mO7jG2cbJYatp3HPk5XY= github.com/ipfs/go-ipfs-exchange-offline v0.2.0/go.mod h1:HjwBeW0dvZvfOMwDP0TSKXIHf2s+ksdP4E3MLDRtLKY= +github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA= github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= +github.com/ipfs/go-ipfs-keystore v0.1.0 h1:gfuQUO/cyGZgZIHE6OrJas4OnwuxXCqJG7tI0lrB5Qc= github.com/ipfs/go-ipfs-keystore v0.1.0/go.mod h1:LvLw7Qhnb0RlMOfCzK6OmyWxICip6lQ06CCmdbee75U= +github.com/ipfs/go-ipfs-pinner v0.3.0 h1:jwe5ViX3BON3KgOAYrrhav2+1ONB0QzFAWQd7HUlbuM= github.com/ipfs/go-ipfs-pinner v0.3.0/go.mod h1:oX0I0nC6zlNIh0LslSrUnjfNKPq8ufoFtqV1/wcJvyo= +github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A= github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= +github.com/ipfs/go-ipfs-pq v0.0.3 h1:YpoHVJB+jzK15mr/xsWC574tyDLkezVrDNeaalQBsTE= github.com/ipfs/go-ipfs-pq v0.0.3/go.mod h1:btNw5hsHBpRcSSgZtiNm/SLj5gYIZ18AKtv3kERkRb4= +github.com/ipfs/go-ipfs-provider v0.8.1 h1:qt670pYmcNH3BCjyXDgg07o2WsTRsOdMwYc25ukCdjQ= github.com/ipfs/go-ipfs-provider v0.8.1/go.mod h1:qCpwpoohIRVXvNzkygzsM3qdqP/sXlrogtA5I45tClc= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= github.com/ipfs/go-ipfs-routing v0.2.1/go.mod h1:xiNNiwgjmLqPS1cimvAw6EyB9rkVDbiocA4yY+wRNLM= +github.com/ipfs/go-ipfs-routing v0.3.0 h1:9W/W3N+g+y4ZDeffSgqhgo7BsBSJwPMcyssET9OWevc= github.com/ipfs/go-ipfs-routing v0.3.0/go.mod h1:dKqtTFIql7e1zYsEuWLyuOU+E0WJWW8JjbTPLParDWo= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= +github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.6 h1:pYuWHyvSpIsOOLw4Jy7NbBkCyzLDcl64Bf/LZW7eBQ0= github.com/ipfs/go-ipld-cbor v0.0.6/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-ipld-format v0.3.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= +github.com/ipfs/go-ipld-format v0.4.0 h1:yqJSaJftjmjc9jEOFYlpkwOLVKv68OD27jFLlSghBlQ= github.com/ipfs/go-ipld-format v0.4.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= +github.com/ipfs/go-ipld-git v0.1.1 h1:TWGnZjS0htmEmlMFEkA3ogrNCqWjIxwr16x1OsdhG+Y= github.com/ipfs/go-ipld-git v0.1.1/go.mod h1:+VyMqF5lMcJh4rwEppV0e6g4nCCHXThLYYDpKUkJubI= github.com/ipfs/go-ipld-legacy v0.1.0/go.mod h1:86f5P/srAmh9GcIcWQR9lfFLZPrIyyXQeVlOWeeWEuI= +github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2cdcc= github.com/ipfs/go-ipld-legacy v0.1.1/go.mod h1:8AyKFCjgRPsQFf15ZQgDB8Din4DML/fOmKZkkFkrIEg= +github.com/ipfs/go-ipns v0.3.0 h1:ai791nTgVo+zTuq2bLvEGmWP1M0A6kGTXUsgv/Yq67A= github.com/ipfs/go-ipns v0.3.0/go.mod h1:3cLT2rbvgPZGkHJoPO1YMJeh6LtkxopCkKFcio/wE24= +github.com/ipfs/go-libipfs v0.6.2 h1:QUf3kS3RrCjgtE0QW2d18PFFfOLeEt24Ft892ipLzRI= github.com/ipfs/go-libipfs v0.6.2/go.mod h1:FmhKgxMOQA572TK5DA3MZ5GL44ZqsMHIrkgK4gLn4A8= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= @@ -759,35 +795,52 @@ github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscw github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= +github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= github.com/ipfs/go-merkledag v0.5.1/go.mod h1:cLMZXx8J08idkp5+id62iVftUQV+HlYJ3PIhDfZsjA4= github.com/ipfs/go-merkledag v0.6.0/go.mod h1:9HSEwRd5sV+lbykiYP+2NC/3o6MZbKNaa4hfNcH5iH0= +github.com/ipfs/go-merkledag v0.9.0 h1:DFC8qZ96Dz1hMT7dtIpcY524eFFDiEWAF8hNJHWW2pk= github.com/ipfs/go-merkledag v0.9.0/go.mod h1:bPHqkHt5OZ0p1n3iqPeDiw2jIBkjAytRjS3WSBwjq90= +github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= +github.com/ipfs/go-mfs v0.2.1 h1:5jz8+ukAg/z6jTkollzxGzhkl3yxm022Za9f2nL5ab8= github.com/ipfs/go-mfs v0.2.1/go.mod h1:Woj80iuw4ajDnIP6+seRaoHpPsc9hmL0pk/nDNDWP88= +github.com/ipfs/go-namesys v0.7.0 h1:xqosk71GIVRkFDtF2UNRcXn4LdNeo7tzuy8feHD6NbU= github.com/ipfs/go-namesys v0.7.0/go.mod h1:KYSZBVZG3VJC34EfqqJPG7T48aWgxseoMPAPA5gLyyQ= github.com/ipfs/go-path v0.2.1/go.mod h1:NOScsVgxfC/eIw4nz6OiGwK42PjaSJ4Y/ZFPn1Xe07I= +github.com/ipfs/go-path v0.3.1 h1:wkeaCWE/NTuuPGlEkLTsED5UkzfKYZpxaFFPgk8ZVLE= github.com/ipfs/go-path v0.3.1/go.mod h1:eNLsxJEEMxn/CDzUJ6wuNl+6No6tEUhOZcPKsZsYX0E= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= +github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg= github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= github.com/ipfs/go-unixfs v0.3.1/go.mod h1:h4qfQYzghiIc8ZNFKiLMFWOTzrWIAtzYQ59W/pCFf1o= +github.com/ipfs/go-unixfs v0.4.4 h1:D/dLBOJgny5ZLIur2vIXVQVW0EyDHdOMBDEhgHrt6rY= github.com/ipfs/go-unixfs v0.4.4/go.mod h1:TSG7G1UuT+l4pNj91raXAPkX0BhJi3jST1FDTfQ5QyM= github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s= +github.com/ipfs/go-unixfsnode v1.5.2 h1:CvsiTt58W2uR5dD8bqQv+aAY0c1qolmXmSyNbPHYiew= github.com/ipfs/go-unixfsnode v1.5.2/go.mod h1:NlOebRwYx8lMCNMdhAhEspYPBD3obp7TE0LvBqHY+ks= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= +github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs= github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG5Wb4xnPU= +github.com/ipfs/interface-go-ipfs-core v0.11.0 h1:n1tplrwsz7oZXkpkZM5a3MDBxksMfSQ103ej4e+l7NA= github.com/ipfs/interface-go-ipfs-core v0.11.0/go.mod h1:xmnoccUXY7N/Q8AIx0vFqgW926/FAZ8+do/1NTEHKsU= +github.com/ipfs/kubo v0.19.1 h1:jQmwct9gurfZcpShmfwZf/0CXSgxgTVWJxx//l4Ob3M= github.com/ipfs/kubo v0.19.1/go.mod h1:jD1cb+H5ax9EzxLflHG8dz5LHfuAMO+r00/h3MwYkd4= +github.com/ipld/edelweiss v0.2.0 h1:KfAZBP8eeJtrLxLhi7r3N0cBCo7JmwSRhOJp3WSpNjk= github.com/ipld/edelweiss v0.2.0/go.mod h1:FJAzJRCep4iI8FOFlRriN9n0b7OuX3T/S9++NpBDmA4= +github.com/ipld/go-car v0.5.0 h1:kcCEa3CvYMs0iE5BzD5sV7O2EwMiCIp3uF8tA6APQT8= +github.com/ipld/go-car/v2 v2.5.1 h1:U2ux9JS23upEgrJScW8VQuxmE94560kYxj9CQUpcfmk= github.com/ipld/go-codec-dagpb v1.3.0/go.mod h1:ga4JTU3abYApDC3pZ00BC2RSvC3qfBb9MSJkMLSwnhA= +github.com/ipld/go-codec-dagpb v1.5.0 h1:RspDRdsJpLfgCI0ONhTAnbHdySGD4t+LHSPK4X1+R0k= github.com/ipld/go-codec-dagpb v1.5.0/go.mod h1:0yRIutEFD8o1DGVqw4RSHh+BUTlJA9XWldxaaWR/o4g= github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= github.com/ipld/go-ipld-prime v0.14.1/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0= +github.com/ipld/go-ipld-prime v0.19.0 h1:5axC7rJmPc17Emw6TelxGwnzALk0PdupZ2oj2roDj04= github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= @@ -796,13 +849,18 @@ github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0Gqw github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= +github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= +github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c h1:uUx61FiAa1GI6ZmVd2wf2vULeQZIKG66eybjNXKYCz4= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= +github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= @@ -814,8 +872,11 @@ github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0 github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -825,15 +886,20 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/clock v0.0.0-20180524022203-d293bb356ca4/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9 h1:Y+lzErDTURqeXqlqYi4YBYbDd7ycU74gW1ADt57/bgY= github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0 h1:+WWUkhnTjV6RNOxkcwk79qrjeyHEHvBzlneueBsatX4= github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0/go.mod h1:hpGvhGHPVbNBraRLZEhoQwFLMrjK8PSlO4D3nDjKYXo= github.com/juju/utils v0.0.0-20180808125547-9dfc6dbfb02b/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= @@ -856,44 +922,57 @@ github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= +github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= +github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= +github.com/libp2p/go-doh-resolver v0.4.0 h1:gUBa1f1XsPwtpE1du0O+nnZCUqtG7oYi7Bb+0S7FQqw= github.com/libp2p/go-doh-resolver v0.4.0/go.mod h1:v1/jwsFusgsWIGX/c6vCRrnJ60x7bhTiq/fs2qt0cAg= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= +github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= @@ -902,7 +981,9 @@ github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xS github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0= +github.com/libp2p/go-libp2p v0.27.8 h1:IX5x/4yKwyPQeVS2AXHZ3J4YATM9oHBGH1gBc23jBAI= github.com/libp2p/go-libp2p v0.27.8/go.mod h1:eCFFtd0s5i/EVKR7+5Ki8bM7qwkNW3TPTTSSW9sz8NE= +github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLEQHwOCZ7s8s= github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= @@ -944,8 +1025,10 @@ github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFT github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-kad-dht v0.21.1 h1:xpfp8/t9+X2ip1l8Umap1/UGNnJ3RHJgKGAEsnRAlTo= github.com/libp2p/go-libp2p-kad-dht v0.21.1/go.mod h1:Oy8wvbdjpB70eS5AaFaI68tOtrdo3KylTvXDjikxqFo= github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= +github.com/libp2p/go-libp2p-kbucket v0.5.0 h1:g/7tVm8ACHDxH29BGrpsQlnNeu+6OF1A9bno/4/U1oA= github.com/libp2p/go-libp2p-kbucket v0.5.0/go.mod h1:zGzGCpQd78b5BNTDGHNDLaTt9aDK/A02xeZp9QeFC4U= github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= @@ -969,11 +1052,15 @@ github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRj github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= +github.com/libp2p/go-libp2p-pubsub v0.9.0 h1:mcLb4WzwhUG4OKb0rp1/bYMd/DYhvMyzJheQH3LMd1s= github.com/libp2p/go-libp2p-pubsub v0.9.0/go.mod h1:OEsj0Cc/BpkqikXRTrVspWU/Hx7bMZwHP+6vNMd+c7I= +github.com/libp2p/go-libp2p-pubsub-router v0.6.0 h1:D30iKdlqDt5ZmLEYhHELCMRj8b4sFAqrUcshIUvVP/s= github.com/libp2p/go-libp2p-pubsub-router v0.6.0/go.mod h1:FY/q0/RBTKsLA7l4vqC2cbRbOvyDotg8PJQ7j8FDudE= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= +github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk= +github.com/libp2p/go-libp2p-routing-helpers v0.6.2 h1:u6SWfX+3LoqqTAFxWVl79RkcIDE3Zsay5d+JohlEBaE= github.com/libp2p/go-libp2p-routing-helpers v0.6.2/go.mod h1:R289GUxUMzRXIbWGSuUUTPrlVJZ3Y/pPz495+qgXJX8= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= @@ -993,11 +1080,13 @@ github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= +github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= +github.com/libp2p/go-libp2p-xor v0.1.0 h1:hhQwT4uGrBcuAkUGXADuPltalOdpf9aag9kaYNT2tLA= github.com/libp2p/go-libp2p-xor v0.1.0/go.mod h1:LSTM5yRnjGZbWNTA/hRwq2gGFrvRIbQJscoIL/u6InY= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= github.com/libp2p/go-libp2p-yamux v0.2.1/go.mod h1:1FBXiHDk1VyRM1C0aez2bCfHQ4vMZKkAQzZbkSQt5fI= @@ -1017,20 +1106,24 @@ github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3 github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= +github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= github.com/libp2p/go-mplex v0.7.0/go.mod h1:rW8ThnRcYWft/Jb2jeORBmPd6xuG3dGxWN/W168L9EU= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= +github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= +github.com/libp2p/go-nat v0.1.0 h1:MfVsH6DLcpa04Xr+p8hmVRG4juse0s3J8HyNWYHffXg= github.com/libp2p/go-nat v0.1.0/go.mod h1:X7teVkwRHNInVNWQiO/tAiAVRwSr5zoRz4YSTC3uRBM= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= +github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= @@ -1039,6 +1132,7 @@ github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= +github.com/libp2p/go-reuseport v0.2.0 h1:18PRvIMlpY6ZK85nIAicSBuXXvrYoSw3dsBAR7zc560= github.com/libp2p/go-reuseport v0.2.0/go.mod h1:bvVho6eLMm6Bz5hmU0LYN3ixd3nPPvtIlaURZZgOY4k= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= @@ -1067,27 +1161,33 @@ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= +github.com/libp2p/go-yamux/v4 v4.0.0 h1:+Y80dV2Yx/kv7Y7JKu0LECyVdMXm1VUoko+VQ9rBfZQ= github.com/libp2p/go-yamux/v4 v4.0.0/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= +github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q= github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easygo v0.0.0-20190618140210-3c14a0dc985f h1:4+gHs0jJFJ06bfN8PshnM6cHcxGjRUVRLo5jndDiKRQ= github.com/mailru/easygo v0.0.0-20190618140210-3c14a0dc985f/go.mod h1:tHCZHV8b2A90ObojrEAzY0Lb03gxUxjDHr5IJyAh4ew= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -1099,12 +1199,15 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -1115,9 +1218,13 @@ github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= +github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= github.com/miekg/dns v1.1.53/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= @@ -1125,11 +1232,14 @@ github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+ github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -1139,25 +1249,34 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= @@ -1170,13 +1289,16 @@ github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= +github.com/multiformats/go-multiaddr v0.9.0 h1:3h4V1LHIk5w4hJHekMKWALPXErDfz/sggzwC/NcqbDQ= github.com/multiformats/go-multiaddr v0.9.0/go.mod h1:mI67Lb1EeTOYb8GQfL/7wpIZwc46ElrvzhYnoJOmTT0= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= github.com/multiformats/go-multiaddr-dns v0.3.0/go.mod h1:mNzQ4eTGDg0ll1N9jKPOUogZPoJ30W8a7zk66FQPpdQ= +github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= +github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= github.com/multiformats/go-multiaddr-net v0.0.1/go.mod h1:nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU= github.com/multiformats/go-multiaddr-net v0.1.0/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= @@ -1188,8 +1310,10 @@ github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysj github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= +github.com/multiformats/go-multicodec v0.8.1 h1:ycepHwavHafh3grIbR1jIXnKCsFm0fqsfEOsJ8NtKE8= github.com/multiformats/go-multicodec v0.8.1/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= @@ -1199,16 +1323,19 @@ github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUj github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= +github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= +github.com/multiformats/go-multistream v0.4.1 h1:rFy0Iiyn3YT0asivDUIR05leAdwZq3de4741sbiSdfo= github.com/multiformats/go-multistream v0.4.1/go.mod h1:Mz5eykRVAjJWckE2U78c6xqdtyNUEhKSM0Lwar2p77Q= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1224,10 +1351,12 @@ github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1237,7 +1366,9 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1246,41 +1377,53 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw= github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4= github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1290,6 +1433,7 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1297,6 +1441,7 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1304,6 +1449,7 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1312,41 +1458,57 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/qtls-go1-19 v0.3.3 h1:wznEHvJwd+2X3PqftRha0SUKmGsnb6dfArMhy9PeJVE= github.com/quic-go/qtls-go1-19 v0.3.3/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= +github.com/quic-go/qtls-go1-20 v0.2.3 h1:m575dovXn1y2ATOb1XrRFcrv0F+EQmlowTkoraNkDPI= github.com/quic-go/qtls-go1-20 v0.2.3/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y0= github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA= +github.com/quic-go/webtransport-go v0.5.2 h1:GA6Bl6oZY+g/flt00Pnu0XtivSD8vukOu3lYhJjnGEk= github.com/quic-go/webtransport-go v0.5.2/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU= +github.com/r3labs/diff/v3 v3.0.1 h1:CBKqf3XmNRHXKmdU7mZP1w7TV0pDyVCis1AUHtA4Xtg= github.com/r3labs/diff/v3 v3.0.1/go.mod h1:f1S9bourRbiM66NskseyUdo0fTmEE0qKrikYJX63dgo= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= +github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rhnvrm/simples3 v0.6.1 h1:H0DJwybR6ryQE+Odi9eqkHuzjYAeJgtGcGtuBwOhsH8= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rivo/tview v0.0.0-20230814110005-ccc2c8119703 h1:ZyM/+FYnpbZsFWuCohniM56kRoHRB4r5EuIzXEYkpxo= github.com/rivo/tview v0.0.0-20230814110005-ccc2c8119703/go.mod h1:nVwGv4MP47T0jvlk7KuTTjjuSmrGO4JF0iaiNt4bufE= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/samber/lo v1.36.0 h1:4LaOxH1mHnbDGhTVE0i1z8v/lWaQW8AIfOD3HU4mSaw= github.com/samber/lo v1.36.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= @@ -1378,10 +1540,12 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1391,6 +1555,7 @@ github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1399,9 +1564,11 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1409,6 +1576,7 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1419,25 +1587,36 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/supranational/blst v0.3.11-0.20230406105308-e9dfc5ee724b h1:u49mjRnygnB34h8OKbnNJFVUtWSKIKb1KukdV8bILUM= github.com/supranational/blst v0.3.11-0.20230406105308-e9dfc5ee724b/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= +github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -1447,20 +1626,30 @@ github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= github.com/warpfork/go-testmark v0.9.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= +github.com/warpfork/go-testmark v0.10.0 h1:E86YlUMYfwIacEsQGlnTvjk1IgYkyTGjPhF0RnwTCmw= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= +github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ= github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= +github.com/wealdtech/go-merkletree v1.0.0 h1:DsF1xMzj5rK3pSQM6mPv8jlyJyHXhFxpnA2bwEjMMBY= github.com/wealdtech/go-merkletree v1.0.0/go.mod h1:cdil512d/8ZC7Kx3bfrDvGMQXB25NTKbsm0rFrmDax4= +github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= +github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= +github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= +github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= @@ -1468,6 +1657,7 @@ github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= github.com/whyrusleeping/mdns v0.0.0-20180901202407-ef14215e6b30/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= +github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -1478,6 +1668,7 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= @@ -1489,7 +1680,9 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -1504,34 +1697,51 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 h1:7Yxsak1q4XrJ5y7XBnNwqWx9amMZvoidCctv62XOQ6Y= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0/go.mod h1:M1hVZHNxcbkAlcvrOMlpQ4YOO3Awf+4N2dxkZL3xm04= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0 h1:cMDtmgJ5FpRvqx9x2Aq+Mm0O6K/zcUkH73SFz20TuBw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0/go.mod h1:ceUgdyfNv4h4gLxHR0WNfDiiVmZFodZhZSbOLhpxqXE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0 h1:MFAyzUPrTwLOwCi+cltN0ZVyy4phU41lwH+lyMyQTS4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0/go.mod h1:E+/KKhwOSw8yoPxSSuUHG6vKppkvhN+S1Jc7Nib3k3o= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.7.0 h1:pLP0MH4MAqeTEV0g/4flxw9O8Is48uAIauAnjznbW50= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.7.0/go.mod h1:aFXT9Ng2seM9eizF+LfKiyPBGy8xIZKwhusC1gIu3hA= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0 h1:8hPcgCg0rUJiKE6VWahRvjgLUrNl7rW2hffUEPKXVEM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0/go.mod h1:K4GDXPY6TjUiwbOh+DkKaEdCF8y+lvMoM6SeAPyfCCM= +go.opentelemetry.io/otel/exporters/zipkin v1.7.0 h1:X0FZj+kaIdLi29UiyrEGDhRTYsEXj9GdEW5Y39UQFEE= go.opentelemetry.io/otel/exporters/zipkin v1.7.0/go.mod h1:9YBXeOMFLQGwNEjsxMRiWPGoJX83usGMhbCmxUbNe5I= +go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.16.0 h1:WHzDWdXUvbc5bG2ObdrGfaNpQz7ft7QN9HHmJlbiB1E= go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/dig v1.16.1 h1:+alNIBsl0qfY0j6epRubp/9obgtrObRAc5aD+6jbWY8= go.uber.org/dig v1.16.1/go.mod h1:557JTAUZT5bUK0SvCwikmLPPtdQhfvLYtO5tJgQSbnk= +go.uber.org/fx v1.19.2 h1:SyFgYQFr1Wl0AYstE8vyYIzP4bFz2URrScjwC4cwUvY= go.uber.org/fx v1.19.2/go.mod h1:43G1VcqSzbIv77y00p1DRAsyZS8WdzuYdhZXmEUkMyQ= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1540,8 +1750,10 @@ go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1576,6 +1788,7 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1587,6 +1800,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1612,6 +1826,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1672,6 +1887,7 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1694,6 +1910,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1793,11 +2010,13 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1810,12 +2029,14 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1877,11 +2098,13 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -1950,8 +2173,11 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1984,6 +2210,7 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1999,6 +2226,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= @@ -2007,8 +2235,10 @@ gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/d4l3k/messagediff.v1 v1.2.1 h1:70AthpjunwzUiarMHyED52mj9UwtAnE89l1Gmrt3EU0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= @@ -2017,14 +2247,19 @@ gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/R gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -2036,10 +2271,12 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2051,12 +2288,16 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From a8fc94b533d7491d596c973727e91861bfa182b4 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 18:05:21 +0530 Subject: [PATCH 099/126] Update bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 37bdb25f80..2c430ae53b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 37bdb25f807733b13a18176b4fb59d89256c89be +Subproject commit 2c430ae53bcf512e1caa448d5840372c5689cae5 From 4b8676d777e02ad807b1a115bdc0cbeeeb8e7538 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 18:55:14 +0530 Subject: [PATCH 100/126] Add State provider fixes --- staker/state_provider.go | 174 +++++++++++------- ...assertion_on_large_number_of_batch_test.go | 2 +- system_tests/bold_challenge_protocol_test.go | 4 +- validator/server_arb/execution_run.go | 2 +- 4 files changed, 108 insertions(+), 74 deletions(-) diff --git a/staker/state_provider.go b/staker/state_provider.go index b9f09e86c5..48c78c6c7e 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -6,9 +6,9 @@ import ( "context" "errors" "fmt" + "strings" "sync" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -27,26 +27,38 @@ var ( _ l2stateprovider.ExecutionProvider = (*StateManager)(nil) ) -// Defines the ABI encoding structure for submission of prefix proofs to the protocol contracts -var ( - b32Arr, _ = abi.NewType("bytes32[]", "", nil) - // ProofArgs for submission to the protocol. - ProofArgs = abi.Arguments{ - {Type: b32Arr, Name: "prefixExpansion"}, - {Type: b32Arr, Name: "prefixProof"}, - } -) - var ( ErrChainCatchingUp = errors.New("chain catching up") ) -type Opt func(*StateManager) +type BoldConfig struct { + Enable bool `koanf:"enable"` + Mode string `koanf:"mode"` + BlockChallengeLeafHeight uint64 `koanf:"block-challenge-leaf-height"` + BigStepLeafHeight uint64 `koanf:"big-step-leaf-height"` + SmallStepLeafHeight uint64 `koanf:"small-step-leaf-height"` + NumBigSteps uint64 `koanf:"num-big-steps"` + ValidatorName string `koanf:"validator-name"` + MachineLeavesCachePath string `koanf:"machine-leaves-cache-path"` + AssertionPostingIntervalSeconds uint64 `koanf:"assertion-posting-interval-seconds"` + AssertionScanningIntervalSeconds uint64 `koanf:"assertion-scanning-interval-seconds"` + AssertionConfirmingIntervalSeconds uint64 `koanf:"assertion-confirming-interval-seconds"` + EdgeTrackerWakeIntervalSeconds uint64 `koanf:"edge-tracker-wake-interval-seconds"` +} -func DisableCache() Opt { - return func(sm *StateManager) { - sm.historyCache = nil - } +var DefaultBoldConfig = BoldConfig{ + Enable: false, + Mode: "make-mode", + BlockChallengeLeafHeight: 1 << 5, + BigStepLeafHeight: 1 << 5, + SmallStepLeafHeight: 1 << 7, + NumBigSteps: 5, + ValidatorName: "default-validator", + MachineLeavesCachePath: "/tmp/machine-leaves-cache", + AssertionPostingIntervalSeconds: 30, + AssertionScanningIntervalSeconds: 30, + AssertionConfirmingIntervalSeconds: 60, + EdgeTrackerWakeIntervalSeconds: 1, } type StateManager struct { @@ -62,7 +74,6 @@ func NewStateManager( cacheBaseDir string, challengeLeafHeights []l2stateprovider.Height, validatorName string, - opts ...Opt, ) (*StateManager, error) { historyCache := challengecache.New(cacheBaseDir) sm := &StateManager{ @@ -71,13 +82,10 @@ func NewStateManager( challengeLeafHeights: challengeLeafHeights, validatorName: validatorName, } - for _, o := range opts { - o(sm) - } return sm, nil } -// ExecutionStateMsgCount If the state manager locally has this validated execution state. +// AgreesWithExecutionState If the state manager locally has this validated execution state. // Returns ErrNoExecutionState if not found, or ErrChainCatchingUp if not yet // validated / syncing. func (s *StateManager) AgreesWithExecutionState(ctx context.Context, state *protocol.ExecutionState) error { @@ -133,6 +141,9 @@ func (s *StateManager) ExecutionStateAfterBatchCount(ctx context.Context, batchC batchIndex := batchCount - 1 messageCount, err := s.validator.inboxTracker.GetBatchMessageCount(batchIndex) if err != nil { + if strings.Contains(err.Error(), "not found") { + return nil, fmt.Errorf("%w: batch count %d", l2stateprovider.ErrChainCatchingUp, batchCount) + } return nil, err } globalState, err := s.findGlobalStateFromMessageCountAndBatch(messageCount, l2stateprovider.Batch(batchIndex)) @@ -158,76 +169,88 @@ func (s *StateManager) StatesInBatchRange( fromBatch, toBatch l2stateprovider.Batch, ) ([]common.Hash, []validator.GoGlobalState, error) { - // Check integrity of the arguments. - if fromBatch > toBatch { - return nil, nil, fmt.Errorf("from batch %v is greater than to batch %v", fromBatch, toBatch) + // Check the integrity of the arguments. + if fromBatch >= toBatch { + return nil, nil, fmt.Errorf("from batch %v cannot be greater than or equal to batch %v", fromBatch, toBatch) } if fromHeight > toHeight { - return nil, nil, fmt.Errorf("from height %v is greater than to height %v", fromHeight, toHeight) + return nil, nil, fmt.Errorf("from height %v cannot be greater than to height %v", fromHeight, toHeight) } + // Compute the total desired hashes from this request. + totalDesiredHashes := (toHeight - fromHeight) + 1 - // The last message's batch count. + // Get the fromBatch's message count. prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) if err != nil { return nil, nil, err } - gs, err := s.findGlobalStateFromMessageCountAndBatch(prevBatchMsgCount, fromBatch-1) + executionResult, err := s.validator.streamer.ResultAtCount(prevBatchMsgCount) if err != nil { return nil, nil, err } - if gs.PosInBatch == 0 { - return nil, nil, errors.New("final state of batch cannot be at position zero") - } - // The start state root of our history commitment starts at `batch: fromBatch, pos: 0` using the state - // from the last batch. - gs.Batch += 1 - gs.PosInBatch = 0 - stateRoots := []common.Hash{ - crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), - } - globalStates := []validator.GoGlobalState{gs} - - // Check if there are enough messages in the range to satisfy our request. - totalDesiredHashes := (toHeight - fromHeight) + 1 - - // We can return early if all we want is one hash. - if totalDesiredHashes == 1 && fromHeight == 0 && toHeight == 0 { - return stateRoots, globalStates, nil + startState := validator.GoGlobalState{ + BlockHash: executionResult.BlockHash, + SendRoot: executionResult.SendRoot, + Batch: uint64(fromBatch), + PosInBatch: 0, } + machineHashes := []common.Hash{machineHash(startState)} + states := []validator.GoGlobalState{startState} for batch := fromBatch; batch < toBatch; batch++ { - msgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batch)) + batchMessageCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batch)) if err != nil { return nil, nil, err } - var lastGlobalState validator.GoGlobalState + messagesInBatch := batchMessageCount - prevBatchMsgCount - msgsInBatch := msgCount - prevBatchMsgCount - for i := uint64(1); i <= uint64(msgsInBatch); i++ { + // Obtain the states for each message in the batch. + for i := uint64(0); i < uint64(messagesInBatch); i++ { msgIndex := uint64(prevBatchMsgCount) + i - gs, err := s.findGlobalStateFromMessageCountAndBatch(arbutil.MessageIndex(msgIndex), batch) + messageCount := msgIndex + 1 + executionResult, err := s.validator.streamer.ResultAtCount(arbutil.MessageIndex(messageCount)) if err != nil { return nil, nil, err } - globalStates = append(globalStates, gs) - stateRoots = append(stateRoots, - crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()), - ) - lastGlobalState = gs + // If the position in batch is equal to the number of messages in the batch, + // we do not include this state, instead, we break and include the state + // that fully consumes the batch. + if i+1 == uint64(messagesInBatch) { + break + } + state := validator.GoGlobalState{ + BlockHash: executionResult.BlockHash, + SendRoot: executionResult.SendRoot, + Batch: uint64(batch), + PosInBatch: i + 1, + } + states = append(states, state) + machineHashes = append(machineHashes, machineHash(state)) } - prevBatchMsgCount = msgCount - lastGlobalState.Batch += 1 - lastGlobalState.PosInBatch = 0 - stateRoots = append(stateRoots, - crypto.Keccak256Hash([]byte("Machine finished:"), lastGlobalState.Hash().Bytes()), - ) - globalStates = append(globalStates, lastGlobalState) - } - for uint64(len(stateRoots)) < uint64(totalDesiredHashes) { - stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) + // Fully consume the batch. + executionResult, err := s.validator.streamer.ResultAtCount(batchMessageCount) + if err != nil { + return nil, nil, err + } + state := validator.GoGlobalState{ + BlockHash: executionResult.BlockHash, + SendRoot: executionResult.SendRoot, + Batch: uint64(batch) + 1, + PosInBatch: 0, + } + states = append(states, state) + machineHashes = append(machineHashes, machineHash(state)) + prevBatchMsgCount = batchMessageCount } - return stateRoots[fromHeight : toHeight+1], globalStates[fromHeight : toHeight+1], nil + for uint64(len(machineHashes)) < uint64(totalDesiredHashes) { + machineHashes = append(machineHashes, machineHashes[len(machineHashes)-1]) + } + return machineHashes[fromHeight : toHeight+1], states, nil +} + +func machineHash(gs validator.GoGlobalState) common.Hash { + return crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) } func (s *StateManager) findGlobalStateFromMessageCountAndBatch(count arbutil.MessageIndex, batchIndex l2stateprovider.Batch) (validator.GoGlobalState, error) { @@ -284,9 +307,14 @@ func (s *StateManager) CollectMachineHashes( ) ([]common.Hash, error) { s.Lock() defer s.Unlock() + prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(cfg.FromBatch - 1)) + if err != nil { + return nil, fmt.Errorf("could not get batch message count at %d: %w", cfg.FromBatch, err) + } + messageNum := prevBatchMsgCount + arbutil.MessageIndex(cfg.BlockChallengeHeight) cacheKey := &challengecache.Key{ WavmModuleRoot: cfg.WasmModuleRoot, - MessageHeight: protocol.Height(cfg.MessageNumber), + MessageHeight: protocol.Height(messageNum), StepHeights: cfg.StepHeights, } if s.historyCache != nil { @@ -298,7 +326,7 @@ func (s *StateManager) CollectMachineHashes( return nil, err } } - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(cfg.MessageNumber)) + entry, err := s.validator.CreateReadyValidationEntry(ctx, messageNum) if err != nil { return nil, err } @@ -330,10 +358,16 @@ func (s *StateManager) CollectMachineHashes( func (s *StateManager) CollectProof( ctx context.Context, wasmModuleRoot common.Hash, - messageNumber l2stateprovider.Height, + fromBatch l2stateprovider.Batch, + blockChallengeHeight l2stateprovider.Height, machineIndex l2stateprovider.OpcodeIndex, ) ([]byte, error) { - entry, err := s.validator.CreateReadyValidationEntry(ctx, arbutil.MessageIndex(messageNumber)) + prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) + if err != nil { + return nil, err + } + messageNum := prevBatchMsgCount + arbutil.MessageIndex(blockChallengeHeight) + entry, err := s.validator.CreateReadyValidationEntry(ctx, messageNum) if err != nil { return nil, err } diff --git a/system_tests/assertion_on_large_number_of_batch_test.go b/system_tests/assertion_on_large_number_of_batch_test.go index 1b127333e4..b93837704b 100644 --- a/system_tests/assertion_on_large_number_of_batch_test.go +++ b/system_tests/assertion_on_large_number_of_batch_test.go @@ -68,7 +68,7 @@ func TestAssertionOnLargeNumberOfBatch(t *testing.T) { manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) Require(t, err) - poster := assertions.NewPoster( + poster := assertions.NewManager( assertionChain, manager, "test", diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 5d32380b8a..8907c280a4 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -183,7 +183,7 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) - poster, err := assertions.NewPoster( + poster, err := assertions.NewManager( assertionChain, stateManager, "good", @@ -211,7 +211,7 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) - posterB, err := assertions.NewPoster( + posterB, err := assertions.NewManager( chainB, stateManagerB, "evil", diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index 2018ef7baa..0246bbad08 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -112,7 +112,7 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes for uint64(len(stateRoots)) < numDesiredLeaves { stateRoots = append(stateRoots, stateRoots[len(stateRoots)-1]) } - return stateRoots, nil + return stateRoots[:numDesiredLeaves], nil }) } From 8b72013cd53fc41489e06ab7fd54e0cffe3b03e7 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 19:17:48 +0530 Subject: [PATCH 101/126] minor fix --- system_tests/manager_test.go | 115 ----------------------------------- 1 file changed, 115 deletions(-) delete mode 100644 system_tests/manager_test.go diff --git a/system_tests/manager_test.go b/system_tests/manager_test.go deleted file mode 100644 index 5703fba7cc..0000000000 --- a/system_tests/manager_test.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2023, Offchain Labs, Inc. -// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE -package arbtest - -import ( - "context" - "math/big" - "reflect" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - - "github.com/offchainlabs/nitro/arbnode" - "github.com/offchainlabs/nitro/arbos/l2pricing" - "github.com/offchainlabs/nitro/staker" - "github.com/offchainlabs/nitro/util" - "github.com/offchainlabs/nitro/util/testhelpers" - "github.com/offchainlabs/nitro/validator/valnode" - - protocol "github.com/OffchainLabs/bold/chain-abstraction" -) - -func TestExecutionStateMsgCount(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - res, err := l2node.TxStreamer.ResultAtCount(1) - Require(t, err) - msgCount, err := manager.ExecutionStateMsgCount(ctx, &protocol.ExecutionState{GlobalState: protocol.GoGlobalState{Batch: 1, BlockHash: res.BlockHash}}) - Require(t, err) - if msgCount != 1 { - Fail(t, "Unexpected msg batch", msgCount, "(expected 1)") - } -} - -func TestExecutionStateAtMessageNumber(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - l2node, l1stack, manager := setupManger(t, ctx) - defer requireClose(t, l1stack) - defer l2node.StopAndWait() - res, err := l2node.TxStreamer.ResultAtCount(1) - Require(t, err) - expectedState := &protocol.ExecutionState{ - GlobalState: protocol.GoGlobalState{ - Batch: 1, - BlockHash: res.BlockHash, - }, - MachineStatus: protocol.MachineStatusFinished, - } - executionState, err := manager.ExecutionStateAtMessageNumber(ctx, 1) - Require(t, err) - if !reflect.DeepEqual(executionState, expectedState) { - Fail(t, "Unexpected executionState", executionState, "(expected ", expectedState, ")") - } - Require(t, err) -} - -func setupManger(t *testing.T, ctx context.Context) (*arbnode.Node, *node.Node, *staker.StateManager) { - var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs - l2chainConfig := params.ArbitrumDevTestChainConfig() - l2info := NewBlockChainTestInfo( - t, - types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), - transferGas, - ) - _, l2node, l2client, _, l1info, _, l1client, l1stack := createTestNodeOnL1WithConfigImpl(t, ctx, true, nil, nil, l2chainConfig, nil, l2info) - BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) - l2info.GenerateAccount("BackgroundUser") - balance := big.NewInt(params.Ether) - balance.Mul(balance, big.NewInt(100)) - tx := l2info.PrepareTx("Faucet", "BackgroundUser", l2info.TransferGas, balance, nil) - err := l2client.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2client, tx) - Require(t, err) - - for i := uint64(0); i < 10; i++ { - l2info.Accounts["BackgroundUser"].Nonce = i - tx = l2info.PrepareTx("BackgroundUser", "BackgroundUser", l2info.TransferGas, common.Big0, nil) - err = l2client.SendTransaction(ctx, tx) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l2client, tx) - Require(t, err) - } - - _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) - blockValidatorConfig := staker.TestBlockValidatorConfig - stateless, err := staker.NewStatelessBlockValidator( - l2node.InboxReader, - l2node.InboxTracker, - l2node.TxStreamer, - l2node.Execution, - l2node.ArbDB, - nil, - StaticFetcherFrom(t, &blockValidatorConfig), - valStack, - ) - Require(t, err) - err = stateless.Start(ctx) - Require(t, err) - manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) - Require(t, err) - return l2node, l1stack, manager -} - -func Fail(t *testing.T, printables ...interface{}) { - t.Helper() - testhelpers.FailImpl(t, printables...) -} From fad6d7fd7bcfc9066ec36cbcef839d0d0acfd7bf Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 19:19:41 +0530 Subject: [PATCH 102/126] Minor fix --- staker/staker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staker/staker.go b/staker/staker.go index 522b08088a..e050ed3c8a 100644 --- a/staker/staker.go +++ b/staker/staker.go @@ -535,12 +535,12 @@ func (s *Staker) checkAndSwitchToBoldStaker(ctx context.Context) (bool, error) { } _, err = userLogic.ExtraChallengeTimeBlocks(callOpts) if err != nil { - // Switch to Bold protocol since ExtraChallengeTimeBlocks does not exist in bold protocol . + // Switch to Bold protocol since ExtraChallengeTimeBlocks does not exist in bold protocol. auth, err := s.builder.Auth(ctx) if err != nil { return false, err } - boldManager, err := NewManager(ctx, rollupAddress, auth, *callOpts, s.client, s.statelessBlockValidator, "") + boldManager, err := NewManager(ctx, rollupAddress, auth, *callOpts, s.client, s.statelessBlockValidator, "", "") if err != nil { return false, err } From a237cf284e54ea460c8f554c31dea10724d09cf3 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 20:03:53 +0530 Subject: [PATCH 103/126] Use config --- staker/manager.go | 16 ++++++---- staker/staker.go | 12 +++---- staker/state_provider.go | 63 +++++++++++++++++++++++-------------- system_tests/staker_test.go | 2 +- 4 files changed, 56 insertions(+), 37 deletions(-) diff --git a/staker/manager.go b/staker/manager.go index 72731261d8..bef8a62882 100644 --- a/staker/manager.go +++ b/staker/manager.go @@ -7,7 +7,6 @@ import ( solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" challengemanager "github.com/OffchainLabs/bold/challenge-manager" - "github.com/OffchainLabs/bold/challenge-manager/types" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/solgen/go/challengeV2gen" "github.com/OffchainLabs/bold/solgen/go/rollupgen" @@ -25,8 +24,7 @@ func NewManager( callOpts bind.CallOpts, client arbutil.L1Interface, statelessBlockValidator *StatelessBlockValidator, - historyCacheBaseDir, - validatorName string, + config *BoldConfig, ) (*challengemanager.Manager, error) { chain, err := solimpl.NewAssertionChain( ctx, @@ -68,9 +66,9 @@ func NewManager( stateManager, err := NewStateManager( statelessBlockValidator, - historyCacheBaseDir, + config.MachineLeavesCachePath, challengeLeafHeights, - validatorName, + config.ValidatorName, ) if err != nil { return nil, err @@ -88,7 +86,13 @@ func NewManager( client, provider, rollupAddress, - challengemanager.WithMode(types.MakeMode), + challengemanager.WithName(config.ValidatorName), + challengemanager.WithMode(BoldModes[config.Mode]), + challengemanager.WithAssertionPostingInterval(config.AssertionPostingInterval), + challengemanager.WithAssertionScanningInterval(config.AssertionScanningInterval), + challengemanager.WithAssertionConfirmingInterval(config.AssertionConfirmingInterval), + challengemanager.WithEdgeTrackerWakeInterval(config.EdgeTrackerWakeInterval), + challengemanager.WithAddress(txOpts.From), ) if err != nil { return nil, err diff --git a/staker/staker.go b/staker/staker.go index e050ed3c8a..2d831f0186 100644 --- a/staker/staker.go +++ b/staker/staker.go @@ -75,7 +75,7 @@ func L1PostingStrategyAddOptions(prefix string, f *flag.FlagSet) { type L1ValidatorConfig struct { Enable bool `koanf:"enable"` - EnableBold bool `koanf:"enable-bold"` + Bold BoldConfig `koanf:"bold"` Strategy string `koanf:"strategy"` StakerInterval time.Duration `koanf:"staker-interval"` MakeAssertionInterval time.Duration `koanf:"make-assertion-interval"` @@ -143,7 +143,7 @@ func (c *L1ValidatorConfig) Validate() error { var DefaultL1ValidatorConfig = L1ValidatorConfig{ Enable: true, - EnableBold: false, + Bold: DefaultBoldConfig, Strategy: "Watchtower", StakerInterval: time.Minute, MakeAssertionInterval: time.Hour, @@ -194,7 +194,7 @@ var DefaultValidatorL1WalletConfig = genericconf.WalletConfig{ func L1ValidatorConfigAddOptions(prefix string, f *flag.FlagSet) { f.Bool(prefix+".enable", DefaultL1ValidatorConfig.Enable, "enable validator") - f.Bool(prefix+".enable-bold", DefaultL1ValidatorConfig.EnableBold, "enable switch check to bold validator") + BoldConfigAddOptions(prefix+".bold", f) f.String(prefix+".strategy", DefaultL1ValidatorConfig.Strategy, "L1 validator strategy, either watchtower, defensive, stakeLatest, or makeNodes") f.Duration(prefix+".staker-interval", DefaultL1ValidatorConfig.StakerInterval, "how often the L1 validator should check the status of the L1 rollup and maybe take action with its stake") f.Duration(prefix+".make-assertion-interval", DefaultL1ValidatorConfig.MakeAssertionInterval, "if configured with the makeNodes strategy, how often to create new assertions (bypassed in case of a dispute)") @@ -310,7 +310,7 @@ func NewStaker( stakedNotifiers = append(stakedNotifiers, blockValidator) } var bridge *bridgegen.IBridge - if config.EnableBold { + if config.Bold.Enable { bridge, err = bridgegen.NewIBridge(bridgeAddress, client) if err != nil { return nil, err @@ -523,7 +523,7 @@ func (s *Staker) Start(ctxIn context.Context) { func (s *Staker) checkAndSwitchToBoldStaker(ctx context.Context) (bool, error) { switchedToBoldProtocol := false - if s.config.EnableBold { + if s.config.Bold.Enable { callOpts := s.getCallOpts(ctx) rollupAddress, err := s.bridge.Rollup(callOpts) if err != nil { @@ -540,7 +540,7 @@ func (s *Staker) checkAndSwitchToBoldStaker(ctx context.Context) (bool, error) { if err != nil { return false, err } - boldManager, err := NewManager(ctx, rollupAddress, auth, *callOpts, s.client, s.statelessBlockValidator, "", "") + boldManager, err := NewManager(ctx, rollupAddress, auth, *callOpts, s.client, s.statelessBlockValidator, &s.config.Bold) if err != nil { return false, err } diff --git a/staker/state_provider.go b/staker/state_provider.go index 48c78c6c7e..c4fe00feb1 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -8,13 +8,18 @@ import ( "fmt" "strings" "sync" + "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + flag "github.com/spf13/pflag" + protocol "github.com/OffchainLabs/bold/chain-abstraction" + "github.com/OffchainLabs/bold/challenge-manager/types" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/offchainlabs/nitro/arbutil" challengecache "github.com/offchainlabs/nitro/staker/challenge-cache" "github.com/offchainlabs/nitro/validator" @@ -32,33 +37,43 @@ var ( ) type BoldConfig struct { - Enable bool `koanf:"enable"` - Mode string `koanf:"mode"` - BlockChallengeLeafHeight uint64 `koanf:"block-challenge-leaf-height"` - BigStepLeafHeight uint64 `koanf:"big-step-leaf-height"` - SmallStepLeafHeight uint64 `koanf:"small-step-leaf-height"` - NumBigSteps uint64 `koanf:"num-big-steps"` - ValidatorName string `koanf:"validator-name"` - MachineLeavesCachePath string `koanf:"machine-leaves-cache-path"` - AssertionPostingIntervalSeconds uint64 `koanf:"assertion-posting-interval-seconds"` - AssertionScanningIntervalSeconds uint64 `koanf:"assertion-scanning-interval-seconds"` - AssertionConfirmingIntervalSeconds uint64 `koanf:"assertion-confirming-interval-seconds"` - EdgeTrackerWakeIntervalSeconds uint64 `koanf:"edge-tracker-wake-interval-seconds"` + Enable bool `koanf:"enable"` + Mode string `koanf:"mode"` + ValidatorName string `koanf:"validator-name"` + MachineLeavesCachePath string `koanf:"machine-leaves-cache-path"` + AssertionPostingInterval time.Duration `koanf:"assertion-posting-interval"` + AssertionScanningInterval time.Duration `koanf:"assertion-scanning-interval"` + AssertionConfirmingInterval time.Duration `koanf:"assertion-confirming-interval"` + EdgeTrackerWakeInterval time.Duration `koanf:"edge-tracker-wake-interval"` } var DefaultBoldConfig = BoldConfig{ - Enable: false, - Mode: "make-mode", - BlockChallengeLeafHeight: 1 << 5, - BigStepLeafHeight: 1 << 5, - SmallStepLeafHeight: 1 << 7, - NumBigSteps: 5, - ValidatorName: "default-validator", - MachineLeavesCachePath: "/tmp/machine-leaves-cache", - AssertionPostingIntervalSeconds: 30, - AssertionScanningIntervalSeconds: 30, - AssertionConfirmingIntervalSeconds: 60, - EdgeTrackerWakeIntervalSeconds: 1, + Enable: false, + Mode: "make-mode", + ValidatorName: "default-validator", + MachineLeavesCachePath: "/tmp/machine-leaves-cache", + AssertionPostingInterval: 30 * time.Second, + AssertionScanningInterval: 30 * time.Second, + AssertionConfirmingInterval: 60 * time.Second, + EdgeTrackerWakeInterval: 1 * time.Second, +} + +var BoldModes = map[string]types.Mode{ + "watch-tower-mode": types.WatchTowerMode, + "resolve-mode": types.ResolveMode, + "defensive-mode": types.DefensiveMode, + "make-mode": types.MakeMode, +} + +func BoldConfigAddOptions(prefix string, f *flag.FlagSet) { + f.Bool(prefix+".enable", DefaultBoldConfig.Enable, "enable bold protocol") + f.String(prefix+".mode", DefaultBoldConfig.Mode, "mode for bold protocol") + f.String(prefix+".validator-name", DefaultBoldConfig.ValidatorName, "name of validator") + f.String(prefix+".machine-leaves-cache-path", DefaultBoldConfig.MachineLeavesCachePath, "path to machine leaves cache") + f.Duration(prefix+".assertion-posting-interval", DefaultBoldConfig.AssertionPostingInterval, "interval for posting assertions") + f.Duration(prefix+".assertion-scanning-interval", DefaultBoldConfig.AssertionScanningInterval, "interval for scanning assertions") + f.Duration(prefix+".assertion-confirming-interval", DefaultBoldConfig.AssertionConfirmingInterval, "interval for confirming assertions") + f.Duration(prefix+".edge-tracker-wake-interval", DefaultBoldConfig.EdgeTrackerWakeInterval, "interval for waking edge tracker") } type StateManager struct { diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index b30d804411..9d56eac356 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -506,7 +506,7 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, info Require(t, err) valConfig := staker.DefaultL1ValidatorConfig valConfig.Strategy = "WatchTower" - valConfig.EnableBold = true + valConfig.Bold = staker.DefaultBoldConfig valConfig.StakerInterval = 100 * time.Millisecond dp, err := arbnode.StakerDataposter(ctx, rawdb.NewTable(l2node.ArbDB, storage.StakerPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) From d9c661b9690bfa289ddb692a28bf493a9194f344 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 15 Nov 2023 20:58:54 +0530 Subject: [PATCH 104/126] Bold Deploy --- Dockerfile | 1 + Makefile | 5 +- cmd/bold-deploy/main.go | 274 ++++++++++++++++++++++++++++++++++++ cmd/chaininfo/chain_info.go | 1 + 4 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 cmd/bold-deploy/main.go diff --git a/Dockerfile b/Dockerfile index 08eecc68b2..1fe341ae0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -252,6 +252,7 @@ USER root RUN rm -f /home/user/target/machines/latest COPY --from=prover-export /bin/jit /usr/local/bin/ COPY --from=node-builder /workspace/target/bin/deploy /usr/local/bin/ +COPY --from=node-builder /workspace/target/bin/bold-deploy /usr/local/bin/ COPY --from=node-builder /workspace/target/bin/seq-coordinator-invalidate /usr/local/bin/ COPY --from=module-root-calc /workspace/target/machines/latest/machine.wavm.br /home/user/target/machines/latest/ COPY --from=module-root-calc /workspace/target/machines/latest/until-host-io-state.bin /home/user/target/machines/latest/ diff --git a/Makefile b/Makefile index 4221100961..0f696462b3 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ push: lint test-go .make/fmt all: build build-replay-env test-gen-proofs @touch .make/all -build: $(patsubst %,$(output_root)/bin/%, nitro deploy relay daserver datool seq-coordinator-invalidate nitro-val seq-coordinator-manager) +build: $(patsubst %,$(output_root)/bin/%, nitro deploy bold-deploy relay daserver datool seq-coordinator-invalidate nitro-val seq-coordinator-manager) @printf $(done) build-node-deps: $(go_source) build-prover-header build-prover-lib build-jit .make/solgen .make/cbrotli-lib @@ -170,6 +170,9 @@ $(output_root)/bin/nitro: $(DEP_PREDICATE) build-node-deps $(output_root)/bin/deploy: $(DEP_PREDICATE) build-node-deps go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/deploy" +$(output_root)/bin/bold-deploy: $(DEP_PREDICATE) build-node-deps + go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/bold-deploy" + $(output_root)/bin/relay: $(DEP_PREDICATE) build-node-deps go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/relay" diff --git a/cmd/bold-deploy/main.go b/cmd/bold-deploy/main.go new file mode 100644 index 0000000000..efc2781213 --- /dev/null +++ b/cmd/bold-deploy/main.go @@ -0,0 +1,274 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/nitro/blob/master/LICENSE + +package main + +import ( + "context" + "encoding/json" + "flag" + "fmt" + "math/big" + "os" + "time" + + protocol "github.com/OffchainLabs/bold/chain-abstraction" + retry "github.com/OffchainLabs/bold/runtime" + "github.com/OffchainLabs/bold/solgen/go/mocksgen" + rollupgen "github.com/OffchainLabs/bold/solgen/go/rollupgen" + challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing/setup" + + "github.com/offchainlabs/nitro/cmd/chaininfo" + "github.com/offchainlabs/nitro/cmd/genericconf" + "github.com/offchainlabs/nitro/solgen/go/precompilesgen" + "github.com/offchainlabs/nitro/util/headerreader" + "github.com/offchainlabs/nitro/validator/server_common" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/offchainlabs/nitro/cmd/util" +) + +func main() { + glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false))) + glogger.Verbosity(log.LvlDebug) + log.Root().SetHandler(glogger) + log.Info("deploying rollup") + + ctx := context.Background() + + l1conn := flag.String("l1conn", "", "l1 connection") + l1keystore := flag.String("l1keystore", "", "l1 private key store") + l1privatekey := flag.String("l1privatekey", "", "l1 private key") + deployAccount := flag.String("l1DeployAccount", "", "l1 seq account to use (default is first account in keystore)") + ownerAddressString := flag.String("ownerAddress", "", "the rollup owner's address") + sequencerAddressString := flag.String("sequencerAddress", "", "the sequencer's address") + loserEscrowAddressString := flag.String("loserEscrowAddress", "", "the address which half of challenge loser's funds accumulate at") + wasmmoduleroot := flag.String("wasmmoduleroot", "", "WASM module root hash") + wasmrootpath := flag.String("wasmrootpath", "", "path to machine folders") + l1passphrase := flag.String("l1passphrase", "passphrase", "l1 private key file passphrase") + outfile := flag.String("l1deployment", "deploy.json", "deployment output json file") + l1ChainIdUint := flag.Uint64("l1chainid", 1337, "L1 chain ID") + l2ChainConfig := flag.String("l2chainconfig", "l2_chain_config.json", "L2 chain config json file") + l2ChainName := flag.String("l2chainname", "", "L2 chain name (will be included in chain info output json file)") + l2ChainInfo := flag.String("l2chaininfo", "l2_chain_info.json", "L2 chain info output json file") + txTimeout := flag.Duration("txtimeout", 10*time.Minute, "Timeout when waiting for a transaction to be included in a block") + prod := flag.Bool("prod", false, "Whether to configure the rollup for production or testing") + + // Bold specific flags. + numBigSteps := flag.Uint("numBigSteps", 5, "Number of big steps in the rollup") + blockChallengeLeafHeight := flag.Uint64("blockChallengeLeafHeight", 1<<5, "block challenge edge leaf height") + bigStepLeafHeight := flag.Uint64("bigStepLeafHeight", 1<<5, "big step edge leaf height") + smallSteapLeafHeight := flag.Uint64("smallStepLeafHeight", 1<<7, "small step edge leaf height") + minimumAssertionPeriodBlocks := flag.Uint64("minimumAssertionPeriodBlocks", 1, "minimum number of blocks between assertions") + confirmPeriodBlocks := flag.Uint64("confirmPeriodBlocks", 175, "challenge period") + challengeGracePeriodBlocks := flag.Uint64("challengeGracePeriodBlocks", 3, "challenge grace period in which security council can take action") + miniStake := flag.Uint64("miniStake", 1, "mini-stake size") + baseStake := flag.Uint64("baseStake", 1, "base-stake size") + + flag.Parse() + l1ChainId := new(big.Int).SetUint64(*l1ChainIdUint) + + if *prod { + if *wasmmoduleroot == "" { + panic("must specify wasm module root when launching prod chain") + } + } + if *l2ChainName == "" { + panic("must specify l2 chain name") + } + + var l1TransactionOpts *bind.TransactOpts + var err error + if *l1privatekey != "" { + privKey, err := crypto.HexToECDSA(*l1privatekey) + if err != nil { + flag.Usage() + log.Error("error parsing l1 private key") + panic(err) + } + l1TransactionOpts, err = bind.NewKeyedTransactorWithChainID(privKey, l1ChainId) + if err != nil { + flag.Usage() + log.Error("error creating l1 tx opts") + panic(err) + } + } else { + wallet := genericconf.WalletConfig{ + Pathname: *l1keystore, + Account: *deployAccount, + Password: *l1passphrase, + PrivateKey: *l1privatekey, + } + l1TransactionOpts, _, err = util.OpenWallet("l1", &wallet, l1ChainId) + if err != nil { + flag.Usage() + log.Error("error reading keystore") + panic(err) + } + } + + l1client, err := ethclient.Dial(*l1conn) + if err != nil { + flag.Usage() + log.Error("error creating l1client") + panic(err) + } + + if !common.IsHexAddress(*sequencerAddressString) && len(*sequencerAddressString) > 0 { + panic("specified sequencer address is invalid") + } + if !common.IsHexAddress(*ownerAddressString) { + panic("please specify a valid rollup owner address") + } + if *prod && !common.IsHexAddress(*loserEscrowAddressString) { + panic("please specify a valid loser escrow address") + } + + sequencerAddress := common.HexToAddress(*sequencerAddressString) + ownerAddress := common.HexToAddress(*ownerAddressString) + loserEscrowAddress := common.HexToAddress(*loserEscrowAddressString) + if sequencerAddress != (common.Address{}) && ownerAddress != l1TransactionOpts.From { + panic("cannot specify sequencer address if owner is not deployer") + } + + var moduleRoot common.Hash + if *wasmmoduleroot == "" { + locator, err := server_common.NewMachineLocator(*wasmrootpath) + if err != nil { + panic(err) + } + moduleRoot = locator.LatestWasmModuleRoot() + } else { + moduleRoot = common.HexToHash(*wasmmoduleroot) + } + if moduleRoot == (common.Hash{}) { + panic("wasmModuleRoot not found") + } + + headerReaderConfig := headerreader.DefaultConfig + headerReaderConfig.TxTimeout = *txTimeout + + chainConfigJson, err := os.ReadFile(*l2ChainConfig) + if err != nil { + panic(fmt.Errorf("failed to read l2 chain config file: %w", err)) + } + var chainConfig params.ChainConfig + err = json.Unmarshal(chainConfigJson, &chainConfig) + if err != nil { + panic(fmt.Errorf("failed to deserialize chain config: %w", err)) + } + + arbSys, _ := precompilesgen.NewArbSys(types.ArbSysAddress, l1client) + l1Reader, err := headerreader.New(ctx, l1client, func() *headerreader.Config { return &headerReaderConfig }, arbSys) + if err != nil { + panic(fmt.Errorf("failed to create header reader: %w", err)) + } + l1Reader.Start(ctx) + defer l1Reader.StopAndWait() + + stakeToken, _, _, err := mocksgen.DeployTestWETH9( + l1TransactionOpts, + l1Reader.Client(), + "Weth", + "WETH", + ) + if err != nil { + panic(err) + } + genesisExecutionState := rollupgen.ExecutionState{ + GlobalState: rollupgen.GlobalState{}, + MachineStatus: 1, + } + genesisInboxCount := big.NewInt(0) + anyTrustFastConfirmer := common.Address{} + rollupConfig := challenge_testing.GenerateRollupConfig( + *prod, + moduleRoot, + l1TransactionOpts.From, + chainConfig.ChainID, + loserEscrowAddress, + new(big.Int).SetUint64(*miniStake), + stakeToken, + genesisExecutionState, + genesisInboxCount, + anyTrustFastConfirmer, + challenge_testing.WithLayerZeroHeights(&protocol.LayerZeroHeights{ + BlockChallengeHeight: *blockChallengeLeafHeight, + BigStepChallengeHeight: *bigStepLeafHeight, + SmallStepChallengeHeight: *smallSteapLeafHeight, + }), + challenge_testing.WithNumBigStepLevels(uint8(*numBigSteps)), + challenge_testing.WithConfirmPeriodBlocks(*confirmPeriodBlocks), + challenge_testing.WithChallengeGracePeriodBlocks(*challengeGracePeriodBlocks), + challenge_testing.WithChainConfig(string(chainConfigJson)), + challenge_testing.WithBaseStakeValue(new(big.Int).SetUint64(*baseStake)), + ) + deployedAddresses, err := setup.DeployFullRollupStack( + ctx, + l1Reader.Client(), + l1TransactionOpts, + l1TransactionOpts.From, + rollupConfig, + false, // do not use mock bridge. + false, // do not use a mock one step prover + ) + if err != nil { + flag.Usage() + log.Error("error deploying on l1") + panic(err) + } + rollup, err := rollupgen.NewRollupAdminLogicTransactor(deployedAddresses.Rollup, l1Reader.Client()) + if err != nil { + panic(err) + } + _, err = retry.UntilSucceeds[*types.Transaction](ctx, func() (*types.Transaction, error) { + return rollup.SetMinimumAssertionPeriod(l1TransactionOpts, big.NewInt(int64(*minimumAssertionPeriodBlocks))) // 1 Ethereum block between assertions + }) + if err != nil { + panic(err) + } + + // We then have the validator itself authorize the rollup and challenge manager + // contracts to spend its stake tokens. + deployData, err := json.Marshal(deployedAddresses) + if err != nil { + panic(err) + } + if err := os.WriteFile(*outfile, deployData, 0600); err != nil { + panic(err) + } + parentChainIsArbitrum := l1Reader.IsParentChainArbitrum() + chainsInfo := []chaininfo.ChainInfo{ + { + ChainName: *l2ChainName, + ParentChainId: l1ChainId.Uint64(), + ParentChainIsArbitrum: &parentChainIsArbitrum, + ChainConfig: &chainConfig, + RollupAddresses: &chaininfo.RollupAddresses{ + Bridge: deployedAddresses.Bridge, + Inbox: deployedAddresses.Inbox, + SequencerInbox: deployedAddresses.SequencerInbox, + Rollup: deployedAddresses.Rollup, + ValidatorUtils: deployedAddresses.ValidatorUtils, + ValidatorWalletCreator: deployedAddresses.ValidatorWalletCreator, + StakeToken: stakeToken, + DeployedAt: deployedAddresses.DeployedAt, + }, + }, + } + chainsInfoJson, err := json.Marshal(chainsInfo) + if err != nil { + panic(err) + } + fmt.Printf("%s\n", chainsInfoJson) + if err := os.WriteFile(*l2ChainInfo, chainsInfoJson, 0600); err != nil { + panic(err) + } +} diff --git a/cmd/chaininfo/chain_info.go b/cmd/chaininfo/chain_info.go index cc13321513..5cadf3ef8f 100644 --- a/cmd/chaininfo/chain_info.go +++ b/cmd/chaininfo/chain_info.go @@ -110,5 +110,6 @@ type RollupAddresses struct { UpgradeExecutor common.Address `json:"upgrade-executor"` ValidatorUtils common.Address `json:"validator-utils"` ValidatorWalletCreator common.Address `json:"validator-wallet-creator"` + StakeToken common.Address `json:"stake-token"` DeployedAt uint64 `json:"deployed-at"` } From 4c4dd3a110515d2e06e8337f01d2419a99062d27 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 28 Nov 2023 21:16:15 +0530 Subject: [PATCH 105/126] Add large assertions test --- bold | 2 +- contracts | 2 +- ...assertion_on_large_number_of_batch_test.go | 235 ----------- ...assertion_on_large_number_of_block_test.go | 389 ++++++++++++++++++ 4 files changed, 391 insertions(+), 237 deletions(-) delete mode 100644 system_tests/assertion_on_large_number_of_batch_test.go create mode 100644 system_tests/assertion_on_large_number_of_block_test.go diff --git a/bold b/bold index e4ffed5850..2c430ae53b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e4ffed58502b7428f8c0e902f25c19ccf28566b4 +Subproject commit 2c430ae53bcf512e1caa448d5840372c5689cae5 diff --git a/contracts b/contracts index 695750067b..e3c16b044a 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit 695750067b2b7658556bdf61ec8cf16132d83dd0 +Subproject commit e3c16b044ab9321ff9f1d6ff64e58c4ecd024a42 diff --git a/system_tests/assertion_on_large_number_of_batch_test.go b/system_tests/assertion_on_large_number_of_batch_test.go deleted file mode 100644 index b93837704b..0000000000 --- a/system_tests/assertion_on_large_number_of_batch_test.go +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2023, Offchain Labs, Inc. -// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE - -//go:build assertion_on_large_number_of_batch_test -// +build assertion_on_large_number_of_batch_test - -package arbtest - -import ( - "context" - "encoding/json" - "math" - "math/big" - "os" - "testing" - "time" - - "github.com/OffchainLabs/bold/assertions" - protocol "github.com/OffchainLabs/bold/chain-abstraction" - solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" - "github.com/OffchainLabs/bold/solgen/go/mocksgen" - "github.com/OffchainLabs/bold/solgen/go/rollupgen" - challenge_testing "github.com/OffchainLabs/bold/testing" - "github.com/OffchainLabs/bold/testing/setup" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - - "github.com/offchainlabs/nitro/arbnode" - "github.com/offchainlabs/nitro/cmd/chaininfo" - "github.com/offchainlabs/nitro/staker" - "github.com/offchainlabs/nitro/validator/server_common" - "github.com/offchainlabs/nitro/validator/valnode" -) - -var ( - blockChallengeLeafHeight = uint64(1 << 5) // 32 - bigStepChallengeLeafHeight = uint64(1 << 11) // 2048 - smallStepChallengeLeafHeight = uint64(1 << 20) // 1048576 -) - -// Helps in testing the feasibility of assertion after the protocol upgrade. -func TestAssertionOnLargeNumberOfBatch(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - l2node, assertionChain := setupAndPostBatches(t, ctx) - - _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) - blockValidatorConfig := staker.TestBlockValidatorConfig - stateless, err := staker.NewStatelessBlockValidator( - l2node.InboxReader, - l2node.InboxTracker, - l2node.TxStreamer, - l2node.Execution.Recorder, - l2node.ArbDB, - nil, - StaticFetcherFrom(t, &blockValidatorConfig), - valStack, - ) - Require(t, err) - err = stateless.Start(ctx) - Require(t, err) - - manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) - Require(t, err) - - poster := assertions.NewManager( - assertionChain, - manager, - "test", - time.Second, - ) - _, err = poster.PostAssertion(ctx) - Require(t, err) -} - -func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, protocol.Protocol) { - glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false))) - glogger.Verbosity(log.LvlInfo) - log.Root().SetHandler(glogger) - - initialBalance := new(big.Int).Lsh(big.NewInt(1), 200) - l1Info := NewL1TestInfo(t) - l1Info.GenerateGenesisAccount("deployer", initialBalance) - l1Info.GenerateGenesisAccount("asserter", initialBalance) - l1Info.GenerateGenesisAccount("sequencer", initialBalance) - l1Info.GenerateGenesisAccount("RollupOwner", initialBalance) - - chainConfig := params.ArbitrumDevTestChainConfig() - l1Info, l1Backend, _, _ := createTestL1BlockChain(t, l1Info) - conf := arbnode.ConfigDefaultL1Test() - conf.BlockValidator.Enable = false - conf.BatchPoster.Enable = false - conf.InboxReader.CheckDelay = time.Second - - var valStack *node.Node - _, valStack = createTestValidationNode(t, ctx, &valnode.TestValidationConfig) - configByValidationNode(t, conf, valStack) - - l1TransactionOpts := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) - stakeToken, tx, tokenBindings, err := mocksgen.DeployTestWETH9( - &l1TransactionOpts, - l1Backend, - "Weth", - "WETH", - ) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l1Backend, tx) - Require(t, err) - value, _ := new(big.Int).SetString("10000", 10) - l1TransactionOpts.Value = value - tx, err = tokenBindings.Deposit(&l1TransactionOpts) - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l1Backend, tx) - Require(t, err) - l1TransactionOpts.Value = nil - Require(t, err) - _, err = EnsureTxSucceeded(ctx, l1Backend, tx) - Require(t, err) - rollupAddresses, assertionChain := deployBoldContracts(t, ctx, l1Info, l1Backend, chainConfig.ChainID, stakeToken) - l1Info.SetContract("Bridge", rollupAddresses.Bridge) - l1Info.SetContract("SequencerInbox", rollupAddresses.SequencerInbox) - l1Info.SetContract("Inbox", rollupAddresses.Inbox) - initMessage := getInitMessage(ctx, t, l1Backend, rollupAddresses) - - sequencerTxOpts := l1Info.GetDefaultTransactOpts("sequencer", ctx) - - bridgeAddr, seqInbox, seqInboxAddr := setupSequencerInboxStub(ctx, t, l1Info, l1Backend, chainConfig) - - l2Info, l2Stack, l2ChainDb, l2ArbDb, l2Blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil, nil) - rollupAddresses.Bridge = bridgeAddr - rollupAddresses.SequencerInbox = seqInboxAddr - - fatalErrChan := make(chan error, 10) - l2Node, err := arbnode.CreateNode(ctx, l2Stack, l2ChainDb, l2ArbDb, NewFetcherFromConfig(conf), l2Blockchain, l1Backend, rollupAddresses, nil, nil, nil, fatalErrChan) - Require(t, err) - err = l2Node.Start(ctx) - Require(t, err) - - l2Info.GenerateAccount("Destination") - - rollup, err := rollupgen.NewRollupAdminLogic(l2Node.DeployInfo.Rollup, l1Backend) - Require(t, err) - deployAuth := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) - tx, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(1)) - Require(t, err) - - for i := 0; i <= int(math.Pow(2, 26)); i++ { - makeBatch(t, l2Node, l2Info, l1Backend, &sequencerTxOpts, seqInbox, seqInboxAddr, -1) - } - return l2Node, assertionChain -} - -func deployBoldContracts( - t *testing.T, - ctx context.Context, - l1info info, - backend *ethclient.Client, - chainId *big.Int, - stakeToken common.Address, -) (*chaininfo.RollupAddresses, *solimpl.AssertionChain) { - l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx) - locator, err := server_common.NewMachineLocator("") - Require(t, err) - - cfg := challenge_testing.GenerateRollupConfig( - false, - locator.LatestWasmModuleRoot(), - l1TransactionOpts.From, - chainId, - common.Address{}, - big.NewInt(1), - stakeToken, - challenge_testing.WithLevelZeroHeights(&challenge_testing.LevelZeroHeights{ - BlockChallengeHeight: blockChallengeLeafHeight, - BigStepChallengeHeight: bigStepChallengeLeafHeight, - SmallStepChallengeHeight: smallStepChallengeLeafHeight, - }), - ) - config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) - if err != nil { - return nil, nil - } - cfg.ChainConfig = string(config) - - addresses, err := setup.DeployFullRollupStack( - ctx, - backend, - &l1TransactionOpts, - l1info.GetAddress("sequencer"), - cfg, - false, - ) - Require(t, err) - - asserter := l1info.GetDefaultTransactOpts("asserter", ctx) - chain, err := solimpl.NewAssertionChain( - ctx, - addresses.Rollup, - &asserter, - backend, - ) - Require(t, err) - - chalManager, err := chain.SpecChallengeManager(ctx) - Require(t, err) - chalManagerAddr := chalManager.Address() - seed, _ := new(big.Int).SetString("1000", 10) - value, _ := new(big.Int).SetString("10000", 10) - tokenBindings, err := mocksgen.NewTestWETH9(stakeToken, backend) - Require(t, err) - tx, err := tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, asserter.From, seed) - Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) - tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, addresses.Rollup, value) - Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) - tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, chalManagerAddr, value) - Require(t, err) - EnsureTxSucceeded(ctx, backend, tx) - - return &chaininfo.RollupAddresses{ - Bridge: addresses.Bridge, - Inbox: addresses.Inbox, - SequencerInbox: addresses.SequencerInbox, - Rollup: addresses.Rollup, - ValidatorUtils: addresses.ValidatorUtils, - ValidatorWalletCreator: addresses.ValidatorWalletCreator, - DeployedAt: addresses.DeployedAt, - }, chain -} diff --git a/system_tests/assertion_on_large_number_of_block_test.go b/system_tests/assertion_on_large_number_of_block_test.go new file mode 100644 index 0000000000..ca8d043327 --- /dev/null +++ b/system_tests/assertion_on_large_number_of_block_test.go @@ -0,0 +1,389 @@ +// Copyright 2023, Offchain Labs, Inc. +// For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE + +//go:build assertion_on_large_number_of_batch_test +// +build assertion_on_large_number_of_batch_test + +package arbtest + +import ( + "context" + "encoding/json" + "math/big" + "os" + "testing" + "time" + + "github.com/OffchainLabs/bold/assertions" + protocol "github.com/OffchainLabs/bold/chain-abstraction" + solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + "github.com/OffchainLabs/bold/containers/option" + l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" + "github.com/OffchainLabs/bold/math" + "github.com/OffchainLabs/bold/solgen/go/mocksgen" + "github.com/OffchainLabs/bold/solgen/go/rollupgen" + challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing/setup" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + + "github.com/offchainlabs/nitro/arbcompress" + "github.com/offchainlabs/nitro/arbnode" + "github.com/offchainlabs/nitro/arbstate" + "github.com/offchainlabs/nitro/cmd/chaininfo" + "github.com/offchainlabs/nitro/execution/gethexec" + "github.com/offchainlabs/nitro/solgen/go/bridgegen" + "github.com/offchainlabs/nitro/staker" + "github.com/offchainlabs/nitro/validator/server_common" + "github.com/offchainlabs/nitro/validator/valnode" +) + +var ( + blockChallengeLeafHeight = uint64(1 << 26) // 32 + bigStepChallengeLeafHeight = uint64(1 << 11) // 2048 + smallStepChallengeLeafHeight = uint64(1 << 20) // 1048576 +) + +// Helps in testing the feasibility of assertion after the protocol upgrade. +func TestAssertionOnLargeNumberOfBlocks(t *testing.T) { + setupStartTime := time.Now().Unix() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + l2node, assertionChain := setupAndPostBatches(t, ctx) + + _, valStack := createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + blockValidatorConfig := staker.TestBlockValidatorConfig + stateless, err := staker.NewStatelessBlockValidator( + l2node.InboxReader, + l2node.InboxTracker, + l2node.TxStreamer, + l2node.Execution, + l2node.ArbDB, + nil, + StaticFetcherFrom(t, &blockValidatorConfig), + valStack, + ) + Require(t, err) + err = stateless.Start(ctx) + Require(t, err) + + challengeLeafHeights := []l2stateprovider.Height{ + l2stateprovider.Height(blockChallengeLeafHeight), + l2stateprovider.Height(bigStepChallengeLeafHeight), + l2stateprovider.Height(smallStepChallengeLeafHeight), + } + manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) + Require(t, err) + provider := l2stateprovider.NewHistoryCommitmentProvider( + manager, + manager, + manager, + challengeLeafHeights, + manager, + ) + poster := assertions.NewPoster( + assertionChain, + provider, + "test", + time.Second, + ) + assertion, err := poster.PostAssertion(ctx) + Require(t, err) + setupEndTime := time.Now().Unix() + print("Time taken for setup:") + print(setupEndTime - setupStartTime) + + assertion, err = poster.PostAssertion(ctx) + Require(t, err) + assertionPostingEndTime := time.Now().Unix() + print("Time taken to post assertion:") + print(assertionPostingEndTime - setupEndTime) + startHeight, endHeight, wasmModuleRoot, topLevelClaimEndBatchCount := testCalculatingBlockChallengeLevelZeroEdge(t, ctx, assertionChain, assertion, provider) + levelZeroEdgeEndTime := time.Now().Unix() + print("Time taken Calculating BlockChallenge LevelZeroEdge:") + print(levelZeroEdgeEndTime - assertionPostingEndTime) + testCalculatingBlockChallengeLevelZeroEdgeBisection(t, ctx, provider, startHeight, endHeight, wasmModuleRoot, topLevelClaimEndBatchCount) + bisectionOfLevelZeroEdgeEndTime := time.Now().Unix() + print("Time taken Calculating BlockChallenge LevelZeroEdge Bisection:") + print(bisectionOfLevelZeroEdgeEndTime - levelZeroEdgeEndTime) + +} +func testCalculatingBlockChallengeLevelZeroEdgeBisection( + t *testing.T, + ctx context.Context, + provider *l2stateprovider.HistoryCommitmentProvider, + startHeight uint64, + endHeight uint64, + wasmModuleRoot common.Hash, + topLevelClaimEndBatchCount uint64, +) { + bisectTo, err := math.Bisect(startHeight, endHeight) + Require(t, err) + _, err = provider.HistoryCommitment( + ctx, + &l2stateprovider.HistoryCommitmentRequest{ + WasmModuleRoot: wasmModuleRoot, + Batch: l2stateprovider.Batch(topLevelClaimEndBatchCount), + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(bisectTo)), + }, + ) + + Require(t, err) + _, err = provider.PrefixProof( + ctx, + &l2stateprovider.HistoryCommitmentRequest{ + WasmModuleRoot: wasmModuleRoot, + Batch: l2stateprovider.Batch(topLevelClaimEndBatchCount), + FromHeight: l2stateprovider.Height(bisectTo), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(endHeight)), + }, + l2stateprovider.Height(bisectTo), + ) + Require(t, err) +} + +func testCalculatingBlockChallengeLevelZeroEdge( + t *testing.T, + ctx context.Context, + assertionChain protocol.Protocol, + assertion protocol.Assertion, + provider *l2stateprovider.HistoryCommitmentProvider, +) (uint64, uint64, common.Hash, uint64) { + + creationInfo, err := assertionChain.ReadAssertionCreationInfo(ctx, assertion.Id()) + Require(t, err) + + startCommit, err := provider.HistoryCommitment( + ctx, + &l2stateprovider.HistoryCommitmentRequest{ + WasmModuleRoot: creationInfo.WasmModuleRoot, + Batch: l2stateprovider.Batch(0), + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(0)), + }, + ) + Require(t, err) + levelZeroBlockEdgeHeight := uint64(1 << 26) + Require(t, err) + + endCommit, err := provider.HistoryCommitment( + ctx, + &l2stateprovider.HistoryCommitmentRequest{ + WasmModuleRoot: creationInfo.WasmModuleRoot, + Batch: l2stateprovider.Batch(creationInfo.InboxMaxCount.Uint64()), + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(levelZeroBlockEdgeHeight)), + }, + ) + Require(t, err) + _, err = provider.PrefixProof( + ctx, + &l2stateprovider.HistoryCommitmentRequest{ + WasmModuleRoot: creationInfo.WasmModuleRoot, + Batch: l2stateprovider.Batch(creationInfo.InboxMaxCount.Uint64()), + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(levelZeroBlockEdgeHeight)), + }, + l2stateprovider.Height(0), + ) + Require(t, err) + return startCommit.Height, endCommit.Height, creationInfo.WasmModuleRoot, creationInfo.InboxMaxCount.Uint64() +} +func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, protocol.Protocol) { + glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false))) + glogger.Verbosity(log.LvlInfo) + log.Root().SetHandler(glogger) + + initialBalance := new(big.Int).Lsh(big.NewInt(1), 250) + l1Info := NewL1TestInfo(t) + l1Info.GenerateGenesisAccount("deployer", initialBalance) + l1Info.GenerateGenesisAccount("asserter", initialBalance) + l1Info.GenerateGenesisAccount("sequencer", initialBalance) + l1Info.GenerateGenesisAccount("RollupOwner", initialBalance) + + chainConfig := params.ArbitrumDevTestChainConfig() + l1Info, l1Backend, _, _ := createTestL1BlockChain(t, l1Info) + conf := arbnode.ConfigDefaultL1Test() + conf.BlockValidator.Enable = false + conf.BatchPoster.Enable = false + conf.InboxReader.CheckDelay = time.Second + + var valStack *node.Node + _, valStack = createTestValidationNode(t, ctx, &valnode.TestValidationConfig) + configByValidationNode(t, conf, valStack) + + l1TransactionOpts := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) + stakeToken, tx, tokenBindings, err := mocksgen.DeployTestWETH9( + &l1TransactionOpts, + l1Backend, + "Weth", + "WETH", + ) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + value, _ := new(big.Int).SetString("10000", 10) + l1TransactionOpts.Value = value + tx, err = tokenBindings.Deposit(&l1TransactionOpts) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + l1TransactionOpts.Value = nil + Require(t, err) + _, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + rollupAddresses, assertionChain := deployBoldContracts(t, ctx, l1Info, l1Backend, chainConfig.ChainID, stakeToken) + l1Info.SetContract("Bridge", rollupAddresses.Bridge) + l1Info.SetContract("SequencerInbox", rollupAddresses.SequencerInbox) + l1Info.SetContract("Inbox", rollupAddresses.Inbox) + initMessage := getInitMessage(ctx, t, l1Backend, rollupAddresses) + + l2Info, l2Stack, l2ChainDb, l2ArbDb, l2Blockchain := createL2BlockChainWithStackConfig(t, nil, "", chainConfig, initMessage, nil, nil) + + fatalErrChan := make(chan error, 10) + execConfigFetcher := func() *gethexec.Config { return gethexec.ConfigDefaultTest() } + execNode, err := gethexec.CreateExecutionNode(ctx, l2Stack, l2ChainDb, l2Blockchain, l1Backend, execConfigFetcher) + Require(t, err) + l2Node, err := arbnode.CreateNode(ctx, l2Stack, execNode, l2ArbDb, NewFetcherFromConfig(conf), l2Blockchain.Config(), l1Backend, rollupAddresses, nil, nil, nil, fatalErrChan) + Require(t, err) + err = l2Node.Start(ctx) + Require(t, err) + + l2Info.GenerateAccount("Destination") + + rollup, err := rollupgen.NewRollupAdminLogic(l2Node.DeployInfo.Rollup, l1Backend) + Require(t, err) + deployAuth := l1Info.GetDefaultTransactOpts("RollupOwner", ctx) + _, err = rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(0)) + Require(t, err) + + emptyArray, err := rlp.EncodeToBytes([]uint8{0}) + Require(t, err) + var out []byte + for i := 0; i < arbstate.MaxSegmentsPerSequencerMessage-1; i++ { + out = append(out, emptyArray...) + } + batch := []uint8{0} + compressed, err := arbcompress.CompressWell(out) + Require(t, err) + batch = append(batch, compressed...) + + txOpts := l1Info.GetDefaultTransactOpts("deployer", ctx) + simpleAddress, simple := deploySimple(t, ctx, txOpts, l1Backend) + seqInbox, err := bridgegen.NewSequencerInbox(rollupAddresses.SequencerInbox, l1Backend) + Require(t, err) + tx, err = seqInbox.SetIsBatchPoster(&deployAuth, simpleAddress, true) + Require(t, err) + receipt, err := EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + for i := 0; i < 3; i++ { + tx, err = simple.PostManyBatches(&txOpts, rollupAddresses.SequencerInbox, batch, big.NewInt(300)) + Require(t, err) + receipt, err = EnsureTxSucceeded(ctx, l1Backend, tx) + Require(t, err) + + nodeSeqInbox, err := arbnode.NewSequencerInbox(l1Backend, rollupAddresses.SequencerInbox, 0) + Require(t, err) + batches, err := nodeSeqInbox.LookupBatchesInRange(ctx, receipt.BlockNumber, receipt.BlockNumber) + Require(t, err) + if len(batches) != 300 { + Fatal(t, "300 batch not found after PostManyBatches") + } + err = l2Node.InboxTracker.AddSequencerBatches(ctx, l1Backend, batches) + Require(t, err) + _, err = l2Node.InboxTracker.GetBatchMetadata(0) + Require(t, err, "failed to get batch metadata after adding batch:") + } + return l2Node, assertionChain +} + +func deployBoldContracts( + t *testing.T, + ctx context.Context, + l1info info, + backend *ethclient.Client, + chainId *big.Int, + stakeToken common.Address, +) (*chaininfo.RollupAddresses, *solimpl.AssertionChain) { + l1TransactionOpts := l1info.GetDefaultTransactOpts("RollupOwner", ctx) + locator, err := server_common.NewMachineLocator("") + Require(t, err) + + cfg := challenge_testing.GenerateRollupConfig( + false, + locator.LatestWasmModuleRoot(), + l1TransactionOpts.From, + chainId, + common.Address{}, + big.NewInt(1), + stakeToken, + rollupgen.ExecutionState{ + GlobalState: rollupgen.GlobalState{}, + MachineStatus: 1, + }, + big.NewInt(0), + common.Address{}, + ) + config, err := json.Marshal(params.ArbitrumDevTestChainConfig()) + if err != nil { + return nil, nil + } + cfg.ChainConfig = string(config) + + addresses, err := setup.DeployFullRollupStack( + ctx, + backend, + &l1TransactionOpts, + l1info.GetAddress("sequencer"), + cfg, + false, + true, + ) + Require(t, err) + + asserter := l1info.GetDefaultTransactOpts("asserter", ctx) + chain, err := solimpl.NewAssertionChain( + ctx, + addresses.Rollup, + &asserter, + backend, + ) + Require(t, err) + + chalManager, err := chain.SpecChallengeManager(ctx) + Require(t, err) + chalManagerAddr := chalManager.Address() + seed, _ := new(big.Int).SetString("1000", 10) + value, _ := new(big.Int).SetString("10000", 10) + tokenBindings, err := mocksgen.NewTestWETH9(stakeToken, backend) + Require(t, err) + tx, err := tokenBindings.TestWETH9Transactor.Transfer(&l1TransactionOpts, asserter.From, seed) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, addresses.Rollup, value) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + tx, err = tokenBindings.TestWETH9Transactor.Approve(&asserter, chalManagerAddr, value) + Require(t, err) + _, err = EnsureTxSucceeded(ctx, backend, tx) + Require(t, err) + + return &chaininfo.RollupAddresses{ + Bridge: addresses.Bridge, + Inbox: addresses.Inbox, + SequencerInbox: addresses.SequencerInbox, + Rollup: addresses.Rollup, + ValidatorUtils: addresses.ValidatorUtils, + ValidatorWalletCreator: addresses.ValidatorWalletCreator, + DeployedAt: addresses.DeployedAt, + }, chain +} From 0b7480e234cf3a8c1735fd0beb8f413c8d3c256b Mon Sep 17 00:00:00 2001 From: amsanghi Date: Tue, 28 Nov 2023 21:21:08 +0530 Subject: [PATCH 106/126] minor fix --- util/headerreader/header_reader.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/headerreader/header_reader.go b/util/headerreader/header_reader.go index 94fb857abb..678c3099fa 100644 --- a/util/headerreader/header_reader.go +++ b/util/headerreader/header_reader.go @@ -331,8 +331,7 @@ func (s *HeaderReader) logIfHeaderIsOld() { } l1Timetamp := time.Unix(int64(storedHeader.Time), 0) headerTime := time.Since(l1Timetamp) - oldHeaderTimeout := time.Minute * 10 - if headerTime >= oldHeaderTimeout { + if headerTime >= s.config().OldHeaderTimeout { s.setError(fmt.Errorf("latest header is at least %v old", headerTime)) log.Error( "latest L1 block is old", "l1Block", storedHeader.Number, From 401b80fddf7db0bd7d5d2131fe6c89b3bbb387cc Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 29 Nov 2023 16:54:33 +0530 Subject: [PATCH 107/126] minor fix --- contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts b/contracts index e3c16b044a..3c01aa5dbc 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit e3c16b044ab9321ff9f1d6ff64e58c4ecd024a42 +Subproject commit 3c01aa5dbc47a91b0d85988224c4e7ecaf929fa6 From 3f0d737ac1c0ac4704d346d1424fbd8d7ccf40b2 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 29 Nov 2023 16:56:55 +0530 Subject: [PATCH 108/126] minor fix --- contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts b/contracts index 3c01aa5dbc..27d9d78bc1 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit 3c01aa5dbc47a91b0d85988224c4e7ecaf929fa6 +Subproject commit 27d9d78bc1b2cace774e9d845cbc5564c08958c3 From b580f2473adc984b0935c5f267798d8eaaa7a9e4 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 29 Nov 2023 21:12:21 +0530 Subject: [PATCH 109/126] minor fix --- system_tests/staker_test.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index 9d56eac356..0664fc6d5a 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -446,9 +446,8 @@ func TestStakersCooperative(t *testing.T) { func TestStakerSwitchDuringRollupUpgrade(t *testing.T) { ctx, cancelCtx := context.WithCancel(context.Background()) defer cancelCtx() - stakerImpl, l1info, l1client, l2chainConfig, l2node, deployAuth := setupNonBoldStaker(t, ctx) - defer l2node.StopAndWait() - + stakerImpl, builder := setupNonBoldStaker(t, ctx) + deployAuth := builder.L1Info.GetDefaultTransactOpts("RollupOwner", ctx) err := stakerImpl.Initialize(ctx) Require(t, err) stakerImpl.Start(ctx) @@ -456,13 +455,13 @@ func TestStakerSwitchDuringRollupUpgrade(t *testing.T) { t.Fatal("Old protocol staker not started") } - rollupAddresses := deployBoldContracts(t, ctx, l1info, l1client, l2chainConfig.ChainID, deployAuth) + rollupAddresses := deployBoldContracts(t, ctx, builder.L1Info, builder.L1.Client, builder.chainConfig.ChainID, deployAuth) - bridge, err := bridgegen.NewBridge(l2node.DeployInfo.Bridge, l1client) + bridge, err := bridgegen.NewBridge(builder.L2.ConsensusNode.DeployInfo.Bridge, builder.L1.Client) Require(t, err) tx, err := bridge.UpdateRollupAddress(&deployAuth, rollupAddresses.Rollup) Require(t, err) - _, err = EnsureTxSucceeded(ctx, l1client, tx) + _, err = EnsureTxSucceeded(ctx, builder.L1.Client, tx) Require(t, err) time.Sleep(time.Second) @@ -472,22 +471,21 @@ func TestStakerSwitchDuringRollupUpgrade(t *testing.T) { } } -func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, info, *ethclient.Client, *params.ChainConfig, *arbnode.Node, bind.TransactOpts) { +func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, *NodeBuilder) { var transferGas = util.NormalizeL2GasForL1GasInitial(800_000, params.GWei) // include room for aggregator L1 costs - l2chainConfig := params.ArbitrumDevTestChainConfig() - l2info := NewBlockChainTestInfo( + + builder := NewNodeBuilder(ctx).DefaultConfig(t, true) + builder.L2Info = NewBlockChainTestInfo( t, - types.NewArbitrumSigner(types.NewLondonSigner(l2chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), + types.NewArbitrumSigner(types.NewLondonSigner(builder.chainConfig.ChainID)), big.NewInt(l2pricing.InitialBaseFeeWei*2), transferGas, ) - builder := NewNodeBuilder(ctx).DefaultConfig(t, true) builder.Build(t) l2node := builder.L2.ConsensusNode - l2client := builder.L2.Client l1info := builder.L1Info l1client := builder.L1.Client - BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000)), l1info, l2info, l1client, l2client, ctx) + builder.BridgeBalance(t, "Faucet", big.NewInt(1).Mul(big.NewInt(params.Ether), big.NewInt(10000))) deployAuth := l1info.GetDefaultTransactOpts("RollupOwner", ctx) @@ -497,10 +495,16 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, info TransferBalance(t, "Faucet", "Validator", balance, l1info, l1client, ctx) l1auth := l1info.GetDefaultTransactOpts("Validator", ctx) - rollup, err := rollupgen.NewRollupAdminLogic(l2node.DeployInfo.Rollup, l1client) + upgradeExecutor, err := upgrade_executorgen.NewUpgradeExecutor(l2node.DeployInfo.UpgradeExecutor, builder.L1.Client) + Require(t, err) + rollupABI, err := abi.JSON(strings.NewReader(rollupgen.RollupAdminLogicABI)) Require(t, err) - tx, err := rollup.SetMinimumAssertionPeriod(&deployAuth, big.NewInt(1)) + setMinAssertPeriodCalldata, err := rollupABI.Pack("setMinimumAssertionPeriod", big.NewInt(1)) + Require(t, err) + tx, err := upgradeExecutor.ExecuteCall(&deployAuth, l2node.DeployInfo.Rollup, setMinAssertPeriodCalldata) + Require(t, err) + _, err = builder.L1.EnsureTxSucceeded(tx) Require(t, err) _, err = EnsureTxSucceeded(ctx, l1client, tx) Require(t, err) @@ -545,7 +549,7 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, info nil, ) Require(t, err) - return stakerImpl, l1info, l1client, l2chainConfig, l2node, deployAuth + return stakerImpl, builder } func deployBoldContracts( From f1adaf21fea0e611d07f0b9893dc4b3f0630285e Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 29 Nov 2023 21:49:59 +0530 Subject: [PATCH 110/126] minor fix --- staker/challenge-cache/cache.go | 6 +++++- system_tests/staker_test.go | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index df15a1a18b..871284f2d1 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -76,7 +76,11 @@ func isOlderThanFourteenDays(t time.Time) bool { func deleteFilesOlderThanFourteenDays(dir string) error { files, err := os.ReadDir(dir) if err != nil { - return err + if os.IsNotExist(err) { + return nil + } else { + return err + } } for _, file := range files { fileInfo, err := file.Info() diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index 0664fc6d5a..72141a1f2d 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -457,11 +457,16 @@ func TestStakerSwitchDuringRollupUpgrade(t *testing.T) { rollupAddresses := deployBoldContracts(t, ctx, builder.L1Info, builder.L1.Client, builder.chainConfig.ChainID, deployAuth) - bridge, err := bridgegen.NewBridge(builder.L2.ConsensusNode.DeployInfo.Bridge, builder.L1.Client) + upgradeExecutor, err := upgrade_executorgen.NewUpgradeExecutor(builder.L2.ConsensusNode.DeployInfo.UpgradeExecutor, builder.L1.Client) Require(t, err) - tx, err := bridge.UpdateRollupAddress(&deployAuth, rollupAddresses.Rollup) + bridgeABI, err := abi.JSON(strings.NewReader(bridgegen.BridgeABI)) Require(t, err) - _, err = EnsureTxSucceeded(ctx, builder.L1.Client, tx) + + updateRollupAddressCalldata, err := bridgeABI.Pack("updateRollupAddress", rollupAddresses.Rollup) + Require(t, err) + tx, err := upgradeExecutor.ExecuteCall(&deployAuth, builder.L2.ConsensusNode.DeployInfo.Bridge, updateRollupAddressCalldata) + Require(t, err) + _, err = builder.L1.EnsureTxSucceeded(tx) Require(t, err) time.Sleep(time.Second) @@ -511,6 +516,7 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, *Nod valConfig := staker.DefaultL1ValidatorConfig valConfig.Strategy = "WatchTower" valConfig.Bold = staker.DefaultBoldConfig + valConfig.Bold.Enable = true valConfig.StakerInterval = 100 * time.Millisecond dp, err := arbnode.StakerDataposter(ctx, rawdb.NewTable(l2node.ArbDB, storage.StakerPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) From 7d48a5dbc2cbdb5bab3dd7d0fcdc6e700f3f2215 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 1 Dec 2023 19:53:38 +0530 Subject: [PATCH 111/126] fix build --- bold | 2 +- staker/state_provider.go | 10 ++- system_tests/bold_challenge_protocol_test.go | 69 ++++++++------------ 3 files changed, 35 insertions(+), 46 deletions(-) diff --git a/bold b/bold index e4ffed5850..92b8edcc1b 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e4ffed58502b7428f8c0e902f25c19ccf28566b4 +Subproject commit 92b8edcc1bdc2a0d23e0c7c52dd2327d7739dd69 diff --git a/staker/state_provider.go b/staker/state_provider.go index 93d0a0bf8e..e1b0081b73 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -196,7 +196,7 @@ func (s *StateManager) StatesInBatchRange( return nil, fmt.Errorf("from height %v cannot be greater than to height %v", fromHeight, toHeight) } // Compute the total desired hashes from this request. - totalDesiredHashes := (toHeight - fromHeight) + 1 + totalDesiredHashes := int(toHeight) + 1 // Get the fromBatch's message count. prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) @@ -250,6 +250,9 @@ func (s *StateManager) StatesInBatchRange( Batch: uint64(batch), PosInBatch: i + 1, } + if numStateRoots >= totalDesiredHashes { + break + } machineHashesMmap.Set(numStateRoots, machineHash(state)) numStateRoots++ } @@ -266,12 +269,15 @@ func (s *StateManager) StatesInBatchRange( Batch: uint64(batch) + 1, PosInBatch: 0, } + if numStateRoots >= totalDesiredHashes { + break + } machineHashesMmap.Set(numStateRoots, machineHash(state)) numStateRoots++ prevBatchMsgCount = batchMessageCount } lastMachineHashes := machineHashesMmap.Get(numStateRoots - 1) - for i := numStateRoots; i < int(totalDesiredHashes); i++ { + for i := numStateRoots; i < totalDesiredHashes; i++ { machineHashesMmap.Set(i, lastMachineHashes) } return machineHashesMmap.SubMmap(int(fromHeight), int(toHeight+1)), nil diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 8907c280a4..969903d0f3 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -16,7 +16,6 @@ import ( "testing" "time" - "github.com/OffchainLabs/bold/assertions" protocol "github.com/OffchainLabs/bold/chain-abstraction" solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" challengemanager "github.com/OffchainLabs/bold/challenge-manager" @@ -25,7 +24,7 @@ import ( "github.com/OffchainLabs/bold/solgen/go/bridgegen" "github.com/OffchainLabs/bold/solgen/go/mocksgen" "github.com/OffchainLabs/bold/solgen/go/rollupgen" - challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing" "github.com/OffchainLabs/bold/testing/setup" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -42,7 +41,6 @@ import ( "github.com/offchainlabs/nitro/arbos" "github.com/offchainlabs/nitro/arbos/l2pricing" "github.com/offchainlabs/nitro/arbstate" - "github.com/offchainlabs/nitro/arbutil" "github.com/offchainlabs/nitro/cmd/chaininfo" "github.com/offchainlabs/nitro/execution/gethexec" "github.com/offchainlabs/nitro/staker" @@ -59,7 +57,7 @@ import ( // 32 Mb of state roots in memory at once. var ( blockChallengeLeafHeight = uint64(1 << 5) // 32 - bigStepChallengeLeafHeight = uint64(1 << 5) // 5 big step levels, 2^5 each, with small step equalting to 2^31 total. + bigStepChallengeLeafHeight = uint64(1 << 5) // 5 big step levels, 2^5 each, with small step equaling to 2^31 total. smallStepChallengeLeafHeight = uint64(1 << 6) ) @@ -183,14 +181,6 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) - poster, err := assertions.NewManager( - assertionChain, - stateManager, - "good", - time.Hour, - ) - Require(t, err) - stateManagerB, err := staker.NewStateManager( statelessB, "/tmp/evil", @@ -211,14 +201,6 @@ func TestBoldProtocol(t *testing.T) { ) Require(t, err) - posterB, err := assertions.NewManager( - chainB, - stateManagerB, - "evil", - time.Hour, - ) - Require(t, err) - l2info.GenerateAccount("Destination") sequencerTxOpts := l1info.GetDefaultTransactOpts("Sequencer", ctx) @@ -283,7 +265,7 @@ func TestBoldProtocol(t *testing.T) { } } - // Wait for the vaidator to validate the batches. + // Wait for the validator to validate the batches. bridgeBinding, err := bridgegen.NewBridge(l1info.GetAddress("Bridge"), l1client) Require(t, err) totalBatchesBig, err := bridgeBinding.SequencerMessageCount(&bind.CallOpts{Context: ctx}) @@ -294,10 +276,10 @@ func TestBoldProtocol(t *testing.T) { // Wait until the validator has validated the batches. for { - _, err1 := l2nodeA.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)) + _, err1 := l2nodeA.TxStreamer.ResultAtCount(totalMessageCount) nodeAHasValidated := err1 == nil - _, err2 := l2nodeB.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)) + _, err2 := l2nodeB.TxStreamer.ResultAtCount(totalMessageCount) nodeBHasValidated := err2 == nil if nodeAHasValidated && nodeBHasValidated { @@ -305,18 +287,6 @@ func TestBoldProtocol(t *testing.T) { } } - t.Log("Honest party posting assertion at batch 1, pos 0") - _, err = poster.PostAssertion(ctx) - Require(t, err) - - t.Log("Honest party posting assertion at batch 2, pos 0") - expectedWinnerAssertion, err := poster.PostAssertion(ctx) - Require(t, err) - - t.Log("Evil party posting assertion at batch 2, pos 0") - _, err = posterB.PostAssertion(ctx) - Require(t, err) - provider := l2stateprovider.NewHistoryCommitmentProvider( stateManager, stateManager, @@ -362,7 +332,17 @@ func TestBoldProtocol(t *testing.T) { challengemanager.WithEdgeTrackerWakeInterval(time.Second), ) Require(t, err) - manager.Start(ctx) + + t.Log("Honest party posting assertion at batch 1, pos 0") + + poster := manager.AssertionManager() + _, err = poster.PostAssertion(ctx) + Require(t, err) + + t.Log("Honest party posting assertion at batch 2, pos 0") + expectedWinnerAssertion, err := poster.PostAssertion(ctx) + Require(t, err) + managerB, err := challengemanager.New( ctx, chainB, @@ -376,6 +356,13 @@ func TestBoldProtocol(t *testing.T) { challengemanager.WithEdgeTrackerWakeInterval(time.Second), ) Require(t, err) + + t.Log("Evil party posting assertion at batch 2, pos 0") + posterB := managerB.AssertionManager() + _, err = posterB.PostAssertion(ctx) + Require(t, err) + + manager.Start(ctx) managerB.Start(ctx) rollupUserLogic, err := rollupgen.NewRollupUserLogic(assertionChain.RollupAddress(), l1client) @@ -519,7 +506,6 @@ func deployContractsOnly( Require(t, err) wasmModuleRoot := locator.LatestWasmModuleRoot() - prod := false loserStakeEscrow := common.Address{} miniStake := big.NewInt(1) genesisExecutionState := rollupgen.ExecutionState{ @@ -529,7 +515,7 @@ func deployContractsOnly( genesisInboxCount := big.NewInt(0) anyTrustFastConfirmer := common.Address{} cfg := challenge_testing.GenerateRollupConfig( - prod, + false, wasmModuleRoot, l1TransactionOpts.From, chainId, @@ -633,10 +619,7 @@ func create2ndNodeWithConfigForBoldProtocol( stakeTokenAddr common.Address, ) (*ethclient.Client, *arbnode.Node, *solimpl.AssertionChain) { fatalErrChan := make(chan error, 10) - l1rpcClient, err := l1stack.Attach() - if err != nil { - Fatal(t, err) - } + l1rpcClient := l1stack.Attach() l1client := ethclient.NewClient(l1rpcClient) firstExec, ok := first.Execution.(*gethexec.ExecutionNode) if !ok { @@ -655,7 +638,7 @@ func create2ndNodeWithConfigForBoldProtocol( nodeConfig.ParentChainReader.OldHeaderTimeout = 10 * time.Minute nodeConfig.BatchPoster.DataPoster.MaxMempoolTransactions = 0 if stackConfig == nil { - stackConfig = stackConfigForTest(t) + stackConfig = createStackConfigForTest(t.TempDir()) } l2stack, err := node.New(stackConfig) Require(t, err) From a58ebeca2f1067c165333f4779d8fd8486450567 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 1 Dec 2023 19:56:20 +0530 Subject: [PATCH 112/126] fix build --- system_tests/state_provider_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 5fec849c40..53fd0acb07 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -22,7 +22,6 @@ import ( "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/arbos/l2pricing" - "github.com/offchainlabs/nitro/arbutil" "github.com/offchainlabs/nitro/staker" "github.com/offchainlabs/nitro/util" "github.com/offchainlabs/nitro/validator/valnode" @@ -66,7 +65,7 @@ func TestStateProvider_BOLD_Bisections(t *testing.T) { // Wait until the validator has validated the batches. for { - if _, err := l2node.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)); err == nil { + if _, err := l2node.TxStreamer.ResultAtCount(totalMessageCount); err == nil { break } } @@ -107,7 +106,7 @@ func TestStateProvider_BOLD_Bisections(t *testing.T) { hashes := make([]common.Hash, len(preExpansion)) for i, h := range preExpansion { hash := h - hashes[i] = common.Hash(hash) + hashes[i] = hash } computed, err := prefixproofs.Root(hashes) @@ -147,7 +146,7 @@ func TestStateProvider_BOLD(t *testing.T) { // Wait until the validator has validated the batches. for { - if _, err := l2node.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)); err == nil { + if _, err := l2node.TxStreamer.ResultAtCount(totalMessageCount); err == nil { break } } @@ -216,7 +215,7 @@ func TestStateProvider_BOLD(t *testing.T) { } // Check if we agree with the last posted batch to the inbox. - result, err := l2node.TxStreamer.ResultAtCount(arbutil.MessageIndex(totalMessageCount)) + result, err := l2node.TxStreamer.ResultAtCount(totalMessageCount) Require(t, err) state := &protocol.ExecutionState{ @@ -303,7 +302,6 @@ func setupBoldStateProvider(t *testing.T, ctx context.Context) (*arbnode.Node, * l2stateprovider.Height(smallStepChallengeLeafHeight), }, "good", - staker.DisableCache(), ) Require(t, err) return l2node, l1info, l2info, l1stack, l1client, stateManager From dc75fa05a18fa1170e6639f45b89db1e0b7718ef Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 1 Dec 2023 20:02:42 +0530 Subject: [PATCH 113/126] fix test --- system_tests/state_provider_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 53fd0acb07..44472124c3 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -159,7 +159,7 @@ func TestStateProvider_BOLD(t *testing.T) { stateRoots, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) Require(t, err) - if len(stateRoots) != 15 { + if stateRoots.Length() != 15 { Fatal(t, "wrong number of state roots") } }) From b9af2db372485c825410d7ceca351b55e30c46d2 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Fri, 1 Dec 2023 20:29:18 +0530 Subject: [PATCH 114/126] fix build --- ...assertion_on_large_number_of_block_test.go | 89 +++++++++++-------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/system_tests/assertion_on_large_number_of_block_test.go b/system_tests/assertion_on_large_number_of_block_test.go index ca8d043327..9bde353260 100644 --- a/system_tests/assertion_on_large_number_of_block_test.go +++ b/system_tests/assertion_on_large_number_of_block_test.go @@ -14,15 +14,16 @@ import ( "testing" "time" - "github.com/OffchainLabs/bold/assertions" protocol "github.com/OffchainLabs/bold/chain-abstraction" solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation" + challengemanager "github.com/OffchainLabs/bold/challenge-manager" + modes "github.com/OffchainLabs/bold/challenge-manager/types" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" "github.com/OffchainLabs/bold/math" "github.com/OffchainLabs/bold/solgen/go/mocksgen" "github.com/OffchainLabs/bold/solgen/go/rollupgen" - challenge_testing "github.com/OffchainLabs/bold/testing" + "github.com/OffchainLabs/bold/testing" "github.com/OffchainLabs/bold/testing/setup" "github.com/ethereum/go-ethereum/common" @@ -43,12 +44,6 @@ import ( "github.com/offchainlabs/nitro/validator/valnode" ) -var ( - blockChallengeLeafHeight = uint64(1 << 26) // 32 - bigStepChallengeLeafHeight = uint64(1 << 11) // 2048 - smallStepChallengeLeafHeight = uint64(1 << 20) // 1048576 -) - // Helps in testing the feasibility of assertion after the protocol upgrade. func TestAssertionOnLargeNumberOfBlocks(t *testing.T) { setupStartTime := time.Now().Unix() @@ -74,11 +69,11 @@ func TestAssertionOnLargeNumberOfBlocks(t *testing.T) { Require(t, err) challengeLeafHeights := []l2stateprovider.Height{ - l2stateprovider.Height(blockChallengeLeafHeight), - l2stateprovider.Height(bigStepChallengeLeafHeight), - l2stateprovider.Height(smallStepChallengeLeafHeight), + l2stateprovider.Height(uint64(1 << 26)), // blockChallengeLeafHeight = 67108864 + l2stateprovider.Height(uint64(1 << 11)), // bigStepChallengeLeafHeight = 2048 + l2stateprovider.Height(uint64(1 << 20)), // smallStepChallengeLeafHeight = 1048576 } - manager, err := staker.NewStateManager(stateless, t.TempDir(), nil) + manager, err := staker.NewStateManager(stateless, t.TempDir(), challengeLeafHeights, "test") Require(t, err) provider := l2stateprovider.NewHistoryCommitmentProvider( manager, @@ -87,12 +82,20 @@ func TestAssertionOnLargeNumberOfBlocks(t *testing.T) { challengeLeafHeights, manager, ) - poster := assertions.NewPoster( + + challengeManager, err := challengemanager.New( + ctx, assertionChain, + assertionChain.Backend(), provider, - "test", - time.Second, + assertionChain.RollupAddress(), + challengemanager.WithName("test"), + challengemanager.WithMode(modes.DefensiveMode), + challengemanager.WithAssertionPostingInterval(time.Hour), + challengemanager.WithAssertionScanningInterval(time.Hour), + challengemanager.WithEdgeTrackerWakeInterval(time.Second), ) + poster := challengeManager.AssertionManager() assertion, err := poster.PostAssertion(ctx) Require(t, err) setupEndTime := time.Now().Unix() @@ -128,10 +131,12 @@ func testCalculatingBlockChallengeLevelZeroEdgeBisection( _, err = provider.HistoryCommitment( ctx, &l2stateprovider.HistoryCommitmentRequest{ - WasmModuleRoot: wasmModuleRoot, - Batch: l2stateprovider.Batch(topLevelClaimEndBatchCount), - FromHeight: l2stateprovider.Height(0), - UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(bisectTo)), + WasmModuleRoot: wasmModuleRoot, + FromBatch: 0, + ToBatch: l2stateprovider.Batch(topLevelClaimEndBatchCount), + UpperChallengeOriginHeights: []l2stateprovider.Height{}, + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(bisectTo)), }, ) @@ -139,10 +144,12 @@ func testCalculatingBlockChallengeLevelZeroEdgeBisection( _, err = provider.PrefixProof( ctx, &l2stateprovider.HistoryCommitmentRequest{ - WasmModuleRoot: wasmModuleRoot, - Batch: l2stateprovider.Batch(topLevelClaimEndBatchCount), - FromHeight: l2stateprovider.Height(bisectTo), - UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(endHeight)), + WasmModuleRoot: wasmModuleRoot, + FromBatch: 0, + ToBatch: l2stateprovider.Batch(topLevelClaimEndBatchCount), + UpperChallengeOriginHeights: []l2stateprovider.Height{}, + FromHeight: l2stateprovider.Height(bisectTo), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(endHeight)), }, l2stateprovider.Height(bisectTo), ) @@ -163,10 +170,12 @@ func testCalculatingBlockChallengeLevelZeroEdge( startCommit, err := provider.HistoryCommitment( ctx, &l2stateprovider.HistoryCommitmentRequest{ - WasmModuleRoot: creationInfo.WasmModuleRoot, - Batch: l2stateprovider.Batch(0), - FromHeight: l2stateprovider.Height(0), - UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(0)), + WasmModuleRoot: creationInfo.WasmModuleRoot, + FromBatch: 0, + ToBatch: l2stateprovider.Batch(0), + UpperChallengeOriginHeights: []l2stateprovider.Height{}, + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(0)), }, ) Require(t, err) @@ -176,27 +185,31 @@ func testCalculatingBlockChallengeLevelZeroEdge( endCommit, err := provider.HistoryCommitment( ctx, &l2stateprovider.HistoryCommitmentRequest{ - WasmModuleRoot: creationInfo.WasmModuleRoot, - Batch: l2stateprovider.Batch(creationInfo.InboxMaxCount.Uint64()), - FromHeight: l2stateprovider.Height(0), - UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(levelZeroBlockEdgeHeight)), + WasmModuleRoot: creationInfo.WasmModuleRoot, + FromBatch: 0, + ToBatch: l2stateprovider.Batch(creationInfo.InboxMaxCount.Uint64()), + UpperChallengeOriginHeights: []l2stateprovider.Height{}, + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(levelZeroBlockEdgeHeight)), }, ) Require(t, err) _, err = provider.PrefixProof( ctx, &l2stateprovider.HistoryCommitmentRequest{ - WasmModuleRoot: creationInfo.WasmModuleRoot, - Batch: l2stateprovider.Batch(creationInfo.InboxMaxCount.Uint64()), - FromHeight: l2stateprovider.Height(0), - UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(levelZeroBlockEdgeHeight)), + WasmModuleRoot: creationInfo.WasmModuleRoot, + FromBatch: 0, + ToBatch: l2stateprovider.Batch(creationInfo.InboxMaxCount.Uint64()), + UpperChallengeOriginHeights: []l2stateprovider.Height{}, + FromHeight: l2stateprovider.Height(0), + UpToHeight: option.Some[l2stateprovider.Height](l2stateprovider.Height(levelZeroBlockEdgeHeight)), }, l2stateprovider.Height(0), ) Require(t, err) return startCommit.Height, endCommit.Height, creationInfo.WasmModuleRoot, creationInfo.InboxMaxCount.Uint64() } -func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, protocol.Protocol) { +func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, *solimpl.AssertionChain) { glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false))) glogger.Verbosity(log.LvlInfo) log.Root().SetHandler(glogger) @@ -239,7 +252,7 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot Require(t, err) _, err = EnsureTxSucceeded(ctx, l1Backend, tx) Require(t, err) - rollupAddresses, assertionChain := deployBoldContracts(t, ctx, l1Info, l1Backend, chainConfig.ChainID, stakeToken) + rollupAddresses, assertionChain := deployBoldContractsAndTokenBinding(t, ctx, l1Info, l1Backend, chainConfig.ChainID, stakeToken) l1Info.SetContract("Bridge", rollupAddresses.Bridge) l1Info.SetContract("SequencerInbox", rollupAddresses.SequencerInbox) l1Info.SetContract("Inbox", rollupAddresses.Inbox) @@ -304,7 +317,7 @@ func setupAndPostBatches(t *testing.T, ctx context.Context) (*arbnode.Node, prot return l2Node, assertionChain } -func deployBoldContracts( +func deployBoldContractsAndTokenBinding( t *testing.T, ctx context.Context, l1info info, From 1f8a48197c2ea1b8c605dd07889c610ee6837523 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 11 Jan 2024 15:17:38 +0530 Subject: [PATCH 115/126] update bold --- bold | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bold b/bold index 92b8edcc1b..6b8d955f3a 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 92b8edcc1bdc2a0d23e0c7c52dd2327d7739dd69 +Subproject commit 6b8d955f3af2645f7e49acc153ad8a4e3dc7f5ec From bbc52c6dc1242fd4b4480434201685ced34e7c73 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 11 Jan 2024 15:36:03 +0530 Subject: [PATCH 116/126] minor fix --- system_tests/bold_challenge_protocol_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 969903d0f3..0c3b66ad7b 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -342,6 +342,9 @@ func TestBoldProtocol(t *testing.T) { t.Log("Honest party posting assertion at batch 2, pos 0") expectedWinnerAssertion, err := poster.PostAssertion(ctx) Require(t, err) + if expectedWinnerAssertion.IsNone() { + Fatal(t, "expected winner assertion is none") + } managerB, err := challengemanager.New( ctx, @@ -368,7 +371,7 @@ func TestBoldProtocol(t *testing.T) { rollupUserLogic, err := rollupgen.NewRollupUserLogic(assertionChain.RollupAddress(), l1client) Require(t, err) for { - expected, err := rollupUserLogic.GetAssertion(&bind.CallOpts{Context: ctx}, expectedWinnerAssertion.Id().Hash) + expected, err := rollupUserLogic.GetAssertion(&bind.CallOpts{Context: ctx}, expectedWinnerAssertion.Unwrap().Id().Hash) if err != nil { t.Logf("Error getting assertion: %v", err) continue From 933ceb50a4c9644586118db92d9040552ec3f44a Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 11 Jan 2024 15:36:53 +0530 Subject: [PATCH 117/126] mod tidy --- go.mod | 1 + go.sum | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/go.mod b/go.mod index a5158f7686..089720c245 100644 --- a/go.mod +++ b/go.mod @@ -185,6 +185,7 @@ require ( github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/goprocess v0.1.4 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/jmoiron/sqlx v1.3.5 // indirect github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 // indirect github.com/klauspost/compress v1.16.4 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect diff --git a/go.sum b/go.sum index 620f015499..3a3b125d56 100644 --- a/go.sum +++ b/go.sum @@ -413,6 +413,8 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= @@ -878,6 +880,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= +github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -957,6 +961,8 @@ github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= @@ -1207,6 +1213,8 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= From e856fc97c66b340e6faa89bc17d607e0ca9e7ab7 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Thu, 11 Jan 2024 19:24:52 +0530 Subject: [PATCH 118/126] Add test for mulitple and parallel challenges --- system_tests/bold_challenge_protocol_test.go | 134 +++++++++++++++++-- 1 file changed, 123 insertions(+), 11 deletions(-) diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 0c3b66ad7b..8c46a10c57 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -10,9 +10,11 @@ import ( "bytes" "context" "encoding/json" + "fmt" "io" "math/big" "os" + "sync" "testing" "time" @@ -61,7 +63,19 @@ var ( smallStepChallengeLeafHeight = uint64(1 << 6) ) -func TestBoldProtocol(t *testing.T) { +func TestBoldProtocolOneChallenge(t *testing.T) { + testBoldProtocol(t, 1, false) +} + +func TestBoldProtocolTwoSequentialChallenge(t *testing.T) { + testBoldProtocol(t, 2, false) +} + +func TestBoldProtocolTwoParallelChallenge(t *testing.T) { + testBoldProtocol(t, 2, true) +} + +func testBoldProtocol(t *testing.T, numberOfChallenges int, parallelChallenges bool) { t.Cleanup(func() { Require(t, os.RemoveAll("/tmp/good")) Require(t, os.RemoveAll("/tmp/evil")) @@ -370,18 +384,116 @@ func TestBoldProtocol(t *testing.T) { rollupUserLogic, err := rollupgen.NewRollupUserLogic(assertionChain.RollupAddress(), l1client) Require(t, err) - for { - expected, err := rollupUserLogic.GetAssertion(&bind.CallOpts{Context: ctx}, expectedWinnerAssertion.Unwrap().Id().Hash) - if err != nil { - t.Logf("Error getting assertion: %v", err) - continue + var waitGroup sync.WaitGroup + waitGroup.Add(1) + go func() { + defer waitGroup.Done() + for { + expected, err := rollupUserLogic.GetAssertion(&bind.CallOpts{Context: ctx}, expectedWinnerAssertion.Unwrap().Id().Hash) + if err != nil { + t.Logf("Error getting assertion: %v", err) + continue + } + // Wait until the assertion is confirmed. + if expected.Status == uint8(2) { + t.Log("Expected assertion was confirmed") + t.Log("Challenge 0 complete") + break + } + time.Sleep(time.Second * 5) + } + }() + if !parallelChallenges { + waitGroup.Wait() + } + + for i := 1; i < numberOfChallenges; i++ { + l2info.Accounts["Owner"].Nonce = uint64(totalMessagesPosted) + makeBoldBatch(t, l2nodeA, l2info, l1client, &sequencerTxOpts, honestSeqInboxBinding, honestSeqInbox, numMessagesPerBatch, divergeAt) + l2info.Accounts["Owner"].Nonce = uint64(totalMessagesPosted) + makeBoldBatch(t, l2nodeB, l2info, l1client, &sequencerTxOpts, evilSeqInboxBinding, evilSeqInbox, numMessagesPerBatch, divergeAt) + totalMessagesPosted += numMessagesPerBatch + + bcA, err := l2nodeA.InboxTracker.GetBatchCount() + Require(t, err) + bcB, err := l2nodeB.InboxTracker.GetBatchCount() + Require(t, err) + msgA, err := l2nodeA.InboxTracker.GetBatchMessageCount(bcA - 1) + Require(t, err) + msgB, err := l2nodeB.InboxTracker.GetBatchMessageCount(bcB - 1) + Require(t, err) + + t.Logf("Node A batch count %d, msgs %d", bcA, msgA) + t.Logf("Node B batch count %d, msgs %d", bcB, msgB) + + for { + nodeALatest := nodeAExec.Backend.APIBackend().CurrentHeader() + nodeBLatest := nodeBExec.Backend.APIBackend().CurrentHeader() + isCaughtUp := nodeALatest.Number.Uint64() == uint64(totalMessagesPosted) + areEqual := nodeALatest.Number.Uint64() == nodeBLatest.Number.Uint64() + if isCaughtUp && areEqual { + if nodeALatest.Hash() == nodeBLatest.Hash() { + Fatal(t, "node A L2 hash", nodeALatest, "matches node B L2 hash", nodeBLatest) + } + break + } + } + + // Wait for the validator to validate the batches. + totalBatchesBig, err := bridgeBinding.SequencerMessageCount(&bind.CallOpts{Context: ctx}) + Require(t, err) + totalBatches := totalBatchesBig.Uint64() + totalMessageCount, err := l2nodeA.InboxTracker.GetBatchMessageCount(totalBatches - 1) + Require(t, err) + + // Wait until the validator has validated the batches. + for { + _, err1 := l2nodeA.TxStreamer.ResultAtCount(totalMessageCount) + nodeAHasValidated := err1 == nil + + _, err2 := l2nodeB.TxStreamer.ResultAtCount(totalMessageCount) + nodeBHasValidated := err2 == nil + + if nodeAHasValidated && nodeBHasValidated { + break + } } - // Wait until the assertion is confirmed. - if expected.Status == uint8(2) { - t.Log("Expected assertion was confirmed") - return + + t.Log(fmt.Sprintf("Honest party posting assertion at batch %d, pos 0", 2+i)) + expectedWinnerAssertion, err := poster.PostAssertion(ctx) + Require(t, err) + if expectedWinnerAssertion.IsNone() { + Fatal(t, "expected winner assertion is none") } - time.Sleep(time.Second * 5) + + t.Log(fmt.Sprintf("Evil party posting assertion at batch %d, pos 0", 2+i)) + _, err = posterB.PostAssertion(ctx) + Require(t, err) + + waitGroup.Add(1) + go func() { + defer waitGroup.Done() + for { + expected, err := rollupUserLogic.GetAssertion(&bind.CallOpts{Context: ctx}, expectedWinnerAssertion.Unwrap().Id().Hash) + if err != nil { + t.Logf("Error getting assertion: %v", err) + continue + } + // Wait until the assertion is confirmed. + if expected.Status == uint8(2) { + t.Log("Expected assertion was confirmed") + t.Log(fmt.Sprintf("Challenge %d complete", i)) + break + } + time.Sleep(time.Second * 5) + } + }() + if !parallelChallenges { + waitGroup.Wait() + } + } + if parallelChallenges { + waitGroup.Wait() } } From e7597683d82cbac4a6c3db8f244cc98e01c62656 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 20:44:06 +0530 Subject: [PATCH 119/126] remove mmpa --- bold | 2 +- go.mod | 6 +- go.sum | 384 +++++++++++++++++++++- staker/challenge-cache/cache.go | 38 +-- staker/challenge-cache/cache_test.go | 53 ++- staker/state_provider.go | 66 ++-- system_tests/validation_mock_test.go | 10 +- validator/interface.go | 5 +- validator/server_api/validation_api.go | 21 +- validator/server_api/validation_client.go | 24 +- validator/server_arb/execution_run.go | 82 +++-- 11 files changed, 553 insertions(+), 138 deletions(-) diff --git a/bold b/bold index 6b8d955f3a..e396c55d37 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit 6b8d955f3af2645f7e49acc153ad8a4e3dc7f5ec +Subproject commit e396c55d37657d18300e905f45bf772a9102a553 diff --git a/go.mod b/go.mod index 1eda1e725b..5e68460a8d 100644 --- a/go.mod +++ b/go.mod @@ -215,6 +215,7 @@ require ( github.com/libp2p/zeroconf/v2 v2.2.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect + github.com/mattn/go-sqlite3 v1.14.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.53 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect @@ -256,7 +257,6 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/samber/lo v1.36.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/urfave/cli/v2 v2.25.7 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect @@ -315,7 +315,7 @@ require ( ) require ( - github.com/StackExchange/wmi v1.2.1 // indirect + github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect @@ -327,7 +327,7 @@ require ( github.com/google/uuid v1.3.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect - github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect diff --git a/go.sum b/go.sum index d8104f1a27..bf57476498 100644 --- a/go.sum +++ b/go.sum @@ -65,7 +65,6 @@ github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fT github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= -github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -77,16 +76,23 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 h1:iW0a5ljuFxkLGPNem5Ui+KBjFJzKg4Fv2fnxe4dvzpM= github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5/go.mod h1:Y2QMoi1vgtOIfc+6DhrMOGkLoGzqSV2rKp4Sm+opsyA= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.21.0 h1:CdmwIlKUWFBDS+4464GtQiQ0R1vpzOgu4Vnd74rBL7M= github.com/alicebob/miniredis/v2 v2.21.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/arduino/go-paths-helper v1.2.0 h1:qDW93PR5IZUN/jzO4rCtexiwF8P4OIcOmcSgAYLZfY4= github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -98,43 +104,65 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.16.3/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU= +github.com/aws/aws-sdk-go-v2 v1.16.4 h1:swQTEQUyJF/UkEA94/Ga55miiKFoXmm/Zd67XHgmjSg= github.com/aws/aws-sdk-go-v2 v1.16.4/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1 h1:SdK4Ppk5IzLs64ZMvr6MrSficMtjY2oS0WOORXTlxwU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1/go.mod h1:n8Bs1ElDD2wJ9kCRTczA83gYbBmjSwZp3umc6zF4EeM= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= +github.com/aws/aws-sdk-go-v2/config v1.15.5 h1:P+xwhr6kabhxDTXTVH9YoHkqjLJ0wVVpIUHtFNr2hjU= github.com/aws/aws-sdk-go-v2/config v1.15.5/go.mod h1:ZijHHh0xd/A+ZY53az0qzC5tT46kt4JVCePf2NX9Lk4= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= +github.com/aws/aws-sdk-go-v2/credentials v1.12.0 h1:4R/NqlcRFSkR0wxOhgHi+agGpbEr5qMCjn7VqUIJY+E= github.com/aws/aws-sdk-go-v2/credentials v1.12.0/go.mod h1:9YWk7VW+eyKsoIL6/CljkTrNVWBSK9pkqOPUuijid4A= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.4 h1:FP8gquGeGHHdfY6G5llaMQDF+HAf20VKc8opRwmjf04= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.4/go.mod h1:u/s5/Z+ohUQOPXl00m2yJVyioWDECsbpXTQlaqSlufc= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.10 h1:JL7cY85hyjlgfA29MMyAlItX+JYIH9XsxgMBS7jtlqA= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.10/go.mod h1:p+ul5bLZSDRRXCZ/vePvfmZBH9akozXBJA5oMshWa5U= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.10/go.mod h1:F+EZtuIwjlv35kRJPyBGcsA4f7bnSoz15zOQ2lJq1Z4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11 h1:gsqHplNh1DaQunEKZISK56wlpbCg0yKxNVvGWCFuF1k= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11/go.mod h1:tmUB6jakq5DFNcXsXOA/ZQ7/C8VnSKYkx58OI7Fh79g= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.4/go.mod h1:8glyUqVIM4AmeenIsPo0oVh3+NUwnsQml2OFupfQW+0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5 h1:PLFj+M2PgIDHG//hw3T0O0KLI4itVtAjtxrZx4AHPLg= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5/go.mod h1:fV1AaS2gFc1tM0RCb015FJ0pvWVUfJZANzjwoO4YakM= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.11 h1:6cZRymlLEIlDTEB0+5+An6Zj1CKt6rSE69tOmFeu1nk= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.11/go.mod h1:0MR+sS1b/yxsfAPvAESrw8NfwUoxMinDyw6EYR9BS2U= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.1 h1:C21IDZCm9Yu5xqjb3fKmxDoYvJXtw1DNlOmLZEIlY1M= github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.1/go.mod h1:l/BbcfqDCT3hePawhy4ZRtewjtdkl6GWtd9/U+1penQ= github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1 h1:T4pFel53bkHjL2mMo+4DKE6r6AuoZnM0fg7k1/ratr4= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1/go.mod h1:GeUru+8VzrTXV/83XyMJ80KpH8xO89VPoUileyNQ+tc= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.5 h1:9LSZqt4v1JiehyZTrQnRFf2mY/awmyYNNY/b7zqtduU= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.5/go.mod h1:S8TVP66AAkMMdYYCNZGvrdEq9YRm+qLXjio4FqRnrEE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.4 h1:b16QW0XWl0jWjLABFc1A+uh145Oqv+xDcObNk0iQgUk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.4/go.mod h1:uKkN7qmSIsNJVyMtxNQoCEYMvFEXbOg9fwCJPdfp2u8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.4 h1:RE/DlZLYrz1OOmq8F28IXHLksuuvlpzUbvJ+SESCZBI= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.4/go.mod h1:oudbsSdDtazNj47z1ut1n37re9hDsKpk2ZI3v7KSxq0= +github.com/aws/aws-sdk-go-v2/service/s3 v1.26.9 h1:LCQKnopq2t4oQS3VKivlYTzAHCTJZZoQICM9fny7KHY= github.com/aws/aws-sdk-go-v2/service/s3 v1.26.9/go.mod h1:iMYipLPXlWpBJ0KFX7QJHZ84rBydHBY8as2aQICTPWk= github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.4 h1:Uw5wBybFQ1UeA9ts0Y07gbv0ncZnIAyw858tDW0NP2o= github.com/aws/aws-sdk-go-v2/service/sso v1.11.4/go.mod h1:cPDwJwsP4Kff9mldCXAmddjJL6JGQqtA3Mzer2zyr88= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.4 h1:+xtV90n3abQmgzk1pS++FdxZTrPEDgQng6e4/56WR2A= github.com/aws/aws-sdk-go-v2/service/sts v1.16.4/go.mod h1:lfSYenAXtavyX2A1LsViglqlG9eEFYxNryTZS5rn3QE= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.11.2 h1:eG/N+CcUMAvsdffgMvjMKwfyDzIkjM6pfxMJ8Mzc6mE= github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -143,7 +171,9 @@ github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcug github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -158,14 +188,21 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtE github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cavaliergopher/grab/v3 v3.0.1 h1:4z7TkBfmPjmLAAmkkAZNX/6QJ1nNFdv3SdIHXju0Fr4= github.com/cavaliergopher/grab/v3 v3.0.1/go.mod h1:1U/KNnD+Ft6JJiYoYBAimKH2XrYptb8Kl3DFGmsjpq4= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/ceramicnetwork/go-dag-jose v0.1.0 h1:yJ/HVlfKpnD3LdYP03AHyTvbm3BpPiz2oZiOeReJRdU= github.com/ceramicnetwork/go-dag-jose v0.1.0/go.mod h1:qYA1nYt0X8u4XoMAVoOV3upUVKtrxy/I670Dg5F0wjI= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -187,18 +224,28 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/codeclysm/extract/v3 v3.0.2 h1:sB4LcE3Php7LkhZwN0n2p8GCwZe92PEQutdbGURf5xc= github.com/codeclysm/extract/v3 v3.0.2/go.mod h1:NKsw+hqua9H+Rlwy/w/3Qgt9jDonYEgB6wJu+25eOKw= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= +github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -207,46 +254,65 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= +github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= +github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= +github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= +github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8= github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 h1:qwcF+vdFrvPSEUDSX5RVoRccG8a5DhOdWdQ4zN62zzo= github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -255,8 +321,11 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/enescakir/emoji v1.0.0 h1:W+HsNql8swfCQFtioDGDHCHri8nudlK1n5p2rHCJoog= github.com/enescakir/emoji v1.0.0/go.mod h1:Bt1EKuLnKDTYpLALApstIkAjdDrS/8IAgTkKp+WKFD0= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -269,39 +338,55 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gammazero/deque v0.2.1 h1:qSdsbG6pgp6nL7A0+K/B7s12mcCY/5l5SIUpMOl+dC0= github.com/gammazero/deque v0.2.1/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= +github.com/gdamore/tcell/v2 v2.6.0 h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg= github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -313,35 +398,52 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= +github.com/gobwas/ws-examples v0.0.0-20190625122829-a9e8908d9484 h1:XC9N1eiAyO1zg62dpOU8bex8emB/zluUtKcbLNjJxGI= github.com/gobwas/ws-examples v0.0.0-20190625122829-a9e8908d9484/go.mod h1:5nDZF4afNA1S7ZKcBXCMvDo4nuCTp1931DND7/W4aXo= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -351,18 +453,22 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -372,6 +478,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= @@ -390,15 +497,18 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -413,11 +523,13 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -429,6 +541,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= +github.com/google/pprof v0.0.0-20230405160723-4a4c7d95572b h1:Qcx5LM0fSiks9uCyFZwDBUasd3lxd1RM0GYpL+Li5o4= github.com/google/pprof v0.0.0-20230405160723-4a4c7d95572b/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= @@ -436,16 +549,19 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= @@ -453,7 +569,9 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY41SORZyNJ0= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -461,15 +579,20 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= +github.com/h2non/filetype v1.0.6 h1:g84/+gdkAT1hnYO+tHpCLoikm13Ju55OkN4KCb1uGEQ= github.com/h2non/filetype v1.0.6/go.mod h1:isekKqOuhMj+s/7r3rIeTErIRy4Rub5uBWHfvMusLMU= +github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -478,6 +601,7 @@ github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -495,8 +619,11 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.2 h1:Dwmkdr5Nc/oBiXgJS3CDHNhJtIHkuZ3DZF5twqnfBdU= github.com/hashicorp/golang-lru/v2 v2.0.2/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -506,12 +633,16 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= @@ -521,20 +652,25 @@ github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/C github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= +github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= github.com/ipfs/go-bitfield v1.0.0/go.mod h1:N/UiujQy+K+ceU1EF5EkVd1TNqevLrCQMIcAEPrdtus= +github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= github.com/ipfs/go-bitswap v0.6.0/go.mod h1:Hj3ZXdOC5wBJvENtdqsixmzzRukqd8EHLxZLZc3mzRA= +github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= +github.com/ipfs/go-block-format v0.1.1 h1:129vSO3zwbsYADcyQWcOYiuCpAqt462SFfqFHdFJhhI= github.com/ipfs/go-block-format v0.1.1/go.mod h1:+McEIT+g52p+zz5xGAABGSOKrzmrdX97bc0USBdWPUs= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= github.com/ipfs/go-blockservice v0.2.1/go.mod h1:k6SiwmgyYgs4M/qt+ww6amPeUH9EISLRBnvUurKJhi8= github.com/ipfs/go-blockservice v0.3.0/go.mod h1:P5ppi8IHDC7O+pA0AlGTF09jruB2h+oP3wVVaZl8sfk= +github.com/ipfs/go-blockservice v0.5.1 h1:9pAtkyKAz/skdHTh0kH8VulzWp+qmSDD0aI17TYP/s0= github.com/ipfs/go-blockservice v0.5.1/go.mod h1:VpMblFEqG67A/H2sHKAemeH9vlURVavlysbdUI632yk= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -544,7 +680,9 @@ github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67Fexh github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= +github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= +github.com/ipfs/go-cidutil v0.1.0 h1:RW5hO7Vcf16dplUU60Hs0AKDkQAVPVplr7lk97CFL+Q= github.com/ipfs/go-cidutil v0.1.0/go.mod h1:e7OEVBMIv9JaOxt9zaGEmAoSlXW9jdFZ5lP/0PwcfpA= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= @@ -556,76 +694,108 @@ github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13X github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= +github.com/ipfs/go-delegated-routing v0.7.0 h1:43FyMnKA+8XnyX68Fwg6aoGkqrf8NS5aG7p644s26PU= github.com/ipfs/go-delegated-routing v0.7.0/go.mod h1:u4zxjUWIe7APUW5ds9CfD0tJX3vM9JhIeNqA8kE4vHE= +github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= +github.com/ipfs/go-ds-badger v0.3.0 h1:xREL3V0EH9S219kFFueOYJJTcjgNSZ2HY1iSvN7U1Ro= github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= +github.com/ipfs/go-ds-flatfs v0.5.1 h1:ZCIO/kQOS/PSh3vcF1H6a8fkRGS7pOfwfPdx4n/KJH4= github.com/ipfs/go-ds-flatfs v0.5.1/go.mod h1:RWTV7oZD/yZYBKdbVIFXTX2fdY2Tbvl94NsWqmoyAX4= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= +github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo= github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= +github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ= github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9UvVh8V3JxE= +github.com/ipfs/go-fetcher v1.6.1 h1:UFuRVYX5AIllTiRhi5uK/iZkfhSpBCGX7L70nSZEmK8= github.com/ipfs/go-fetcher v1.6.1/go.mod h1:27d/xMV8bodjVs9pugh/RCjjK2OZ68UgAMspMdingNo= +github.com/ipfs/go-filestore v1.2.0 h1:O2wg7wdibwxkEDcl7xkuQsPvJFRBVgVSsOJ/GP6z3yU= github.com/ipfs/go-filestore v1.2.0/go.mod h1:HLJrCxRXquTeEEpde4lTLMaE/MYJZD7WHLkp9z6+FF8= +github.com/ipfs/go-fs-lock v0.0.7 h1:6BR3dajORFrFTkb5EpCUFIAypsoxpGpDSVUdFwzgL9U= github.com/ipfs/go-fs-lock v0.0.7/go.mod h1:Js8ka+FNYmgQRLrRXzU3CB/+Csr1BwrRilEcvYrHhhc= +github.com/ipfs/go-graphsync v0.14.1 h1:tvFpBY9LcehIB7zi5SZIa+7aoxBOrGbdekhOXdnlT70= github.com/ipfs/go-graphsync v0.14.1/go.mod h1:S6O/c5iXOXqDgrQgiZSgOTRUSiVvpKEhrzqFHKnLVcs= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.2.1/go.mod h1:jGesd8EtCM3/zPgx+qr0/feTXGUeRai6adgwC+Q+JvE= +github.com/ipfs/go-ipfs-blockstore v1.2.0 h1:n3WTeJ4LdICWs/0VSfjHrlqpPpl6MZ+ySd3j8qz0ykw= github.com/ipfs/go-ipfs-blockstore v1.2.0/go.mod h1:eh8eTFLiINYNSNawfZOC7HOxNTxpB1PFuA5E1m/7exE= +github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= +github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= +github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= github.com/ipfs/go-ipfs-ds-help v0.1.1/go.mod h1:SbBafGJuGsPI/QL3j9Fc5YPLeAu+SzOkI0gFwAg+mOs= +github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-interface v0.1.0/go.mod h1:ych7WPlyHqFvCi/uQI48zLZuAWVP5iTQPXEfVaw5WEI= +github.com/ipfs/go-ipfs-exchange-interface v0.2.0 h1:8lMSJmKogZYNo2jjhUs0izT+dck05pqUw4mWNW9Pw6Y= github.com/ipfs/go-ipfs-exchange-interface v0.2.0/go.mod h1:z6+RhJuDQbqKguVyslSOuVDhqF9JtTrO3eptSAiW2/Y= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= github.com/ipfs/go-ipfs-exchange-offline v0.1.1/go.mod h1:vTiBRIbzSwDD0OWm+i3xeT0mO7jG2cbJYatp3HPk5XY= github.com/ipfs/go-ipfs-exchange-offline v0.2.0/go.mod h1:HjwBeW0dvZvfOMwDP0TSKXIHf2s+ksdP4E3MLDRtLKY= +github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA= github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= +github.com/ipfs/go-ipfs-keystore v0.1.0 h1:gfuQUO/cyGZgZIHE6OrJas4OnwuxXCqJG7tI0lrB5Qc= github.com/ipfs/go-ipfs-keystore v0.1.0/go.mod h1:LvLw7Qhnb0RlMOfCzK6OmyWxICip6lQ06CCmdbee75U= +github.com/ipfs/go-ipfs-pinner v0.3.0 h1:jwe5ViX3BON3KgOAYrrhav2+1ONB0QzFAWQd7HUlbuM= github.com/ipfs/go-ipfs-pinner v0.3.0/go.mod h1:oX0I0nC6zlNIh0LslSrUnjfNKPq8ufoFtqV1/wcJvyo= +github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A= github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= +github.com/ipfs/go-ipfs-pq v0.0.3 h1:YpoHVJB+jzK15mr/xsWC574tyDLkezVrDNeaalQBsTE= github.com/ipfs/go-ipfs-pq v0.0.3/go.mod h1:btNw5hsHBpRcSSgZtiNm/SLj5gYIZ18AKtv3kERkRb4= +github.com/ipfs/go-ipfs-provider v0.8.1 h1:qt670pYmcNH3BCjyXDgg07o2WsTRsOdMwYc25ukCdjQ= github.com/ipfs/go-ipfs-provider v0.8.1/go.mod h1:qCpwpoohIRVXvNzkygzsM3qdqP/sXlrogtA5I45tClc= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= github.com/ipfs/go-ipfs-routing v0.2.1/go.mod h1:xiNNiwgjmLqPS1cimvAw6EyB9rkVDbiocA4yY+wRNLM= +github.com/ipfs/go-ipfs-routing v0.3.0 h1:9W/W3N+g+y4ZDeffSgqhgo7BsBSJwPMcyssET9OWevc= github.com/ipfs/go-ipfs-routing v0.3.0/go.mod h1:dKqtTFIql7e1zYsEuWLyuOU+E0WJWW8JjbTPLParDWo= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= +github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.6 h1:pYuWHyvSpIsOOLw4Jy7NbBkCyzLDcl64Bf/LZW7eBQ0= github.com/ipfs/go-ipld-cbor v0.0.6/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-ipld-format v0.3.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= +github.com/ipfs/go-ipld-format v0.4.0 h1:yqJSaJftjmjc9jEOFYlpkwOLVKv68OD27jFLlSghBlQ= github.com/ipfs/go-ipld-format v0.4.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= +github.com/ipfs/go-ipld-git v0.1.1 h1:TWGnZjS0htmEmlMFEkA3ogrNCqWjIxwr16x1OsdhG+Y= github.com/ipfs/go-ipld-git v0.1.1/go.mod h1:+VyMqF5lMcJh4rwEppV0e6g4nCCHXThLYYDpKUkJubI= github.com/ipfs/go-ipld-legacy v0.1.0/go.mod h1:86f5P/srAmh9GcIcWQR9lfFLZPrIyyXQeVlOWeeWEuI= +github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2cdcc= github.com/ipfs/go-ipld-legacy v0.1.1/go.mod h1:8AyKFCjgRPsQFf15ZQgDB8Din4DML/fOmKZkkFkrIEg= +github.com/ipfs/go-ipns v0.3.0 h1:ai791nTgVo+zTuq2bLvEGmWP1M0A6kGTXUsgv/Yq67A= github.com/ipfs/go-ipns v0.3.0/go.mod h1:3cLT2rbvgPZGkHJoPO1YMJeh6LtkxopCkKFcio/wE24= +github.com/ipfs/go-libipfs v0.6.2 h1:QUf3kS3RrCjgtE0QW2d18PFFfOLeEt24Ft892ipLzRI= github.com/ipfs/go-libipfs v0.6.2/go.mod h1:FmhKgxMOQA572TK5DA3MZ5GL44ZqsMHIrkgK4gLn4A8= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= @@ -633,35 +803,52 @@ github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscw github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= +github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= github.com/ipfs/go-merkledag v0.5.1/go.mod h1:cLMZXx8J08idkp5+id62iVftUQV+HlYJ3PIhDfZsjA4= github.com/ipfs/go-merkledag v0.6.0/go.mod h1:9HSEwRd5sV+lbykiYP+2NC/3o6MZbKNaa4hfNcH5iH0= +github.com/ipfs/go-merkledag v0.9.0 h1:DFC8qZ96Dz1hMT7dtIpcY524eFFDiEWAF8hNJHWW2pk= github.com/ipfs/go-merkledag v0.9.0/go.mod h1:bPHqkHt5OZ0p1n3iqPeDiw2jIBkjAytRjS3WSBwjq90= +github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= +github.com/ipfs/go-mfs v0.2.1 h1:5jz8+ukAg/z6jTkollzxGzhkl3yxm022Za9f2nL5ab8= github.com/ipfs/go-mfs v0.2.1/go.mod h1:Woj80iuw4ajDnIP6+seRaoHpPsc9hmL0pk/nDNDWP88= +github.com/ipfs/go-namesys v0.7.0 h1:xqosk71GIVRkFDtF2UNRcXn4LdNeo7tzuy8feHD6NbU= github.com/ipfs/go-namesys v0.7.0/go.mod h1:KYSZBVZG3VJC34EfqqJPG7T48aWgxseoMPAPA5gLyyQ= github.com/ipfs/go-path v0.2.1/go.mod h1:NOScsVgxfC/eIw4nz6OiGwK42PjaSJ4Y/ZFPn1Xe07I= +github.com/ipfs/go-path v0.3.1 h1:wkeaCWE/NTuuPGlEkLTsED5UkzfKYZpxaFFPgk8ZVLE= github.com/ipfs/go-path v0.3.1/go.mod h1:eNLsxJEEMxn/CDzUJ6wuNl+6No6tEUhOZcPKsZsYX0E= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= +github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg= github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= github.com/ipfs/go-unixfs v0.3.1/go.mod h1:h4qfQYzghiIc8ZNFKiLMFWOTzrWIAtzYQ59W/pCFf1o= +github.com/ipfs/go-unixfs v0.4.4 h1:D/dLBOJgny5ZLIur2vIXVQVW0EyDHdOMBDEhgHrt6rY= github.com/ipfs/go-unixfs v0.4.4/go.mod h1:TSG7G1UuT+l4pNj91raXAPkX0BhJi3jST1FDTfQ5QyM= github.com/ipfs/go-unixfsnode v1.1.2/go.mod h1:5dcE2x03pyjHk4JjamXmunTMzz+VUtqvPwZjIEkfV6s= +github.com/ipfs/go-unixfsnode v1.5.2 h1:CvsiTt58W2uR5dD8bqQv+aAY0c1qolmXmSyNbPHYiew= github.com/ipfs/go-unixfsnode v1.5.2/go.mod h1:NlOebRwYx8lMCNMdhAhEspYPBD3obp7TE0LvBqHY+ks= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= +github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs= github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG5Wb4xnPU= +github.com/ipfs/interface-go-ipfs-core v0.11.0 h1:n1tplrwsz7oZXkpkZM5a3MDBxksMfSQ103ej4e+l7NA= github.com/ipfs/interface-go-ipfs-core v0.11.0/go.mod h1:xmnoccUXY7N/Q8AIx0vFqgW926/FAZ8+do/1NTEHKsU= +github.com/ipfs/kubo v0.19.1 h1:jQmwct9gurfZcpShmfwZf/0CXSgxgTVWJxx//l4Ob3M= github.com/ipfs/kubo v0.19.1/go.mod h1:jD1cb+H5ax9EzxLflHG8dz5LHfuAMO+r00/h3MwYkd4= +github.com/ipld/edelweiss v0.2.0 h1:KfAZBP8eeJtrLxLhi7r3N0cBCo7JmwSRhOJp3WSpNjk= github.com/ipld/edelweiss v0.2.0/go.mod h1:FJAzJRCep4iI8FOFlRriN9n0b7OuX3T/S9++NpBDmA4= +github.com/ipld/go-car v0.5.0 h1:kcCEa3CvYMs0iE5BzD5sV7O2EwMiCIp3uF8tA6APQT8= +github.com/ipld/go-car/v2 v2.5.1 h1:U2ux9JS23upEgrJScW8VQuxmE94560kYxj9CQUpcfmk= github.com/ipld/go-codec-dagpb v1.3.0/go.mod h1:ga4JTU3abYApDC3pZ00BC2RSvC3qfBb9MSJkMLSwnhA= +github.com/ipld/go-codec-dagpb v1.5.0 h1:RspDRdsJpLfgCI0ONhTAnbHdySGD4t+LHSPK4X1+R0k= github.com/ipld/go-codec-dagpb v1.5.0/go.mod h1:0yRIutEFD8o1DGVqw4RSHh+BUTlJA9XWldxaaWR/o4g= github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= github.com/ipld/go-ipld-prime v0.14.1/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0= +github.com/ipld/go-ipld-prime v0.19.0 h1:5axC7rJmPc17Emw6TelxGwnzALk0PdupZ2oj2roDj04= github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= @@ -670,13 +857,18 @@ github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0Gqw github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= +github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= +github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c h1:uUx61FiAa1GI6ZmVd2wf2vULeQZIKG66eybjNXKYCz4= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= +github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= @@ -688,9 +880,13 @@ github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0 github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -700,15 +896,20 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/clock v0.0.0-20180524022203-d293bb356ca4/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9 h1:Y+lzErDTURqeXqlqYi4YBYbDd7ycU74gW1ADt57/bgY= github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0 h1:+WWUkhnTjV6RNOxkcwk79qrjeyHEHvBzlneueBsatX4= github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0/go.mod h1:hpGvhGHPVbNBraRLZEhoQwFLMrjK8PSlO4D3nDjKYXo= github.com/juju/utils v0.0.0-20180808125547-9dfc6dbfb02b/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= @@ -731,45 +932,59 @@ github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= +github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= +github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= +github.com/libp2p/go-doh-resolver v0.4.0 h1:gUBa1f1XsPwtpE1du0O+nnZCUqtG7oYi7Bb+0S7FQqw= github.com/libp2p/go-doh-resolver v0.4.0/go.mod h1:v1/jwsFusgsWIGX/c6vCRrnJ60x7bhTiq/fs2qt0cAg= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= +github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= @@ -778,7 +993,9 @@ github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xS github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0= +github.com/libp2p/go-libp2p v0.27.8 h1:IX5x/4yKwyPQeVS2AXHZ3J4YATM9oHBGH1gBc23jBAI= github.com/libp2p/go-libp2p v0.27.8/go.mod h1:eCFFtd0s5i/EVKR7+5Ki8bM7qwkNW3TPTTSSW9sz8NE= +github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLEQHwOCZ7s8s= github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= @@ -820,8 +1037,10 @@ github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFT github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-kad-dht v0.21.1 h1:xpfp8/t9+X2ip1l8Umap1/UGNnJ3RHJgKGAEsnRAlTo= github.com/libp2p/go-libp2p-kad-dht v0.21.1/go.mod h1:Oy8wvbdjpB70eS5AaFaI68tOtrdo3KylTvXDjikxqFo= github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= +github.com/libp2p/go-libp2p-kbucket v0.5.0 h1:g/7tVm8ACHDxH29BGrpsQlnNeu+6OF1A9bno/4/U1oA= github.com/libp2p/go-libp2p-kbucket v0.5.0/go.mod h1:zGzGCpQd78b5BNTDGHNDLaTt9aDK/A02xeZp9QeFC4U= github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= @@ -845,11 +1064,15 @@ github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRj github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= +github.com/libp2p/go-libp2p-pubsub v0.9.0 h1:mcLb4WzwhUG4OKb0rp1/bYMd/DYhvMyzJheQH3LMd1s= github.com/libp2p/go-libp2p-pubsub v0.9.0/go.mod h1:OEsj0Cc/BpkqikXRTrVspWU/Hx7bMZwHP+6vNMd+c7I= +github.com/libp2p/go-libp2p-pubsub-router v0.6.0 h1:D30iKdlqDt5ZmLEYhHELCMRj8b4sFAqrUcshIUvVP/s= github.com/libp2p/go-libp2p-pubsub-router v0.6.0/go.mod h1:FY/q0/RBTKsLA7l4vqC2cbRbOvyDotg8PJQ7j8FDudE= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= +github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk= +github.com/libp2p/go-libp2p-routing-helpers v0.6.2 h1:u6SWfX+3LoqqTAFxWVl79RkcIDE3Zsay5d+JohlEBaE= github.com/libp2p/go-libp2p-routing-helpers v0.6.2/go.mod h1:R289GUxUMzRXIbWGSuUUTPrlVJZ3Y/pPz495+qgXJX8= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= @@ -869,11 +1092,13 @@ github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= +github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= +github.com/libp2p/go-libp2p-xor v0.1.0 h1:hhQwT4uGrBcuAkUGXADuPltalOdpf9aag9kaYNT2tLA= github.com/libp2p/go-libp2p-xor v0.1.0/go.mod h1:LSTM5yRnjGZbWNTA/hRwq2gGFrvRIbQJscoIL/u6InY= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= github.com/libp2p/go-libp2p-yamux v0.2.1/go.mod h1:1FBXiHDk1VyRM1C0aez2bCfHQ4vMZKkAQzZbkSQt5fI= @@ -893,20 +1118,24 @@ github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3 github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= +github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY= github.com/libp2p/go-mplex v0.7.0/go.mod h1:rW8ThnRcYWft/Jb2jeORBmPd6xuG3dGxWN/W168L9EU= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= +github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= +github.com/libp2p/go-nat v0.1.0 h1:MfVsH6DLcpa04Xr+p8hmVRG4juse0s3J8HyNWYHffXg= github.com/libp2p/go-nat v0.1.0/go.mod h1:X7teVkwRHNInVNWQiO/tAiAVRwSr5zoRz4YSTC3uRBM= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= +github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= @@ -915,6 +1144,7 @@ github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= +github.com/libp2p/go-reuseport v0.2.0 h1:18PRvIMlpY6ZK85nIAicSBuXXvrYoSw3dsBAR7zc560= github.com/libp2p/go-reuseport v0.2.0/go.mod h1:bvVho6eLMm6Bz5hmU0LYN3ixd3nPPvtIlaURZZgOY4k= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= @@ -943,27 +1173,33 @@ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= +github.com/libp2p/go-yamux/v4 v4.0.0 h1:+Y80dV2Yx/kv7Y7JKu0LECyVdMXm1VUoko+VQ9rBfZQ= github.com/libp2p/go-yamux/v4 v4.0.0/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= +github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q= github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easygo v0.0.0-20190618140210-3c14a0dc985f h1:4+gHs0jJFJ06bfN8PshnM6cHcxGjRUVRLo5jndDiKRQ= github.com/mailru/easygo v0.0.0-20190618140210-3c14a0dc985f/go.mod h1:tHCZHV8b2A90ObojrEAzY0Lb03gxUxjDHr5IJyAh4ew= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -975,13 +1211,17 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -992,9 +1232,13 @@ github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= +github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= github.com/miekg/dns v1.1.53/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= @@ -1003,11 +1247,14 @@ github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -1017,25 +1264,34 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= @@ -1048,13 +1304,16 @@ github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= +github.com/multiformats/go-multiaddr v0.12.1 h1:vm+BA/WZA8QZDp1pF1FWhi5CT3g1tbi5GJmqpb6wnlk= github.com/multiformats/go-multiaddr v0.12.1/go.mod h1:7mPkiBMmLeFipt+nNSq9pHZUeJSt8lHBgH6yhj0YQzE= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= github.com/multiformats/go-multiaddr-dns v0.3.0/go.mod h1:mNzQ4eTGDg0ll1N9jKPOUogZPoJ30W8a7zk66FQPpdQ= +github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= +github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= github.com/multiformats/go-multiaddr-net v0.0.1/go.mod h1:nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU= github.com/multiformats/go-multiaddr-net v0.1.0/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= @@ -1066,8 +1325,10 @@ github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysj github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= +github.com/multiformats/go-multicodec v0.8.1 h1:ycepHwavHafh3grIbR1jIXnKCsFm0fqsfEOsJ8NtKE8= github.com/multiformats/go-multicodec v0.8.1/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= @@ -1077,16 +1338,19 @@ github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUj github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= +github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= +github.com/multiformats/go-multistream v0.4.1 h1:rFy0Iiyn3YT0asivDUIR05leAdwZq3de4741sbiSdfo= github.com/multiformats/go-multistream v0.4.1/go.mod h1:Mz5eykRVAjJWckE2U78c6xqdtyNUEhKSM0Lwar2p77Q= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1102,10 +1366,12 @@ github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1115,7 +1381,9 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1124,41 +1392,53 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw= github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4= github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1168,6 +1448,7 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1175,6 +1456,7 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1182,6 +1464,7 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1190,41 +1473,57 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/qtls-go1-19 v0.3.3 h1:wznEHvJwd+2X3PqftRha0SUKmGsnb6dfArMhy9PeJVE= github.com/quic-go/qtls-go1-19 v0.3.3/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= +github.com/quic-go/qtls-go1-20 v0.2.3 h1:m575dovXn1y2ATOb1XrRFcrv0F+EQmlowTkoraNkDPI= github.com/quic-go/qtls-go1-20 v0.2.3/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y0= github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA= +github.com/quic-go/webtransport-go v0.5.2 h1:GA6Bl6oZY+g/flt00Pnu0XtivSD8vukOu3lYhJjnGEk= github.com/quic-go/webtransport-go v0.5.2/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU= +github.com/r3labs/diff/v3 v3.0.1 h1:CBKqf3XmNRHXKmdU7mZP1w7TV0pDyVCis1AUHtA4Xtg= github.com/r3labs/diff/v3 v3.0.1/go.mod h1:f1S9bourRbiM66NskseyUdo0fTmEE0qKrikYJX63dgo= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= +github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rhnvrm/simples3 v0.6.1 h1:H0DJwybR6ryQE+Odi9eqkHuzjYAeJgtGcGtuBwOhsH8= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rivo/tview v0.0.0-20230814110005-ccc2c8119703 h1:ZyM/+FYnpbZsFWuCohniM56kRoHRB4r5EuIzXEYkpxo= github.com/rivo/tview v0.0.0-20230814110005-ccc2c8119703/go.mod h1:nVwGv4MP47T0jvlk7KuTTjjuSmrGO4JF0iaiNt4bufE= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/samber/lo v1.36.0 h1:4LaOxH1mHnbDGhTVE0i1z8v/lWaQW8AIfOD3HU4mSaw= github.com/samber/lo v1.36.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= @@ -1256,10 +1555,12 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1269,6 +1570,7 @@ github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1277,9 +1579,11 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1287,6 +1591,7 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1297,25 +1602,35 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= +github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -1325,20 +1640,30 @@ github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= github.com/warpfork/go-testmark v0.9.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= +github.com/warpfork/go-testmark v0.10.0 h1:E86YlUMYfwIacEsQGlnTvjk1IgYkyTGjPhF0RnwTCmw= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= +github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ= github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= +github.com/wealdtech/go-merkletree v1.0.0 h1:DsF1xMzj5rK3pSQM6mPv8jlyJyHXhFxpnA2bwEjMMBY= github.com/wealdtech/go-merkletree v1.0.0/go.mod h1:cdil512d/8ZC7Kx3bfrDvGMQXB25NTKbsm0rFrmDax4= +github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= +github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= +github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o= github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= +github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= @@ -1346,6 +1671,7 @@ github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= github.com/whyrusleeping/mdns v0.0.0-20180901202407-ef14215e6b30/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= +github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -1356,6 +1682,7 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= @@ -1367,7 +1694,9 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw= github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -1382,34 +1711,51 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 h1:7Yxsak1q4XrJ5y7XBnNwqWx9amMZvoidCctv62XOQ6Y= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0/go.mod h1:M1hVZHNxcbkAlcvrOMlpQ4YOO3Awf+4N2dxkZL3xm04= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0 h1:cMDtmgJ5FpRvqx9x2Aq+Mm0O6K/zcUkH73SFz20TuBw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0/go.mod h1:ceUgdyfNv4h4gLxHR0WNfDiiVmZFodZhZSbOLhpxqXE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0 h1:MFAyzUPrTwLOwCi+cltN0ZVyy4phU41lwH+lyMyQTS4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0/go.mod h1:E+/KKhwOSw8yoPxSSuUHG6vKppkvhN+S1Jc7Nib3k3o= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.7.0 h1:pLP0MH4MAqeTEV0g/4flxw9O8Is48uAIauAnjznbW50= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.7.0/go.mod h1:aFXT9Ng2seM9eizF+LfKiyPBGy8xIZKwhusC1gIu3hA= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0 h1:8hPcgCg0rUJiKE6VWahRvjgLUrNl7rW2hffUEPKXVEM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0/go.mod h1:K4GDXPY6TjUiwbOh+DkKaEdCF8y+lvMoM6SeAPyfCCM= +go.opentelemetry.io/otel/exporters/zipkin v1.7.0 h1:X0FZj+kaIdLi29UiyrEGDhRTYsEXj9GdEW5Y39UQFEE= go.opentelemetry.io/otel/exporters/zipkin v1.7.0/go.mod h1:9YBXeOMFLQGwNEjsxMRiWPGoJX83usGMhbCmxUbNe5I= +go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.16.0 h1:WHzDWdXUvbc5bG2ObdrGfaNpQz7ft7QN9HHmJlbiB1E= go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/dig v1.16.1 h1:+alNIBsl0qfY0j6epRubp/9obgtrObRAc5aD+6jbWY8= go.uber.org/dig v1.16.1/go.mod h1:557JTAUZT5bUK0SvCwikmLPPtdQhfvLYtO5tJgQSbnk= +go.uber.org/fx v1.19.2 h1:SyFgYQFr1Wl0AYstE8vyYIzP4bFz2URrScjwC4cwUvY= go.uber.org/fx v1.19.2/go.mod h1:43G1VcqSzbIv77y00p1DRAsyZS8WdzuYdhZXmEUkMyQ= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1418,8 +1764,10 @@ go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1454,6 +1802,7 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1465,6 +1814,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1490,6 +1840,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1550,6 +1901,7 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1572,6 +1924,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1658,6 +2011,7 @@ golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1671,11 +2025,13 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1688,12 +2044,14 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1755,11 +2113,13 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -1828,8 +2188,11 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1862,6 +2225,7 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1877,6 +2241,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= @@ -1885,6 +2250,7 @@ gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -1895,13 +2261,17 @@ gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/R gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1913,10 +2283,12 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1928,12 +2300,16 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/staker/challenge-cache/cache.go b/staker/challenge-cache/cache.go index 871284f2d1..f3f4ebcd28 100644 --- a/staker/challenge-cache/cache.go +++ b/staker/challenge-cache/cache.go @@ -40,8 +40,6 @@ import ( protocol "github.com/OffchainLabs/bold/chain-abstraction" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" - "github.com/OffchainLabs/bold/mmap" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" ) @@ -60,8 +58,8 @@ var ( // HistoryCommitmentCacher can retrieve history commitment state roots given lookup keys. type HistoryCommitmentCacher interface { - Get(lookup *Key, numToRead uint64) (mmap.Mmap, error) - Put(lookup *Key, stateRoots mmap.Mmap) error + Get(lookup *Key, numToRead uint64) ([]common.Hash, error) + Put(lookup *Key, stateRoots []common.Hash) error } // Cache for history commitments on disk. @@ -127,7 +125,7 @@ type Key struct { func (c *Cache) Get( lookup *Key, numToRead uint64, -) (mmap.Mmap, error) { +) ([]common.Hash, error) { fName, err := determineFilePath(c.baseDir, lookup) if err != nil { return nil, err @@ -153,7 +151,7 @@ func (c *Cache) Get( // State roots are saved as files in a directory hierarchy for the cache. // This function first creates a temporary file, writes the state roots to it, and then renames the file // to the final directory to ensure atomic writes. -func (c *Cache) Put(lookup *Key, stateRoots mmap.Mmap) error { +func (c *Cache) Put(lookup *Key, stateRoots []common.Hash) error { // We should error if trying to put 0 state roots to disk. if len(stateRoots) == 0 { return ErrNoStateRoots @@ -195,15 +193,11 @@ func (c *Cache) Put(lookup *Key, stateRoots mmap.Mmap) error { } // Reads 32 bytes at a time from a reader up to a specified height. If none, then read all. -func readStateRoots(r io.Reader, numToRead uint64) (mmap.Mmap, error) { +func readStateRoots(r io.Reader, numToRead uint64) ([]common.Hash, error) { br := bufio.NewReader(r) - stateRootsMmap, err := mmap.NewMmap(int(numToRead)) - if err != nil { - return nil, err - } + stateRoots := make([]common.Hash, 0) buf := make([]byte, 0, 32) - var totalRead uint64 - for totalRead = uint64(0); totalRead < numToRead; totalRead++ { + for totalRead := uint64(0); totalRead < numToRead; totalRead++ { n, err := br.Read(buf[:cap(buf)]) if err != nil { // If we try to read but reach EOF, we break out of the loop. @@ -216,30 +210,30 @@ func readStateRoots(r io.Reader, numToRead uint64) (mmap.Mmap, error) { if n != 32 { return nil, fmt.Errorf("expected to read 32 bytes, got %d bytes", n) } - stateRootsMmap.Set(int(totalRead), common.BytesToHash(buf)) + stateRoots = append(stateRoots, common.BytesToHash(buf)) } - if protocol.Height(numToRead) > protocol.Height(totalRead) { + if protocol.Height(numToRead) > protocol.Height(len(stateRoots)) { return nil, fmt.Errorf( "wanted to read %d roots, but only read %d state roots", numToRead, - totalRead, + len(stateRoots), ) } - return stateRootsMmap, nil + return stateRoots, nil } -func writeStateRoots(w io.Writer, stateRoots mmap.Mmap) error { - for i := 0; i < stateRoots.Length(); i++ { - n, err := w.Write(stateRoots.Get(i).Bytes()) +func writeStateRoots(w io.Writer, stateRoots []common.Hash) error { + for i, rt := range stateRoots { + n, err := w.Write(rt[:]) if err != nil { return err } - if n != len(stateRoots.Get(i)) { + if n != len(rt) { return fmt.Errorf( "for state root %d, wrote %d bytes, expected to write %d bytes", i, n, - len(stateRoots.Get(i)), + len(rt), ) } } diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index ac100b66c4..8267e9a3a5 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -12,8 +12,6 @@ import ( "testing" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" - "github.com/OffchainLabs/bold/mmap" - "github.com/ethereum/go-ethereum/common" ) @@ -45,19 +43,16 @@ func TestCache(t *testing.T) { } }) t.Run("Putting empty root fails", func(t *testing.T) { - if err := cache.Put(key, mmap.Mmap{}); !errors.Is(err, ErrNoStateRoots) { + if err := cache.Put(key, []common.Hash{}); !errors.Is(err, ErrNoStateRoots) { t.Fatalf("Unexpected error: %v", err) } }) - want, err := mmap.NewMmap(3) - want.Set(0, common.BytesToHash([]byte("foo"))) - want.Set(1, common.BytesToHash([]byte("bar"))) - want.Set(2, common.BytesToHash([]byte("baz"))) - if err != nil { - t.Fatal(err) + want := []common.Hash{ + common.BytesToHash([]byte("foo")), + common.BytesToHash([]byte("bar")), + common.BytesToHash([]byte("baz")), } - defer want.Free() - err = cache.Put(key, want) + err := cache.Put(key, want) if err != nil { t.Fatal(err) } @@ -97,7 +92,7 @@ func TestReadWriteStateRoots(t *testing.T) { if len(roots) == 0 { t.Fatal("Got no roots") } - if roots.Get(0) != want { + if roots[0] != want { t.Fatalf("Wrong root. Expected %#x, got %#x", want, roots[0]) } }) @@ -113,30 +108,24 @@ func TestReadWriteStateRoots(t *testing.T) { if err != nil { t.Fatal(err) } - if roots.Length() != 2 { + if len(roots) != 2 { t.Fatalf("Expected two roots, got %d", len(roots)) } - if roots.Get(0) != foo { + if roots[0] != foo { t.Fatalf("Wrong root. Expected %#x, got %#x", foo, roots[0]) } - if roots.Get(1) != bar { + if roots[1] != bar { t.Fatalf("Wrong root. Expected %#x, got %#x", bar, roots[1]) } }) t.Run("Fails to write enough data to writer", func(t *testing.T) { m := &mockWriter{wantErr: true} - stateRoots, err := mmap.NewMmap(1) - if err != nil { - t.Fatal(err) - } - defer stateRoots.Free() - stateRoots.Set(0, common.BytesToHash([]byte("foo"))) - err = writeStateRoots(m, stateRoots) + err := writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) if err == nil { t.Fatal("Wanted error") } m = &mockWriter{wantErr: false, numWritten: 16} - err = writeStateRoots(m, stateRoots) + err = writeStateRoots(m, []common.Hash{common.BytesToHash([]byte("foo"))}) if err == nil { t.Fatal("Wanted error") } @@ -235,11 +224,11 @@ func Test_readStateRoots(t *testing.T) { if err != nil { t.Fatal(err) } - if len(want) != got.Length() { + if len(want) != len(got) { t.Fatal("Wrong number of roots") } - for i := 0; i < got.Length(); i++ { - if got.Get(i) != want[i] { + for i, rt := range got { + if rt != want[i] { t.Fatal("Wrong root") } } @@ -314,15 +303,11 @@ func BenchmarkCache_Read_32Mb(b *testing.B) { StepHeights: []l2stateprovider.Height{l2stateprovider.Height(0)}, } numRoots := 1 << 20 - rootsMmap, err := mmap.NewMmap(numRoots) - if err != nil { - b.Fatal(err) - } - defer rootsMmap.Free() - for i := 0; i < numRoots; i++ { - rootsMmap.Set(i, common.BytesToHash([]byte(fmt.Sprintf("%d", i)))) + roots := make([]common.Hash, numRoots) + for i := range roots { + roots[i] = common.BytesToHash([]byte(fmt.Sprintf("%d", i))) } - if err := cache.Put(key, rootsMmap); err != nil { + if err := cache.Put(key, roots); err != nil { b.Fatal(err) } b.StartTimer() diff --git a/staker/state_provider.go b/staker/state_provider.go index e1b0081b73..c478e57332 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" flag "github.com/spf13/pflag" @@ -19,7 +20,6 @@ import ( "github.com/OffchainLabs/bold/challenge-manager/types" "github.com/OffchainLabs/bold/containers/option" l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider" - "github.com/OffchainLabs/bold/mmap" "github.com/offchainlabs/nitro/arbutil" challengecache "github.com/offchainlabs/nitro/staker/challenge-cache" @@ -46,6 +46,10 @@ type BoldConfig struct { AssertionScanningInterval time.Duration `koanf:"assertion-scanning-interval"` AssertionConfirmingInterval time.Duration `koanf:"assertion-confirming-interval"` EdgeTrackerWakeInterval time.Duration `koanf:"edge-tracker-wake-interval"` + API bool `koanf:"api"` + APIHost string `koanf:"api-host"` + APIPort uint16 `koanf:"api-port"` + APIDBPath string `koanf:"api-db-path"` } var DefaultBoldConfig = BoldConfig{ @@ -57,6 +61,10 @@ var DefaultBoldConfig = BoldConfig{ AssertionScanningInterval: 30 * time.Second, AssertionConfirmingInterval: 60 * time.Second, EdgeTrackerWakeInterval: 1 * time.Second, + API: false, + APIHost: "localhost", + APIPort: 8080, + APIDBPath: "/tmp/api-db", } var BoldModes = map[string]types.Mode{ @@ -75,6 +83,10 @@ func BoldConfigAddOptions(prefix string, f *flag.FlagSet) { f.Duration(prefix+".assertion-scanning-interval", DefaultBoldConfig.AssertionScanningInterval, "interval for scanning assertions") f.Duration(prefix+".assertion-confirming-interval", DefaultBoldConfig.AssertionConfirmingInterval, "interval for confirming assertions") f.Duration(prefix+".edge-tracker-wake-interval", DefaultBoldConfig.EdgeTrackerWakeInterval, "interval for waking edge tracker") + f.Bool(prefix+".api", DefaultBoldConfig.API, "enable api") + f.String(prefix+".api-host", DefaultBoldConfig.APIHost, "api host") + f.Uint16(prefix+".api-port", DefaultBoldConfig.APIPort, "api port") + f.String(prefix+".api-db-path", DefaultBoldConfig.APIDBPath, "api db path") } type StateManager struct { @@ -187,7 +199,7 @@ func (s *StateManager) StatesInBatchRange( toHeight l2stateprovider.Height, fromBatch, toBatch l2stateprovider.Batch, -) (mmap.Mmap, error) { +) ([]common.Hash, error) { // Check the integrity of the arguments. if fromBatch >= toBatch { return nil, fmt.Errorf("from batch %v cannot be greater than or equal to batch %v", fromBatch, toBatch) @@ -196,9 +208,9 @@ func (s *StateManager) StatesInBatchRange( return nil, fmt.Errorf("from height %v cannot be greater than to height %v", fromHeight, toHeight) } // Compute the total desired hashes from this request. - totalDesiredHashes := int(toHeight) + 1 + totalDesiredHashes := (toHeight - fromHeight) + 1 - // Get the fromBatch's message count. + // Get the from batch's message count. prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(fromBatch) - 1) if err != nil { return nil, err @@ -213,18 +225,12 @@ func (s *StateManager) StatesInBatchRange( Batch: uint64(fromBatch), PosInBatch: 0, } - machineHashesMmap, err := mmap.NewMmap(int(totalDesiredHashes)) - numStateRoots := 0 - if err != nil { - return nil, err - } - machineHashesMmap.Set(numStateRoots, machineHash(startState)) - numStateRoots++ + machineHashes := []common.Hash{machineHash(startState)} + states := []validator.GoGlobalState{startState} for batch := fromBatch; batch < toBatch; batch++ { batchMessageCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(batch)) if err != nil { - machineHashesMmap.Free() return nil, err } messagesInBatch := batchMessageCount - prevBatchMsgCount @@ -235,11 +241,10 @@ func (s *StateManager) StatesInBatchRange( messageCount := msgIndex + 1 executionResult, err := s.validator.streamer.ResultAtCount(arbutil.MessageIndex(messageCount)) if err != nil { - machineHashesMmap.Free() return nil, err } // If the position in batch is equal to the number of messages in the batch, - // we do not include this state, instead, we break and include the state + // we do not include this state. Instead, we break and include the state // that fully consumes the batch. if i+1 == uint64(messagesInBatch) { break @@ -250,17 +255,13 @@ func (s *StateManager) StatesInBatchRange( Batch: uint64(batch), PosInBatch: i + 1, } - if numStateRoots >= totalDesiredHashes { - break - } - machineHashesMmap.Set(numStateRoots, machineHash(state)) - numStateRoots++ + states = append(states, state) + machineHashes = append(machineHashes, machineHash(state)) } // Fully consume the batch. executionResult, err := s.validator.streamer.ResultAtCount(batchMessageCount) if err != nil { - machineHashesMmap.Free() return nil, err } state := validator.GoGlobalState{ @@ -269,18 +270,14 @@ func (s *StateManager) StatesInBatchRange( Batch: uint64(batch) + 1, PosInBatch: 0, } - if numStateRoots >= totalDesiredHashes { - break - } - machineHashesMmap.Set(numStateRoots, machineHash(state)) - numStateRoots++ + states = append(states, state) + machineHashes = append(machineHashes, machineHash(state)) prevBatchMsgCount = batchMessageCount } - lastMachineHashes := machineHashesMmap.Get(numStateRoots - 1) - for i := numStateRoots; i < totalDesiredHashes; i++ { - machineHashesMmap.Set(i, lastMachineHashes) + for uint64(len(machineHashes)) < uint64(totalDesiredHashes) { + machineHashes = append(machineHashes, machineHashes[len(machineHashes)-1]) } - return machineHashesMmap.SubMmap(int(fromHeight), int(toHeight+1)), nil + return machineHashes[fromHeight : toHeight+1], nil } func machineHash(gs validator.GoGlobalState) common.Hash { @@ -320,7 +317,7 @@ func (s *StateManager) L2MessageStatesUpTo( toHeight option.Option[l2stateprovider.Height], fromBatch, toBatch l2stateprovider.Batch, -) (mmap.Mmap, error) { +) ([]common.Hash, error) { var to l2stateprovider.Height if !toHeight.IsNone() { to = toHeight.Unwrap() @@ -338,14 +335,14 @@ func (s *StateManager) L2MessageStatesUpTo( // CollectMachineHashes Collects a list of machine hashes at a message number based on some configuration parameters. func (s *StateManager) CollectMachineHashes( ctx context.Context, cfg *l2stateprovider.HashCollectorConfig, -) (mmap.Mmap, error) { +) ([]common.Hash, error) { s.Lock() defer s.Unlock() prevBatchMsgCount, err := s.validator.inboxTracker.GetBatchMessageCount(uint64(cfg.FromBatch - 1)) if err != nil { return nil, fmt.Errorf("could not get batch message count at %d: %w", cfg.FromBatch, err) } - messageNum := prevBatchMsgCount + arbutil.MessageIndex(cfg.BlockChallengeHeight) + messageNum := (prevBatchMsgCount + arbutil.MessageIndex(cfg.BlockChallengeHeight)) cacheKey := &challengecache.Key{ WavmModuleRoot: cfg.WasmModuleRoot, MessageHeight: protocol.Height(messageNum), @@ -368,7 +365,7 @@ func (s *StateManager) CollectMachineHashes( if err != nil { return nil, err } - execRun, err := s.validator.execSpawner.CreateExecutionRun(cfg.WasmModuleRoot, input).Await(ctx) + execRun, err := s.validator.execSpawner.CreateBoldExecutionRun(cfg.WasmModuleRoot, uint64(cfg.StepSize), input).Await(ctx) if err != nil { return nil, err } @@ -377,6 +374,7 @@ func (s *StateManager) CollectMachineHashes( if err != nil { return nil, err } + log.Info(fmt.Sprintf("Finished gathering machine hashes for request %+v", cfg)) // Do not save a history commitment of length 1 to the cache. if len(result) > 1 && s.historyCache != nil { if err := s.historyCache.Put(cacheKey, result); err != nil { @@ -400,7 +398,7 @@ func (s *StateManager) CollectProof( if err != nil { return nil, err } - messageNum := prevBatchMsgCount + arbutil.MessageIndex(blockChallengeHeight) + messageNum := (prevBatchMsgCount + arbutil.MessageIndex(blockChallengeHeight)) entry, err := s.validator.CreateReadyValidationEntry(ctx, messageNum) if err != nil { return nil, err diff --git a/system_tests/validation_mock_test.go b/system_tests/validation_mock_test.go index 1ba8ccbff0..e10133aac7 100644 --- a/system_tests/validation_mock_test.go +++ b/system_tests/validation_mock_test.go @@ -7,8 +7,6 @@ import ( "testing" "time" - "github.com/OffchainLabs/bold/mmap" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" @@ -88,6 +86,10 @@ func (s *mockSpawner) WriteToFile(input *validator.ValidationInput, expOut valid return containers.NewReadyPromise[struct{}](struct{}{}, nil) } +func (s *mockSpawner) CreateBoldExecutionRun(wasmModuleRoot common.Hash, stepSize uint64, input *validator.ValidationInput) containers.PromiseInterface[validator.ExecutionRun] { + return containers.NewReadyPromise[validator.ExecutionRun](nil, nil) +} + type mockValRun struct { containers.Promise[validator.GoGlobalState] root common.Hash @@ -119,9 +121,9 @@ func (r *mockExecRun) GetStepAt(position uint64) containers.PromiseInterface[*va }, nil) } -func (r *mockExecRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] { +func (r *mockExecRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { // TODO: Add mock implementation for GetLeavesWithStepSize - return containers.NewReadyPromise[mmap.Mmap](nil, nil) + return containers.NewReadyPromise[[]common.Hash](nil, nil) } func (r *mockExecRun) GetLastStep() containers.PromiseInterface[*validator.MachineStepResult] { diff --git a/validator/interface.go b/validator/interface.go index 2a1eb4f5d2..4ff0f332f1 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -3,8 +3,6 @@ package validator import ( "context" - "github.com/OffchainLabs/bold/mmap" - "github.com/ethereum/go-ethereum/common" "github.com/offchainlabs/nitro/util/containers" @@ -26,13 +24,14 @@ type ValidationRun interface { type ExecutionSpawner interface { ValidationSpawner CreateExecutionRun(wasmModuleRoot common.Hash, input *ValidationInput) containers.PromiseInterface[ExecutionRun] + CreateBoldExecutionRun(wasmModuleRoot common.Hash, stepSize uint64, input *ValidationInput) containers.PromiseInterface[ExecutionRun] LatestWasmModuleRoot() containers.PromiseInterface[common.Hash] WriteToFile(input *ValidationInput, expOut GoGlobalState, moduleRoot common.Hash) containers.PromiseInterface[struct{}] } type ExecutionRun interface { GetStepAt(uint64) containers.PromiseInterface[*MachineStepResult] - GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] + GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] GetLastStep() containers.PromiseInterface[*MachineStepResult] GetProofAt(uint64) containers.PromiseInterface[[]byte] PrepareRange(uint64, uint64) containers.PromiseInterface[struct{}] diff --git a/validator/server_api/validation_api.go b/validator/server_api/validation_api.go index 36aaeca1bf..ea6912234b 100644 --- a/validator/server_api/validation_api.go +++ b/validator/server_api/validation_api.go @@ -13,8 +13,6 @@ import ( "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" "github.com/offchainlabs/nitro/validator/server_arb" - - "github.com/OffchainLabs/bold/mmap" ) const Namespace string = "validation" @@ -71,6 +69,23 @@ func NewExecutionServerAPI(valSpawner validator.ValidationSpawner, execution val } } +func (a *ExecServerAPI) CreateBoldExecutionRun(ctx context.Context, wasmModuleRoot common.Hash, stepSize uint64, jsonInput *ValidationInputJson) (uint64, error) { + input, err := ValidationInputFromJson(jsonInput) + if err != nil { + return 0, err + } + execRun, err := a.execSpawner.CreateBoldExecutionRun(wasmModuleRoot, stepSize, input).Await(ctx) + if err != nil { + return 0, err + } + a.runIdLock.Lock() + defer a.runIdLock.Unlock() + newId := a.nextId + a.nextId++ + a.runs[newId] = &execRunEntry{execRun, time.Now()} + return newId, nil +} + func (a *ExecServerAPI) CreateExecutionRun(ctx context.Context, wasmModuleRoot common.Hash, jsonInput *ValidationInputJson) (uint64, error) { input, err := ValidationInputFromJson(jsonInput) if err != nil { @@ -144,7 +159,7 @@ func (a *ExecServerAPI) GetStepAt(ctx context.Context, execid uint64, position u return MachineStepResultToJson(res), nil } -func (a *ExecServerAPI) GetLeavesWithStepSize(ctx context.Context, execid, fromStep, stepSize, numDesiredLeaves uint64) (mmap.Mmap, error) { +func (a *ExecServerAPI) GetLeavesWithStepSize(ctx context.Context, execid, fromStep, stepSize, numDesiredLeaves uint64) ([]common.Hash, error) { run, err := a.getRun(execid) if err != nil { return nil, err diff --git a/validator/server_api/validation_client.go b/validator/server_api/validation_client.go index 8d0ddf06ba..108f25e6f7 100644 --- a/validator/server_api/validation_client.go +++ b/validator/server_api/validation_client.go @@ -7,8 +7,6 @@ import ( "sync/atomic" "time" - "github.com/OffchainLabs/bold/mmap" - "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/rpcclient" "github.com/offchainlabs/nitro/util/stopwaiter" @@ -108,6 +106,22 @@ func NewExecutionClient(config rpcclient.ClientConfigFetcher, stack *node.Node) } } +func (c *ExecutionClient) CreateBoldExecutionRun(wasmModuleRoot common.Hash, stepSize uint64, input *validator.ValidationInput) containers.PromiseInterface[validator.ExecutionRun] { + return stopwaiter.LaunchPromiseThread[validator.ExecutionRun](c, func(ctx context.Context) (validator.ExecutionRun, error) { + var res uint64 + err := c.client.CallContext(ctx, &res, Namespace+"_createBoldExecutionRun", wasmModuleRoot, stepSize, ValidationInputToJson(input)) + if err != nil { + return nil, err + } + run := &ExecutionClientRun{ + client: c, + id: res, + } + run.Start(c.GetContext()) // note: not this temporary thread's context! + return run, nil + }) +} + func (c *ExecutionClient) CreateExecutionRun(wasmModuleRoot common.Hash, input *validator.ValidationInput) containers.PromiseInterface[validator.ExecutionRun] { return stopwaiter.LaunchPromiseThread[validator.ExecutionRun](c, func(ctx context.Context) (validator.ExecutionRun, error) { var res uint64 @@ -177,9 +191,9 @@ func (r *ExecutionClientRun) GetStepAt(pos uint64) containers.PromiseInterface[* }) } -func (r *ExecutionClientRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] { - return stopwaiter.LaunchPromiseThread[mmap.Mmap](r, func(ctx context.Context) (mmap.Mmap, error) { - var resJson mmap.Mmap +func (r *ExecutionClientRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](r, func(ctx context.Context) ([]common.Hash, error) { + var resJson []common.Hash err := r.client.client.CallContext(ctx, &resJson, Namespace+"_getLeavesWithStepSize", r.id, machineStartIndex, stepSize, numDesiredLeaves) if err != nil { return nil, err diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index fdaa0c96e8..f0defae474 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -8,30 +8,35 @@ import ( "fmt" "sync" - "github.com/OffchainLabs/bold/mmap" - + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" + "github.com/offchainlabs/nitro/validator/server_common" ) type executionRun struct { stopwaiter.StopWaiter - cache *MachineCache - close sync.Once + cache *MachineCache + initialMachineGetter func(context.Context, ...server_common.MachineLoaderOpt) (MachineInterface, error) + config *MachineCacheConfig + close sync.Once } // NewExecutionChallengeBackend creates a backend with the given arguments. // Note: machineCache may be nil, but if present, it must not have a restricted range. func NewExecutionRun( ctxIn context.Context, - initialMachineGetter func(context.Context) (MachineInterface, error), + initialMachineGetter func(context.Context, ...server_common.MachineLoaderOpt) (MachineInterface, error), config *MachineCacheConfig, ) (*executionRun, error) { exec := &executionRun{} exec.Start(ctxIn, exec) + exec.initialMachineGetter = initialMachineGetter + exec.config = config exec.cache = NewMachineCache(exec.GetContext(), initialMachineGetter, config) return exec, nil } @@ -58,33 +63,35 @@ func (e *executionRun) GetStepAt(position uint64) containers.PromiseInterface[*v }) } -func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[mmap.Mmap] { - return stopwaiter.LaunchPromiseThread[mmap.Mmap](e, func(ctx context.Context) (mmap.Mmap, error) { +func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { + return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { + if stepSize == 1 { + e.cache = NewMachineCache(e.GetContext(), e.initialMachineGetter, e.config, server_common.WithAlwaysMerkleize()) + log.Info("Enabling Merkleization of machines for faster hashing. However, advancing to start index might take a while...") + } + log.Info(fmt.Sprintf("Starting BOLD machine computation at index %d", machineStartIndex)) machine, err := e.cache.GetMachineAt(ctx, machineStartIndex) if err != nil { return nil, err } + log.Info(fmt.Sprintf("Advanced machine to index %d, beginning hash computation", machineStartIndex)) // If the machine is starting at index 0, we always want to start at the "Machine finished" global state status // to align with the state roots that the inbox machine will produce. - stateRootsMmap, err := mmap.NewMmap(int(numDesiredLeaves)) - numStateRoots := 0 - if err != nil { - return nil, err - } + var stateRoots []common.Hash + if machineStartIndex == 0 { gs := machine.GetGlobalState() hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) - stateRootsMmap.Set(numStateRoots, hash) - numStateRoots++ + stateRoots = append(stateRoots, hash) } else { // Otherwise, we simply append the machine hash at the specified start index. - stateRootsMmap.Set(numStateRoots, machine.Hash()) - numStateRoots++ + stateRoots = append(stateRoots, machine.Hash()) } + startHash := stateRoots[0] // If we only want 1 state root, we can return early. if numDesiredLeaves == 1 { - return stateRootsMmap, nil + return stateRoots, nil } for numIterations := uint64(0); numIterations < numDesiredLeaves; numIterations++ { // The absolute opcode position the machine should be in after stepping. @@ -94,14 +101,39 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes if err := machine.Step(ctx, stepSize); err != nil { return nil, fmt.Errorf("failed to step machine to position %d: %w", position, err) } + + progressPercent := (float64(numIterations+1) / float64(numDesiredLeaves)) * 100 + log.Info( + fmt.Sprintf( + "Computing subchallenge machine hashes progress: %.2f%% leaves gathered (%d/%d)", + progressPercent, + numIterations+1, + numDesiredLeaves, + ), + log.Ctx{ + "stepSize": stepSize, + "startHash": startHash, + "machineStartIndex": machineStartIndex, + "numDesiredLeaves": numDesiredLeaves, + }, + ) + // If the machine reached the finished state, we can break out of the loop and append to // our state roots slice a finished machine hash. machineStep := machine.GetStepCount() if validator.MachineStatus(machine.Status()) == validator.MachineStatusFinished { gs := machine.GetGlobalState() hash := crypto.Keccak256Hash([]byte("Machine finished:"), gs.Hash().Bytes()) - stateRootsMmap.Set(numStateRoots, hash) - numStateRoots++ + stateRoots = append(stateRoots, hash) + log.Info( + "Machine finished execution, gathered all the necessary hashes", + log.Ctx{ + "stepSize": stepSize, + "startHash": startHash, + "machineStartIndex": machineStartIndex, + "numDesiredLeaves": numDesiredLeaves, + }, + ) break } // Otherwise, if the position and machine step mismatch and the machine is running, something went wrong. @@ -111,18 +143,18 @@ func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDes return nil, fmt.Errorf("machine is in wrong position want: %d, got: %d", position, machineStep) } } - stateRootsMmap.Set(numStateRoots, machine.Hash()) - numStateRoots++ + stateRoots = append(stateRoots, machine.Hash()) + } // If the machine finished in less than the number of hashes we anticipate, we pad // to the expected value by repeating the last machine hash until the state roots are the correct // length. - lastStateRoot := stateRootsMmap.Get(numStateRoots - 1) - for i := numStateRoots; i < int(numDesiredLeaves); i++ { - stateRootsMmap.Set(numStateRoots, lastStateRoot) + lastStateRoot := stateRoots[len(stateRoots)-1] + for len(stateRoots) < int(numDesiredLeaves) { + stateRoots = append(stateRoots, lastStateRoot) } - return stateRootsMmap.SubMmap(0, int(numDesiredLeaves)), nil + return stateRoots[:numDesiredLeaves], nil }) } From 35f061e900f52fc66509ec698b118feaf94bd0a9 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:01:47 +0530 Subject: [PATCH 120/126] fixes --- staker/challenge-cache/cache_test.go | 2 +- staker/state_provider.go | 2 +- system_tests/staker_test.go | 7 ++++++- system_tests/validation_mock_test.go | 4 ---- validator/interface.go | 1 - validator/server_api/validation_api.go | 17 ----------------- validator/server_api/validation_client.go | 16 ---------------- validator/server_arb/execution_run.go | 17 +++-------------- 8 files changed, 11 insertions(+), 55 deletions(-) diff --git a/staker/challenge-cache/cache_test.go b/staker/challenge-cache/cache_test.go index 8267e9a3a5..68491ebaa2 100644 --- a/staker/challenge-cache/cache_test.go +++ b/staker/challenge-cache/cache_test.go @@ -52,7 +52,7 @@ func TestCache(t *testing.T) { common.BytesToHash([]byte("bar")), common.BytesToHash([]byte("baz")), } - err := cache.Put(key, want) + err = cache.Put(key, want) if err != nil { t.Fatal(err) } diff --git a/staker/state_provider.go b/staker/state_provider.go index c478e57332..e0fc93392e 100644 --- a/staker/state_provider.go +++ b/staker/state_provider.go @@ -365,7 +365,7 @@ func (s *StateManager) CollectMachineHashes( if err != nil { return nil, err } - execRun, err := s.validator.execSpawner.CreateBoldExecutionRun(cfg.WasmModuleRoot, uint64(cfg.StepSize), input).Await(ctx) + execRun, err := s.validator.execSpawner.CreateExecutionRun(cfg.WasmModuleRoot, input).Await(ctx) if err != nil { return nil, err } diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index 12752c6943..1caee96fe5 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -567,7 +567,11 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, *Nod valConfig.Bold.Enable = true valConfig.StakerInterval = 100 * time.Millisecond - dp, err := arbnode.StakerDataposter(ctx, rawdb.NewTable(l2node.ArbDB, storage.StakerPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) + parentChainID, err := builder.L1.Client.ChainID(ctx) + if err != nil { + t.Fatalf("Failed to get parent chain id: %v", err) + } + dp, err := arbnode.StakerDataposter(ctx, rawdb.NewTable(l2node.ArbDB, storage.StakerPrefix), l2node.L1Reader, &l1auth, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil, parentChainID) if err != nil { t.Fatalf("Error creating validator dataposter: %v", err) } @@ -583,6 +587,7 @@ func setupNonBoldStaker(t *testing.T, ctx context.Context) (*staker.Staker, *Nod l2node.Execution, l2node.ArbDB, nil, + nil, StaticFetcherFrom(t, &blockValidatorConfig), valStack, ) diff --git a/system_tests/validation_mock_test.go b/system_tests/validation_mock_test.go index e10133aac7..f3bb6d505a 100644 --- a/system_tests/validation_mock_test.go +++ b/system_tests/validation_mock_test.go @@ -86,10 +86,6 @@ func (s *mockSpawner) WriteToFile(input *validator.ValidationInput, expOut valid return containers.NewReadyPromise[struct{}](struct{}{}, nil) } -func (s *mockSpawner) CreateBoldExecutionRun(wasmModuleRoot common.Hash, stepSize uint64, input *validator.ValidationInput) containers.PromiseInterface[validator.ExecutionRun] { - return containers.NewReadyPromise[validator.ExecutionRun](nil, nil) -} - type mockValRun struct { containers.Promise[validator.GoGlobalState] root common.Hash diff --git a/validator/interface.go b/validator/interface.go index 4ff0f332f1..da56be7ffb 100644 --- a/validator/interface.go +++ b/validator/interface.go @@ -24,7 +24,6 @@ type ValidationRun interface { type ExecutionSpawner interface { ValidationSpawner CreateExecutionRun(wasmModuleRoot common.Hash, input *ValidationInput) containers.PromiseInterface[ExecutionRun] - CreateBoldExecutionRun(wasmModuleRoot common.Hash, stepSize uint64, input *ValidationInput) containers.PromiseInterface[ExecutionRun] LatestWasmModuleRoot() containers.PromiseInterface[common.Hash] WriteToFile(input *ValidationInput, expOut GoGlobalState, moduleRoot common.Hash) containers.PromiseInterface[struct{}] } diff --git a/validator/server_api/validation_api.go b/validator/server_api/validation_api.go index ea6912234b..1848897521 100644 --- a/validator/server_api/validation_api.go +++ b/validator/server_api/validation_api.go @@ -69,23 +69,6 @@ func NewExecutionServerAPI(valSpawner validator.ValidationSpawner, execution val } } -func (a *ExecServerAPI) CreateBoldExecutionRun(ctx context.Context, wasmModuleRoot common.Hash, stepSize uint64, jsonInput *ValidationInputJson) (uint64, error) { - input, err := ValidationInputFromJson(jsonInput) - if err != nil { - return 0, err - } - execRun, err := a.execSpawner.CreateBoldExecutionRun(wasmModuleRoot, stepSize, input).Await(ctx) - if err != nil { - return 0, err - } - a.runIdLock.Lock() - defer a.runIdLock.Unlock() - newId := a.nextId - a.nextId++ - a.runs[newId] = &execRunEntry{execRun, time.Now()} - return newId, nil -} - func (a *ExecServerAPI) CreateExecutionRun(ctx context.Context, wasmModuleRoot common.Hash, jsonInput *ValidationInputJson) (uint64, error) { input, err := ValidationInputFromJson(jsonInput) if err != nil { diff --git a/validator/server_api/validation_client.go b/validator/server_api/validation_client.go index 108f25e6f7..eaeb53df1a 100644 --- a/validator/server_api/validation_client.go +++ b/validator/server_api/validation_client.go @@ -106,22 +106,6 @@ func NewExecutionClient(config rpcclient.ClientConfigFetcher, stack *node.Node) } } -func (c *ExecutionClient) CreateBoldExecutionRun(wasmModuleRoot common.Hash, stepSize uint64, input *validator.ValidationInput) containers.PromiseInterface[validator.ExecutionRun] { - return stopwaiter.LaunchPromiseThread[validator.ExecutionRun](c, func(ctx context.Context) (validator.ExecutionRun, error) { - var res uint64 - err := c.client.CallContext(ctx, &res, Namespace+"_createBoldExecutionRun", wasmModuleRoot, stepSize, ValidationInputToJson(input)) - if err != nil { - return nil, err - } - run := &ExecutionClientRun{ - client: c, - id: res, - } - run.Start(c.GetContext()) // note: not this temporary thread's context! - return run, nil - }) -} - func (c *ExecutionClient) CreateExecutionRun(wasmModuleRoot common.Hash, input *validator.ValidationInput) containers.PromiseInterface[validator.ExecutionRun] { return stopwaiter.LaunchPromiseThread[validator.ExecutionRun](c, func(ctx context.Context) (validator.ExecutionRun, error) { var res uint64 diff --git a/validator/server_arb/execution_run.go b/validator/server_arb/execution_run.go index f0defae474..7be54a4adb 100644 --- a/validator/server_arb/execution_run.go +++ b/validator/server_arb/execution_run.go @@ -15,28 +15,23 @@ import ( "github.com/offchainlabs/nitro/util/containers" "github.com/offchainlabs/nitro/util/stopwaiter" "github.com/offchainlabs/nitro/validator" - "github.com/offchainlabs/nitro/validator/server_common" ) type executionRun struct { stopwaiter.StopWaiter - cache *MachineCache - initialMachineGetter func(context.Context, ...server_common.MachineLoaderOpt) (MachineInterface, error) - config *MachineCacheConfig - close sync.Once + cache *MachineCache + close sync.Once } // NewExecutionChallengeBackend creates a backend with the given arguments. // Note: machineCache may be nil, but if present, it must not have a restricted range. func NewExecutionRun( ctxIn context.Context, - initialMachineGetter func(context.Context, ...server_common.MachineLoaderOpt) (MachineInterface, error), + initialMachineGetter func(context.Context) (MachineInterface, error), config *MachineCacheConfig, ) (*executionRun, error) { exec := &executionRun{} exec.Start(ctxIn, exec) - exec.initialMachineGetter = initialMachineGetter - exec.config = config exec.cache = NewMachineCache(exec.GetContext(), initialMachineGetter, config) return exec, nil } @@ -65,16 +60,10 @@ func (e *executionRun) GetStepAt(position uint64) containers.PromiseInterface[*v func (e *executionRun) GetLeavesWithStepSize(machineStartIndex, stepSize, numDesiredLeaves uint64) containers.PromiseInterface[[]common.Hash] { return stopwaiter.LaunchPromiseThread[[]common.Hash](e, func(ctx context.Context) ([]common.Hash, error) { - if stepSize == 1 { - e.cache = NewMachineCache(e.GetContext(), e.initialMachineGetter, e.config, server_common.WithAlwaysMerkleize()) - log.Info("Enabling Merkleization of machines for faster hashing. However, advancing to start index might take a while...") - } - log.Info(fmt.Sprintf("Starting BOLD machine computation at index %d", machineStartIndex)) machine, err := e.cache.GetMachineAt(ctx, machineStartIndex) if err != nil { return nil, err } - log.Info(fmt.Sprintf("Advanced machine to index %d, beginning hash computation", machineStartIndex)) // If the machine is starting at index 0, we always want to start at the "Machine finished" global state status // to align with the state roots that the inbox machine will produce. var stateRoots []common.Hash From 59d16b6c62eb9a26281f7be61b2bbd00461fa6f1 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:12:40 +0530 Subject: [PATCH 121/126] fixes --- system_tests/state_provider_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 44472124c3..5938358d00 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -2,7 +2,6 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE // race detection makes things slow and miss timeouts -//go:build challengetest && !race package arbtest @@ -286,6 +285,7 @@ func setupBoldStateProvider(t *testing.T, ctx context.Context) (*arbnode.Node, * l2node.Execution, l2node.ArbDB, nil, + nil, StaticFetcherFrom(t, &blockValidatorConfig), valStack, ) From 8c0738651ff87179bfa5a0aa6bbc67c8a901cd4f Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:23:51 +0530 Subject: [PATCH 122/126] fixes --- system_tests/state_provider_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 5938358d00..b2448b20f6 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -2,6 +2,7 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE // race detection makes things slow and miss timeouts +//go:build challengetest && !race package arbtest From 6eea57de3fe6bb4f04f646e5cbbb905c3c844ec0 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:33:12 +0530 Subject: [PATCH 123/126] fixes --- bold | 2 +- system_tests/bold_challenge_protocol_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bold b/bold index e396c55d37..5b6630ebf4 160000 --- a/bold +++ b/bold @@ -1 +1 @@ -Subproject commit e396c55d37657d18300e905f45bf772a9102a553 +Subproject commit 5b6630ebf459c554f4e2f94f511455e6b919b69a diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index 8c46a10c57..ff9919eba6 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -162,6 +162,7 @@ func testBoldProtocol(t *testing.T, numberOfChallenges int, parallelChallenges b l2nodeA.Execution, l2nodeA.ArbDB, nil, + nil, StaticFetcherFrom(t, &blockValidatorConfig), valStack, ) @@ -176,6 +177,7 @@ func testBoldProtocol(t *testing.T, numberOfChallenges int, parallelChallenges b l2nodeB.Execution, l2nodeB.ArbDB, nil, + nil, StaticFetcherFrom(t, &blockValidatorConfig), valStack, ) @@ -595,7 +597,7 @@ func createTestNodeOnL1ForBoldProtocol( currentNode, err = arbnode.CreateNode( ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, - addresses, sequencerTxOptsPtr, sequencerTxOptsPtr, dataSigner, fatalErrChan, + addresses, sequencerTxOptsPtr, sequencerTxOptsPtr, dataSigner, fatalErrChan, big.NewInt(1337), ) Require(t, err) @@ -780,7 +782,7 @@ func create2ndNodeWithConfigForBoldProtocol( execConfigFetcher := func() *gethexec.Config { return execConfig } execNode, err := gethexec.CreateExecutionNode(ctx, l2stack, l2chainDb, l2blockchain, l1client, execConfigFetcher) Require(t, err) - l2node, err := arbnode.CreateNode(ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan) + l2node, err := arbnode.CreateNode(ctx, l2stack, execNode, l2arbDb, NewFetcherFromConfig(nodeConfig), l2blockchain.Config(), l1client, addresses, &txOpts, &txOpts, dataSigner, fatalErrChan, big.NewInt(1337)) Require(t, err) Require(t, l2node.Start(ctx)) From 9af7679dc0b813440fd130425869cfbaf80feab5 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:35:37 +0530 Subject: [PATCH 124/126] Empty-Commit From 388d1e8127540cddc35c18c54e310282ec7ae155 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:45:55 +0530 Subject: [PATCH 125/126] fixes --- system_tests/state_provider_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index b2448b20f6..88b4fb1128 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -2,7 +2,6 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE // race detection makes things slow and miss timeouts -//go:build challengetest && !race package arbtest @@ -159,7 +158,7 @@ func TestStateProvider_BOLD(t *testing.T) { stateRoots, err := stateManager.StatesInBatchRange(fromHeight, toHeight, fromBatch, toBatch) Require(t, err) - if stateRoots.Length() != 15 { + if len(stateRoots) != 15 { Fatal(t, "wrong number of state roots") } }) From b6f2020d8583857e7a3a0a789dfe7823bf223688 Mon Sep 17 00:00:00 2001 From: amsanghi Date: Wed, 31 Jan 2024 21:51:12 +0530 Subject: [PATCH 126/126] fixes --- system_tests/state_provider_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/system_tests/state_provider_test.go b/system_tests/state_provider_test.go index 88b4fb1128..4a1f3b91f7 100644 --- a/system_tests/state_provider_test.go +++ b/system_tests/state_provider_test.go @@ -2,6 +2,7 @@ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE // race detection makes things slow and miss timeouts +//go:build challengetest && !race package arbtest