diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d24f2195..f17ca596e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,4 +58,8 @@ jobs: if: matrix.os == 'ubuntu-20.04' uses: golangci/golangci-lint-action@v3 with: - version: v1.52 + version: v1.54 + + - name: Lint source code licenses + if: matrix.os == 'ubuntu-20.04' + run: make lint-licenses-deps lint-licenses diff --git a/.golangci.yml b/.golangci.yml index 3717f3d40..a227f0e75 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,6 +8,7 @@ linters: - unused - performance disable: + - gosec - exhaustive - musttag - contextcheck diff --git a/Makefile b/Makefile index 1af6c8fb9..f58fccc2d 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ mocks: $(GOBINREL)/moq rm -f gointerfaces/sentry/mocks.go PATH="$(GOBIN):$(PATH)" go generate ./... -lint: $(GOBINREL)/golangci-lint +lintci: $(GOBINREL)/golangci-lint @"$(GOBIN)/golangci-lint" run --config ./.golangci.yml # force re-make golangci-lint @@ -80,11 +80,19 @@ lintci-deps-clean: golangci-lint-clean # download and build golangci-lint (https://golangci-lint.run) $(GOBINREL)/golangci-lint: | $(GOBINREL) - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(GOBIN)" v1.53.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(GOBIN)" v1.54.2 golangci-lint-clean: rm -f "$(GOBIN)/golangci-lint" +lint-licenses-deps: + @./tools/licenses_check.sh --install-deps +lint-licenses: + @./tools/licenses_check.sh + +lint-deps: lintci-deps lint-licenses-deps +lint: lintci lint-licenses + test: $(GOTEST) --count 1 -p 2 ./... diff --git a/README.md b/README.md index 06b85ac0a..4bb31ab94 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # erigon-lib Dependencies of Erigon project, rewritten from scratch and licensed under Apache 2.0 + +## Dev workflow + +In erigon folder create go.work file (it’s already in .gitignore) +``` +go 1.20 + +use ( + . + + ./../erigon-lib +) +``` + +Create PR in erigon-lib, don’t merge PR, refer from erigon to non-merged erigon-lib branch (commit) by: +go get github.com/ledgerwatch/erigon-lib/kv@ + +Create Erigon PR + +When both CI are green - merge 2 PR. That’s it. diff --git a/chain/chain_config.go b/chain/chain_config.go index 239e7aee8..a37a7bb53 100644 --- a/chain/chain_config.go +++ b/chain/chain_config.go @@ -477,6 +477,8 @@ type BorConfig struct { IndoreBlock *big.Int `json:"indoreBlock"` // Indore switch block (nil = no fork, 0 = already on indore) StateSyncConfirmationDelay map[string]uint64 `json:"stateSyncConfirmationDelay"` // StateSync Confirmation Delay, in seconds, to calculate `to` + + sprints sprints } // String implements the stringer interface, returning the consensus engine details. @@ -489,7 +491,62 @@ func (c *BorConfig) CalculateProducerDelay(number uint64) uint64 { } func (c *BorConfig) CalculateSprint(number uint64) uint64 { - return borKeyValueConfigHelper(c.Sprint, number) + if c.sprints == nil { + c.sprints = asSprints(c.Sprint) + } + + for i := 0; i < len(c.sprints)-1; i++ { + if number >= c.sprints[i].from && number < c.sprints[i+1].from { + return c.sprints[i].size + } + } + + return c.sprints[len(c.sprints)-1].size +} + +func (c *BorConfig) CalculateSprintCount(from, to uint64) int { + switch { + case from > to: + return 0 + case from < to: + to-- + } + + if c.sprints == nil { + c.sprints = asSprints(c.Sprint) + } + + count := uint64(0) + startCalc := from + + zeroth := func(boundary uint64, size uint64) uint64 { + if boundary%size == 0 { + return 1 + } + + return 0 + } + + for i := 0; i < len(c.sprints)-1; i++ { + if startCalc >= c.sprints[i].from && startCalc < c.sprints[i+1].from { + if to >= c.sprints[i].from && to < c.sprints[i+1].from { + if startCalc == to { + return int(count + zeroth(startCalc, c.sprints[i].size)) + } + return int(count + zeroth(startCalc, c.sprints[i].size) + (to-startCalc)/c.sprints[i].size) + } else { + endCalc := c.sprints[i+1].from - 1 + count += zeroth(startCalc, c.sprints[i].size) + (endCalc-startCalc)/c.sprints[i].size + startCalc = endCalc + 1 + } + } + } + + if startCalc == to { + return int(count + zeroth(startCalc, c.sprints[len(c.sprints)-1].size)) + } + + return int(count + zeroth(startCalc, c.sprints[len(c.sprints)-1].size) + (to-startCalc)/c.sprints[len(c.sprints)-1].size) } func (c *BorConfig) CalculateBackupMultiplier(number uint64) uint64 { @@ -560,6 +617,39 @@ func sortMapKeys(m map[string]uint64) []string { return keys } +type sprint struct { + from, size uint64 +} + +type sprints []sprint + +func (s sprints) Len() int { + return len(s) +} + +func (s sprints) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s sprints) Less(i, j int) bool { + return s[i].from < s[j].from +} + +func asSprints(configSprints map[string]uint64) sprints { + sprints := make(sprints, len(configSprints)) + + i := 0 + for key, value := range configSprints { + sprints[i].from, _ = strconv.ParseUint(key, 10, 64) + sprints[i].size = value + i++ + } + + sort.Sort(sprints) + + return sprints +} + // Rules is syntactic sugar over Config. It can be used for functions // that do not have or require information about the block. // diff --git a/chain/protocol_param.go b/chain/protocol_param.go deleted file mode 100644 index 44012b713..000000000 --- a/chain/protocol_param.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright 2023 The Erigon contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package chain - -const ( - // EIP-4844: Shard Blob Transactions - DataGasPerBlob uint64 = 0x20000 - TargetDataGasPerBlock uint64 = 0x60000 - MaxDataGasPerBlock uint64 = 0xC0000 -) diff --git a/commitment/bin_patricia_hashed.go b/commitment/bin_patricia_hashed.go index 877d3218f..0c4aebdb6 100644 --- a/commitment/bin_patricia_hashed.go +++ b/commitment/bin_patricia_hashed.go @@ -58,7 +58,7 @@ func binToCompact(bin []byte) []byte { binary.BigEndian.PutUint16(compact, uint16(len(bin))) for i := 0; i < len(bin); i++ { if bin[i] != 0 { - compact[2+i/8] |= (byte(1) << (i % 8)) + compact[2+i/8] |= byte(1) << (i % 8) } } return compact @@ -804,10 +804,9 @@ func (bph *BinPatriciaHashed) needUnfolding(hashedKey []byte) int { if cell.hl == 0 { // cell is empty, no need to unfold further return 0 - } else { - // unfold branch node - return 1 } + // unfold branch node + return 1 } cpl := commonPrefixLen(hashedKey[depth:], cell.downHashedKey[:cell.downHashedLen-1]) if bph.trace { @@ -1028,11 +1027,11 @@ func (bph *BinPatriciaHashed) fold() (branchData BranchData, updateKey []byte, e } else if upDepth == halfKeySize { // Special case - all storage items of an account have been deleted, but it does not automatically delete the account, just makes it empty storage // Therefore we are not propagating deletion upwards, but turn it into a modification - bph.touchMap[row-1] |= (uint16(1) << col) + bph.touchMap[row-1] |= uint16(1) << col } else { // Deletion is propagated upwards - bph.touchMap[row-1] |= (uint16(1) << col) - bph.afterMap[row-1] &^= (uint16(1) << col) + bph.touchMap[row-1] |= uint16(1) << col + bph.afterMap[row-1] &^= uint16(1) << col } } upBinaryCell.hl = 0 @@ -1060,7 +1059,7 @@ func (bph *BinPatriciaHashed) fold() (branchData BranchData, updateKey []byte, e bph.rootTouched = true } else { // Modifiction is propagated upwards - bph.touchMap[row-1] |= (uint16(1) << col) + bph.touchMap[row-1] |= uint16(1) << col } } nibble := bits.TrailingZeros16(bph.afterMap[row]) @@ -1089,7 +1088,7 @@ func (bph *BinPatriciaHashed) fold() (branchData BranchData, updateKey []byte, e bph.rootTouched = true } else { // Modifiction is propagated upwards - bph.touchMap[row-1] |= (uint16(1) << col) + bph.touchMap[row-1] |= uint16(1) << col } } bitmap := bph.touchMap[row] & bph.afterMap[row] @@ -1212,8 +1211,8 @@ func (bph *BinPatriciaHashed) deleteBinaryCell(hashedKey []byte) { cell = &bph.grid[row][col] if bph.afterMap[row]&(uint16(1)< 0 { @@ -667,7 +669,7 @@ func (g *Getter) SkipUncompressed() uint64 { g.dataBit = 0 } g.dataP += wordLen - return g.dataP + return g.dataP, int(wordLen) } // Match returns true and next offset if the word at current offset fully matches the buf @@ -817,3 +819,224 @@ func (g *Getter) MatchPrefix(prefix []byte) bool { } return true } + +// MatchCmp lexicographically compares given buf with the word at the current offset in the file. +// returns 0 if buf == word, -1 if buf < word, 1 if buf > word +func (g *Getter) MatchCmp(buf []byte) int { + savePos := g.dataP + wordLen := g.nextPos(true) + wordLen-- // because when create huffman tree we do ++ , because 0 is terminator + lenBuf := len(buf) + if wordLen == 0 && lenBuf != 0 { + g.dataP, g.dataBit = savePos, 0 + return 1 + } + if wordLen == 0 && lenBuf == 0 { + if g.dataBit > 0 { + g.dataP++ + g.dataBit = 0 + } + return 0 + } + + decoded := make([]byte, wordLen) + var bufPos int + // In the first pass, we only check patterns + for pos := g.nextPos(false /* clean */); pos != 0; pos = g.nextPos(false) { + bufPos += int(pos) - 1 + pattern := g.nextPattern() + copy(decoded[bufPos:], pattern) + } + if g.dataBit > 0 { + g.dataP++ + g.dataBit = 0 + } + postLoopPos := g.dataP + g.dataP, g.dataBit = savePos, 0 + g.nextPos(true /* clean */) // Reset the state of huffman decoder + // Second pass - we check spaces not covered by the patterns + var lastUncovered int + bufPos = 0 + for pos := g.nextPos(false /* clean */); pos != 0; pos = g.nextPos(false) { + bufPos += int(pos) - 1 + // fmt.Printf("BUF POS: %d, POS: %d, lastUncovered: %d\n", bufPos, pos, lastUncovered) + if bufPos > lastUncovered { + dif := uint64(bufPos - lastUncovered) + copy(decoded[lastUncovered:bufPos], g.data[postLoopPos:postLoopPos+dif]) + postLoopPos += dif + } + lastUncovered = bufPos + len(g.nextPattern()) + } + + if int(wordLen) > lastUncovered { + dif := wordLen - uint64(lastUncovered) + copy(decoded[lastUncovered:wordLen], g.data[postLoopPos:postLoopPos+dif]) + postLoopPos += dif + } + cmp := bytes.Compare(buf, decoded) + if cmp == 0 { + g.dataP, g.dataBit = postLoopPos, 0 + } else { + g.dataP, g.dataBit = savePos, 0 + } + return cmp +} + +// MatchPrefixCmp lexicographically compares given prefix with the word at the current offset in the file. +// returns 0 if buf == word, -1 if buf < word, 1 if buf > word +func (g *Getter) MatchPrefixCmp(prefix []byte) int { + savePos := g.dataP + defer func() { + g.dataP, g.dataBit = savePos, 0 + }() + + wordLen := g.nextPos(true /* clean */) + wordLen-- // because when create huffman tree we do ++ , because 0 is terminator + prefixLen := len(prefix) + if wordLen == 0 && prefixLen != 0 { + return 1 + } + if prefixLen == 0 { + return 0 + } + + decoded := make([]byte, wordLen) + var bufPos int + // In the first pass, we only check patterns + // Only run this loop as far as the prefix goes, there is no need to check further + for pos := g.nextPos(false /* clean */); pos != 0; pos = g.nextPos(false) { + bufPos += int(pos) - 1 + if bufPos > prefixLen { + break + } + pattern := g.nextPattern() + copy(decoded[bufPos:], pattern) + } + + if g.dataBit > 0 { + g.dataP++ + g.dataBit = 0 + } + postLoopPos := g.dataP + g.dataP, g.dataBit = savePos, 0 + g.nextPos(true /* clean */) // Reset the state of huffman decoder + // Second pass - we check spaces not covered by the patterns + var lastUncovered int + bufPos = 0 + for pos := g.nextPos(false /* clean */); pos != 0 && lastUncovered < prefixLen; pos = g.nextPos(false) { + bufPos += int(pos) - 1 + if bufPos > lastUncovered { + dif := uint64(bufPos - lastUncovered) + copy(decoded[lastUncovered:bufPos], g.data[postLoopPos:postLoopPos+dif]) + postLoopPos += dif + } + lastUncovered = bufPos + len(g.nextPattern()) + } + if prefixLen > lastUncovered && int(wordLen) > lastUncovered { + dif := wordLen - uint64(lastUncovered) + copy(decoded[lastUncovered:wordLen], g.data[postLoopPos:postLoopPos+dif]) + // postLoopPos += dif + } + var cmp int + if prefixLen > int(wordLen) { + // TODO(racytech): handle this case + // e.g: prefix = 'aaacb' + // word = 'aaa' + cmp = bytes.Compare(prefix, decoded) + } else { + cmp = bytes.Compare(prefix, decoded[:prefixLen]) + } + + return cmp +} + +func (g *Getter) MatchPrefixUncompressed(prefix []byte) int { + savePos := g.dataP + defer func() { + g.dataP, g.dataBit = savePos, 0 + }() + + wordLen := g.nextPos(true /* clean */) + wordLen-- // because when create huffman tree we do ++ , because 0 is terminator + prefixLen := len(prefix) + if wordLen == 0 && prefixLen != 0 { + return 1 + } + if prefixLen == 0 { + return 0 + } + + g.nextPos(true) + + // if prefixLen > int(wordLen) { + // // TODO(racytech): handle this case + // // e.g: prefix = 'aaacb' + // // word = 'aaa' + // } + + return bytes.Compare(prefix, g.data[g.dataP:g.dataP+wordLen]) +} + +// FastNext extracts a compressed word from current offset in the file +// into the given buf, returning a new byte slice which contains extracted word. +// It is important to allocate enough buf size. Could throw an error if word in file is larger then the buf size. +// After extracting next word, it moves to the beginning of the next one +func (g *Getter) FastNext(buf []byte) ([]byte, uint64) { + defer func() { + if rec := recover(); rec != nil { + panic(fmt.Sprintf("file: %s, %s, %s", g.fName, rec, dbg.Stack())) + } + }() + + savePos := g.dataP + wordLen := g.nextPos(true) + wordLen-- // because when create huffman tree we do ++ , because 0 is terminator + // decoded := make([]byte, wordLen) + if wordLen == 0 { + if g.dataBit > 0 { + g.dataP++ + g.dataBit = 0 + } + return buf[:wordLen], g.dataP + } + bufPos := 0 // Tracking position in buf where to insert part of the word + lastUncovered := 0 + + // if int(wordLen) > cap(buf) { + // newBuf := make([]byte, int(wordLen)) + // buf = newBuf + // } + // Loop below fills in the patterns + for pos := g.nextPos(false /* clean */); pos != 0; pos = g.nextPos(false) { + bufPos += int(pos) - 1 // Positions where to insert patterns are encoded relative to one another + pt := g.nextPattern() + copy(buf[bufPos:], pt) + } + if g.dataBit > 0 { + g.dataP++ + g.dataBit = 0 + } + postLoopPos := g.dataP + g.dataP = savePos + g.dataBit = 0 + g.nextPos(true /* clean */) // Reset the state of huffman reader + bufPos = lastUncovered // Restore to the beginning of buf + // Loop below fills the data which is not in the patterns + for pos := g.nextPos(false); pos != 0; pos = g.nextPos(false) { + bufPos += int(pos) - 1 // Positions where to insert patterns are encoded relative to one another + if bufPos > lastUncovered { + dif := uint64(bufPos - lastUncovered) + copy(buf[lastUncovered:bufPos], g.data[postLoopPos:postLoopPos+dif]) + postLoopPos += dif + } + lastUncovered = bufPos + len(g.nextPattern()) + } + if int(wordLen) > lastUncovered { + dif := wordLen - uint64(lastUncovered) + copy(buf[lastUncovered:wordLen], g.data[postLoopPos:postLoopPos+dif]) + postLoopPos += dif + } + g.dataP = postLoopPos + g.dataBit = 0 + return buf[:wordLen], postLoopPos +} diff --git a/compress/decompress_bench_test.go b/compress/decompress_bench_test.go index 950fd2e11..9f6cd4b5d 100644 --- a/compress/decompress_bench_test.go +++ b/compress/decompress_bench_test.go @@ -37,6 +37,20 @@ func BenchmarkDecompressNext(b *testing.B) { } } +func BenchmarkDecompressFastNext(b *testing.B) { + t := new(testing.T) + d := prepareDict(t) + defer d.Close() + g := d.MakeGetter() + buf := make([]byte, 100) + for i := 0; i < b.N; i++ { + _, _ = g.FastNext(buf) + if !g.HasNext() { + g.Reset(0) + } + } +} + func BenchmarkDecompressSkip(b *testing.B) { t := new(testing.T) d := prepareDict(t) @@ -44,7 +58,7 @@ func BenchmarkDecompressSkip(b *testing.B) { g := d.MakeGetter() for i := 0; i < b.N; i++ { - _ = g.Skip() + _, _ = g.Skip() if !g.HasNext() { g.Reset(0) } @@ -61,6 +75,19 @@ func BenchmarkDecompressMatch(b *testing.B) { } } +func BenchmarkDecompressMatchCmp(b *testing.B) { + t := new(testing.T) + d := prepareDict(t) + defer d.Close() + g := d.MakeGetter() + for i := 0; i < b.N; i++ { + _ = g.MatchCmp([]byte("longlongword")) + if !g.HasNext() { + g.Reset(0) + } + } +} + func BenchmarkDecompressMatchPrefix(b *testing.B) { t := new(testing.T) d := prepareDict(t) @@ -72,6 +99,17 @@ func BenchmarkDecompressMatchPrefix(b *testing.B) { } } +func BenchmarkDecompressMatchPrefixCmp(b *testing.B) { + t := new(testing.T) + d := prepareDict(t) + defer d.Close() + g := d.MakeGetter() + + for i := 0; i < b.N; i++ { + _ = g.MatchPrefixCmp([]byte("longlongword")) + } +} + func BenchmarkDecompressTorrent(t *testing.B) { t.Skip() diff --git a/compress/decompress_fuzz_test.go b/compress/decompress_fuzz_test.go new file mode 100644 index 000000000..e127a6240 --- /dev/null +++ b/compress/decompress_fuzz_test.go @@ -0,0 +1,96 @@ +package compress + +import ( + "bytes" + "context" + "fmt" + "math/rand" + "path/filepath" + "testing" + + "github.com/ledgerwatch/erigon-lib/common/cmp" + "github.com/ledgerwatch/log/v3" +) + +func FuzzDecompressMatch(f *testing.F) { + logger := log.New() + f.Fuzz(func(t *testing.T, x []byte, pos []byte, workers int8) { + t.Helper() + t.Parallel() + if len(pos) < 1 || workers < 1 { + t.Skip() + return + } + var a [][]byte + j := 0 + for i := 0; i < len(pos) && j < len(x); i++ { + if pos[i] == 0 { + continue + } + next := cmp.Min(j+int(pos[i]*10), len(x)-1) + bbb := x[j:next] + a = append(a, bbb) + j = next + } + + ctx := context.Background() + tmpDir := t.TempDir() + file := filepath.Join(tmpDir, fmt.Sprintf("compressed-%d", rand.Int31())) + c, err := NewCompressor(ctx, t.Name(), file, tmpDir, 2, int(workers), log.LvlDebug, logger) + if err != nil { + t.Fatal(err) + } + c.DisableFsync() + defer c.Close() + for _, b := range a { + if err = c.AddWord(b); err != nil { + t.Fatal(err) + } + } + if err = c.Compress(); err != nil { + t.Fatal(err) + } + c.Close() + d, err := NewDecompressor(file) + if err != nil { + t.Fatal(err) + } + defer d.Close() + g := d.MakeGetter() + buf := make([]byte, (1 << 16)) + word_idx := 0 + for g.HasNext() { + expected := a[word_idx] + savePos := g.dataP + cmp := g.MatchCmp(expected) + pos1 := g.dataP + if cmp != 0 { + t.Fatalf("MatchCmp: expected match: %v\n", expected) + } + g.Reset(savePos) + ok, _ := g.Match(expected) + pos2 := g.dataP + if !ok { + t.Fatalf("MatchBool: expected match: %v\n", expected) + } + g.Reset(savePos) + word, nexPos := g.Next(nil) + if bytes.Compare(word, expected) != 0 { + t.Fatalf("bytes.Compare: expected match: %v with word %v\n", expected, word) + } + if pos1 != pos2 && pos2 != nexPos { + t.Fatalf("pos1 %v != pos2 %v != nexPos %v\n", pos1, pos2, nexPos) + } + g.Reset(savePos) + word2, nexPos2 := g.FastNext(buf) + if bytes.Compare(word2, expected) != 0 { + t.Fatalf("bytes.Compare: expected match: %v with word %v\n", expected, word) + } + if pos1 != pos2 && pos2 != nexPos && nexPos != nexPos2 { + t.Fatalf("pos1 %v != pos2 %v != nexPos %v\n", pos1, pos2, nexPos) + } + word_idx++ + } + }) + +} diff --git a/compress/decompress_test.go b/compress/decompress_test.go index f3d777453..0becd5bb5 100644 --- a/compress/decompress_test.go +++ b/compress/decompress_test.go @@ -20,10 +20,12 @@ import ( "bytes" "context" "fmt" + "math/rand" "os" "path/filepath" "strings" "testing" + "time" "github.com/ledgerwatch/log/v3" "github.com/stretchr/testify/require" @@ -99,6 +101,30 @@ func TestDecompressMatchOK(t *testing.T) { } } +func TestDecompressMatchCmpOK(t *testing.T) { + d := prepareLoremDict(t) + defer d.Close() + g := d.MakeGetter() + i := 0 + for g.HasNext() { + w := loremStrings[i] + if i%2 != 0 { + expected := fmt.Sprintf("%s %d", w, i) + result := g.MatchCmp([]byte(expected)) + if result != 0 { + t.Errorf("expexted match with %s", expected) + } + } else { + word, _ := g.Next(nil) + expected := fmt.Sprintf("%s %d", w, i) + if string(word) != expected { + t.Errorf("expected %s, got (hex) %s", expected, word) + } + } + i++ + } +} + func prepareStupidDict(t *testing.T, size int) *Decompressor { t.Helper() logger := log.New() @@ -160,7 +186,6 @@ func TestDecompressMatchNotOK(t *testing.T) { for g.HasNext() { w := loremStrings[i] expected := fmt.Sprintf("%s %d", w, i+1) - ok, _ := g.Match([]byte(expected)) if ok { t.Errorf("not expexted match with %s", expected) @@ -214,6 +239,47 @@ func TestDecompressMatchPrefix(t *testing.T) { } } +func TestDecompressMatchPrefixCmp(t *testing.T) { + d := prepareLoremDict(t) + defer d.Close() + g := d.MakeGetter() + i := 0 + skipCount := 0 + for g.HasNext() { + w := loremStrings[i] + expected := []byte(fmt.Sprintf("%s %d", w, i+1)) + expected = expected[:len(expected)/2] + cmp := g.MatchPrefixCmp(expected) + if cmp != 0 { + t.Errorf("expexted match with %s", expected) + } + g.Skip() + skipCount++ + i++ + } + if skipCount != i { + t.Errorf("something wrong with match logic") + } + g.Reset(0) + skipCount = 0 + i = 0 + for g.HasNext() { + w := loremStrings[i] + expected := []byte(fmt.Sprintf("%s %d", w, i+1)) + expected = expected[:len(expected)/2] + if len(expected) > 0 { + expected[len(expected)-1]++ + cmp := g.MatchPrefixCmp(expected) + if cmp == 0 { + t.Errorf("not expexted match with %s", expected) + } + } + g.Skip() + skipCount++ + i++ + } +} + func prepareLoremDictUncompressed(t *testing.T) *Decompressor { t.Helper() logger := log.New() @@ -288,3 +354,414 @@ func TestDecompressTorrent(t *testing.T) { require.NotZero(t, sz) } } + +const N = 100 + +var WORDS = [N][]byte{} +var WORD_FLAGS = [N]bool{} // false - uncompressed word, true - compressed word +var INPUT_FLAGS = []int{} // []byte or nil input + +func randWord() []byte { + size := rand.Intn(256) // size of the word + word := make([]byte, size) + for i := 0; i < size; i++ { + word[i] = byte(rand.Intn(256)) + } + return word +} + +func generateRandWords() { + for i := 0; i < N-2; i++ { + WORDS[i] = randWord() + } + // make sure we have at least 2 emtpy []byte + WORDS[N-2] = []byte{} + WORDS[N-1] = []byte{} +} + +func randIntInRange(min, max int) int { + return (rand.Intn(max-min) + min) +} + +func clearPrevDict() { + WORDS = [N][]byte{} + WORD_FLAGS = [N]bool{} + INPUT_FLAGS = []int{} +} + +func prepareRandomDict(t *testing.T) *Decompressor { + t.Helper() + logger := log.New() + tmpDir := t.TempDir() + file := filepath.Join(tmpDir, "complex") + t.Name() + c, err := NewCompressor(context.Background(), t.Name(), file, tmpDir, 1, 2, log.LvlDebug, logger) + if err != nil { + t.Fatal(err) + } + // c.DisableFsync() + defer c.Close() + clearPrevDict() + rand.Seed(time.Now().UnixNano()) + generateRandWords() + + idx := 0 + for idx < N { + n := rand.Intn(2) + switch n { + case 0: // input case + word := WORDS[idx] + m := rand.Intn(2) + if m == 1 { + if err = c.AddWord(word); err != nil { + t.Fatal(err) + } + WORD_FLAGS[idx] = true + } else { + if err = c.AddUncompressedWord(word); err != nil { + t.Fatal(err) + } + } + idx++ + INPUT_FLAGS = append(INPUT_FLAGS, n) + case 1: // nil word + if err = c.AddWord(nil); err != nil { + t.Fatal(err) + } + INPUT_FLAGS = append(INPUT_FLAGS, n) + default: + t.Fatal(fmt.Errorf("case %d\n", n)) + } + } + + if err = c.Compress(); err != nil { + t.Fatal(err) + } + var d *Decompressor + if d, err = NewDecompressor(file); err != nil { + t.Fatal(err) + } + return d +} + +func TestDecompressRandomMatchCmp(t *testing.T) { + d := prepareRandomDict(t) + defer d.Close() + + if d.wordsCount != uint64(len(INPUT_FLAGS)) { + t.Fatalf("TestDecompressRandomDict: d.wordsCount != len(INPUT_FLAGS)") + } + + g := d.MakeGetter() + + word_idx := 0 + input_idx := 0 + total := 0 + // check for existing and non existing keys + for g.HasNext() { + pos := g.dataP + if INPUT_FLAGS[input_idx] == 0 { // []byte input + notExpected := string(WORDS[word_idx]) + "z" + cmp := g.MatchCmp([]byte(notExpected)) + if cmp == 0 { + t.Fatalf("not expected match: %v\n got: %v\n", []byte(notExpected), WORDS[word_idx]) + } + + expected := WORDS[word_idx] + cmp = g.MatchCmp(expected) // move offset to the next pos + if cmp != 0 { + savePos := g.dataP + g.Reset(pos) + word, nextPos := g.Next(nil) + if nextPos != savePos { + t.Fatalf("nextPos %d != savePos %d\n", nextPos, savePos) + } + if bytes.Compare(expected, word) != cmp { + fmt.Printf("1 expected: %v, acutal %v, cmp %d\n", expected, word, cmp) + } + t.Fatalf("expected match: %v\n got: %v\n", expected, word) + } + word_idx++ + } else { // nil input + notExpected := []byte{0} + cmp := g.MatchCmp(notExpected) + if cmp == 0 { + t.Fatal("not expected match []byte{0} with nil\n") + } + + expected := []byte{} + cmp = g.MatchCmp(nil) + if cmp != 0 { + savePos := g.dataP + g.Reset(pos) + word, nextPos := g.Next(nil) + if nextPos != savePos { + t.Fatalf("nextPos %d != savePos %d\n", nextPos, savePos) + } + if bytes.Compare(expected, word) != cmp { + fmt.Printf("2 expected: %v, acutal %v, cmp %d\n", expected, word, cmp) + } + t.Fatalf("expected match: %v\n got: %v\n", expected, word) + } + } + input_idx++ + total++ + } + if total != int(d.wordsCount) { + t.Fatalf("expected word count: %d, got %d\n", int(d.wordsCount), total) + } +} + +func TestDecompressRandomMatchBool(t *testing.T) { + d := prepareRandomDict(t) + defer d.Close() + + if d.wordsCount != uint64(len(INPUT_FLAGS)) { + t.Fatalf("TestDecompressRandomDict: d.wordsCount != len(INPUT_FLAGS)") + } + + g := d.MakeGetter() + + word_idx := 0 + input_idx := 0 + total := 0 + // check for existing and non existing keys + for g.HasNext() { + pos := g.dataP + if INPUT_FLAGS[input_idx] == 0 { // []byte input + notExpected := string(WORDS[word_idx]) + "z" + ok, _ := g.Match([]byte(notExpected)) + if ok { + t.Fatalf("not expected match: %v\n got: %v\n", []byte(notExpected), WORDS[word_idx]) + } + + expected := WORDS[word_idx] + ok, _ = g.Match(expected) + if !ok { + g.Reset(pos) + word, _ := g.Next(nil) + if bytes.Compare(expected, word) != 0 { + fmt.Printf("1 expected: %v, acutal %v, ok %v\n", expected, word, ok) + } + t.Fatalf("expected match: %v\n got: %v\n", expected, word) + } + word_idx++ + } else { // nil input + notExpected := []byte{0} + ok, _ := g.Match(notExpected) + if ok { + t.Fatal("not expected match []byte{0} with nil\n") + } + + expected := []byte{} + ok, _ = g.Match(nil) + if !ok { + g.Reset(pos) + word, _ := g.Next(nil) + if bytes.Compare(expected, word) != 0 { + fmt.Printf("2 expected: %v, acutal %v, ok %v\n", expected, word, ok) + } + t.Fatalf("expected match: %v\n got: %v\n", expected, word) + } + } + input_idx++ + total++ + } + if total != int(d.wordsCount) { + t.Fatalf("expected word count: %d, got %d\n", int(d.wordsCount), total) + } +} + +func TestDecompressRandomFastNext(t *testing.T) { + d := prepareRandomDict(t) + defer d.Close() + + if d.wordsCount != uint64(len(INPUT_FLAGS)) { + t.Fatalf("TestDecompressRandomDict: d.wordsCount != len(INPUT_FLAGS)") + } + + g := d.MakeGetter() + + word_idx := 0 + input_idx := 0 + total := 0 + buf := make([]byte, (1 << 23)) + // check for existing and non existing keys + for g.HasNext() { + if INPUT_FLAGS[input_idx] == 0 { // []byte input + expected := WORDS[word_idx] + word, _ := g.FastNext(buf) + if bytes.Compare(expected, word) != 0 { + t.Fatalf("1 expected: %v, got %v\n", expected, word) + } + word_idx++ + } else { // nil input + expected := []byte{} + word, _ := g.FastNext(buf) + if bytes.Compare(expected, word) != 0 { + t.Fatalf("2 expected: %v, got %v\n", expected, word) + } + } + input_idx++ + total++ + } + if total != int(d.wordsCount) { + t.Fatalf("expected word count: %d, got %d\n", int(d.wordsCount), total) + } +} + +// func TestDecompressRandomDict(t *testing.T) { +// d := prepareRandomDict(t) +// defer d.Close() + +// if d.wordsCount != uint64(len(INPUT_FLAGS)) { +// t.Fatalf("TestDecompressRandomDict: d.wordsCount != len(INPUT_FLAGS)") +// } + +// g := d.MakeGetter() + +// word_idx := 0 +// input_idx := 0 +// total := 0 +// // check for existing and non existing keys +// for g.HasNext() { +// pos := g.dataP +// if INPUT_FLAGS[input_idx] == 0 { // []byte input +// notExpected := string(WORDS[word_idx]) + "z" +// ok, _ := g.Match([]byte(notExpected)) +// if ok { +// t.Fatalf("not expected match: %s\n got: %s\n", notExpected, WORDS[word_idx]) +// } + +// expected := WORDS[word_idx] +// ok, _ = g.Match(expected) +// if !ok { +// g.Reset(pos) +// word, _ := g.Next(nil) +// t.Fatalf("expected match: %s\n got: %s\n", expected, word) +// } +// word_idx++ +// } else { // nil input +// notExpected := []byte{0} +// ok, _ := g.Match(notExpected) +// if ok { +// t.Fatal("not expected match []byte{0} with nil\n") +// } + +// expected := []byte{} +// ok, _ = g.Match(nil) +// if !ok { +// g.Reset(pos) +// word, _ := g.Next(nil) +// t.Fatalf("expected match: %s\n got: %s\n", expected, word) +// } +// } +// input_idx++ +// total++ +// } +// if total != int(d.wordsCount) { +// t.Fatalf("expected word count: %d, got %d\n", int(d.wordsCount), total) +// } + +// // TODO: check for non existing keys, suffixes, prefixes +// g.Reset(0) + +// word_idx = 0 +// input_idx = 0 +// // check for existing and non existing prefixes +// var notExpected = []byte{2, 3, 4} +// for g.HasNext() { + +// if INPUT_FLAGS[input_idx] == 0 { // []byte input +// expected := WORDS[word_idx] +// prefix_size := len(expected) / 2 +// if len(expected)/2 > 3 { +// prefix_size = randIntInRange(3, len(expected)/2) +// } +// expected = expected[:prefix_size] +// if len(expected) > 0 { +// if !g.MatchPrefix(expected) { +// t.Errorf("expected match with %s", expected) +// } +// expected[len(expected)-1]++ +// if g.MatchPrefix(expected) { +// t.Errorf("not expected match with %s", expected) +// } +// } else { +// if !g.MatchPrefix([]byte{}) { +// t.Error("expected match with empty []byte") +// } +// if g.MatchPrefix(notExpected) { +// t.Error("not expected empty []byte to match with []byte{2, 3, 4}") +// } +// } +// word_idx++ +// } else { // nil input +// if !g.MatchPrefix(nil) { +// t.Error("expected match with nil") +// } +// if g.MatchPrefix(notExpected) { +// t.Error("not expected nil to match with []byte{2, 3, 4}") +// } +// } + +// g.Skip() +// input_idx++ +// } + +// g.Reset(0) + +// word_idx = 0 +// input_idx = 0 +// // check for existing and non existing suffixes +// notExpected = []byte{2, 3, 4} +// for g.HasNext() { + +// if INPUT_FLAGS[input_idx] == 0 { // []byte input +// suffix := WORDS[word_idx] +// if len(suffix) > 1 { +// prefix := suffix[:len(suffix)/2] +// suffix = suffix[len(suffix)/2:] +// equal := reflect.DeepEqual(prefix, suffix) +// // check existing suffixes +// if g.MatchPrefix(suffix) { // suffix has to be equal to prefix +// if !equal { +// t.Fatalf("MatchPrefix(suffix) expected match: prefix is unequal to suffix %v != %v, full slice %v\n", prefix, suffix, WORDS[word_idx]) +// } +// } else { // suffix has not to be the same as prefix +// if equal { +// t.Fatalf("MatchPrefix(suffix) expected unmatch: prefix is equal to suffix %v != %v, full slice %v\n", prefix, suffix, WORDS[word_idx]) +// } +// } + +// if len(suffix) > 0 { +// suffix[0]++ +// if g.MatchPrefix(suffix) && reflect.DeepEqual(prefix, suffix) { +// t.Fatalf("MatchPrefix(suffix) not expected match: prefix is unequal to suffix %v != %v, full slice %v\n", prefix, suffix, WORDS[word_idx]) +// } +// } + +// g.Skip() +// } else { +// ok, _ := g.Match(suffix) +// if !ok { +// t.Fatal("Match(suffix): expected match suffix") +// } +// } +// word_idx++ +// } else { // nil input +// if !g.MatchPrefix(nil) { +// t.Error("MatchPrefix(suffix): expected match with nil") +// } +// if g.MatchPrefix(notExpected) { +// t.Error("MatchPrefix(suffix): not expected nil to match with []byte{2, 3, 4}") +// } +// ok, _ := g.Match(nil) +// if !ok { +// t.Errorf("Match(suffix): expected to match with nil") +// } +// } + +// input_idx++ +// } +// } diff --git a/compress/parallel_compress.go b/compress/parallel_compress.go index a7f18f28a..b90e7ab2c 100644 --- a/compress/parallel_compress.go +++ b/compress/parallel_compress.go @@ -238,7 +238,7 @@ func (cq *CompressionQueue) Pop() interface{} { } // reduceDict reduces the dictionary by trying the substitutions and counting frequency for each word -func reducedict(ctx context.Context, trace bool, logPrefix, segmentFilePath string, datFile *DecompressedFile, workers int, dictBuilder *DictionaryBuilder, lvl log.Lvl, logger log.Logger) error { +func reducedict(ctx context.Context, trace bool, logPrefix, segmentFilePath string, cf *os.File, datFile *DecompressedFile, workers int, dictBuilder *DictionaryBuilder, lvl log.Lvl, logger log.Logger) error { logEvery := time.NewTicker(60 * time.Second) defer logEvery.Stop() @@ -534,10 +534,6 @@ func reducedict(ctx context.Context, trace bool, logPrefix, segmentFilePath stri if lvl < log.LvlTrace { logger.Log(lvl, fmt.Sprintf("[%s] Effective dictionary", logPrefix), logCtx...) } - var cf *os.File - if cf, err = os.Create(segmentFilePath); err != nil { - return err - } cw := bufio.NewWriterSize(cf, 2*etl.BufIOSize) // 1-st, output amount of words - just a useful metadata binary.BigEndian.PutUint64(numBuf[:], inCount) // Dictionary size @@ -741,10 +737,6 @@ func reducedict(ctx context.Context, trace bool, logPrefix, segmentFilePath stri if err = cw.Flush(); err != nil { return err } - if err = cf.Close(); err != nil { - return err - } - return nil } @@ -752,12 +744,18 @@ func reducedict(ctx context.Context, trace bool, logPrefix, segmentFilePath stri // into the collector, using lock to mutual exclusion. At the end (when the input channel is closed), // it notifies the waitgroup before exiting, so that the caller known when all work is done // No error channels for now -func processSuperstring(superstringCh chan []byte, dictCollector *etl.Collector, minPatternScore uint64, completion *sync.WaitGroup, logger log.Logger) { +func processSuperstring(ctx context.Context, superstringCh chan []byte, dictCollector *etl.Collector, minPatternScore uint64, completion *sync.WaitGroup, logger log.Logger) { defer completion.Done() dictVal := make([]byte, 8) dictKey := make([]byte, maxPatternLen) var lcp, sa, inv []int32 for superstring := range superstringCh { + select { + case <-ctx.Done(): + return + default: + } + if cap(sa) < len(superstring) { sa = make([]int32, len(superstring)) } else { diff --git a/crypto/kzg/kzg.go b/crypto/kzg/kzg.go index b021a774a..8ba97a746 100644 --- a/crypto/kzg/kzg.go +++ b/crypto/kzg/kzg.go @@ -2,7 +2,11 @@ package kzg import ( "crypto/sha256" + "encoding/json" + "errors" "fmt" + "math/big" + "os" "sync" gokzg4844 "github.com/crate-crypto/go-kzg-4844" @@ -10,32 +14,68 @@ import ( const ( BlobCommitmentVersionKZG uint8 = 0x01 + PrecompileInputLength int = 192 ) type VersionedHash [32]byte -var gCryptoCtx *gokzg4844.Context -var initCryptoCtx sync.Once +var ( + errInvalidInputLength = errors.New("invalid input length") -// InitializeCryptoCtx initializes the global context object returned via CryptoCtx -func InitializeCryptoCtx() { + // The value that gets returned when the `verify_kzg_proof“ precompile is called + precompileReturnValue [64]byte + + trustedSetupFile string + + gokzgCtx *gokzg4844.Context + initCryptoCtx sync.Once +) + +func init() { + new(big.Int).SetUint64(gokzg4844.ScalarsPerBlob).FillBytes(precompileReturnValue[:32]) + copy(precompileReturnValue[32:], gokzg4844.BlsModulus[:]) +} + +func SetTrustedSetupFilePath(path string) { + trustedSetupFile = path +} + +// InitKZGCtx initializes the global context object returned via CryptoCtx +func InitKZGCtx() { initCryptoCtx.Do(func() { - var err error - // Initialize context to match the configurations that the - // specs are using. - gCryptoCtx, err = gokzg4844.NewContext4096Insecure1337() - if err != nil { - panic(fmt.Sprintf("could not create context, err : %v", err)) + if trustedSetupFile != "" { + file, err := os.ReadFile(trustedSetupFile) + if err != nil { + panic(fmt.Sprintf("could not read file, err: %v", err)) + } + + setup := new(gokzg4844.JSONTrustedSetup) + if err = json.Unmarshal(file, setup); err != nil { + panic(fmt.Sprintf("could not unmarshal, err: %v", err)) + } + + gokzgCtx, err = gokzg4844.NewContext4096(setup) + if err != nil { + panic(fmt.Sprintf("could not create KZG context, err: %v", err)) + } + } else { + var err error + // Initialize context to match the configurations that the + // specs are using. + gokzgCtx, err = gokzg4844.NewContext4096Insecure1337() + if err != nil { + panic(fmt.Sprintf("could not create context, err : %v", err)) + } } }) } // Ctx returns a context object that stores all of the necessary configurations to allow one to // create and verify blob proofs. This function is expensive to run if the crypto context isn't -// initialized, so production services should pre-initialize by calling InitializeCryptoCtx. +// initialized, so production services should pre-initialize by calling InitKZGCtx. func Ctx() *gokzg4844.Context { - InitializeCryptoCtx() - return gCryptoCtx + InitKZGCtx() + return gokzgCtx } // KZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844 @@ -45,3 +85,40 @@ func KZGToVersionedHash(kzg gokzg4844.KZGCommitment) VersionedHash { return VersionedHash(h) } + +// PointEvaluationPrecompile implements point_evaluation_precompile from EIP-4844 +func PointEvaluationPrecompile(input []byte) ([]byte, error) { + if len(input) != PrecompileInputLength { + return nil, errInvalidInputLength + } + // versioned hash: first 32 bytes + var versionedHash [32]byte + copy(versionedHash[:], input[:32]) + + var x, y [32]byte + // Evaluation point: next 32 bytes + copy(x[:], input[32:64]) + // Expected output: next 32 bytes + copy(y[:], input[64:96]) + + // input kzg point: next 48 bytes + var dataKZG [48]byte + copy(dataKZG[:], input[96:144]) + if KZGToVersionedHash(dataKZG) != versionedHash { + return nil, errors.New("mismatched versioned hash") + } + + // Quotient kzg: next 48 bytes + var quotientKZG [48]byte + copy(quotientKZG[:], input[144:PrecompileInputLength]) + + cryptoCtx := Ctx() + err := cryptoCtx.VerifyKZGProof(dataKZG, x, y, quotientKZG) + if err != nil { + return nil, fmt.Errorf("verify_kzg_proof error: %w", err) + } + + result := precompileReturnValue // copy the value + + return result[:], nil +} diff --git a/direct/eth_backend_client.go b/direct/eth_backend_client.go index 990aac25a..7d100a5ee 100644 --- a/direct/eth_backend_client.go +++ b/direct/eth_backend_client.go @@ -46,26 +46,6 @@ func (s *EthBackendClientDirect) NetPeerCount(ctx context.Context, in *remote.Ne return s.server.NetPeerCount(ctx, in) } -func (s *EthBackendClientDirect) EngineNewPayload(ctx context.Context, in *types.ExecutionPayload, opts ...grpc.CallOption) (*remote.EnginePayloadStatus, error) { - return s.server.EngineNewPayload(ctx, in) -} - -func (s *EthBackendClientDirect) EngineForkChoiceUpdated(ctx context.Context, in *remote.EngineForkChoiceUpdatedRequest, opts ...grpc.CallOption) (*remote.EngineForkChoiceUpdatedResponse, error) { - return s.server.EngineForkChoiceUpdated(ctx, in) -} - -func (s *EthBackendClientDirect) EngineGetPayload(ctx context.Context, in *remote.EngineGetPayloadRequest, opts ...grpc.CallOption) (*remote.EngineGetPayloadResponse, error) { - return s.server.EngineGetPayload(ctx, in) -} - -func (s *EthBackendClientDirect) EngineGetPayloadBodiesByHashV1(ctx context.Context, in *remote.EngineGetPayloadBodiesByHashV1Request, opts ...grpc.CallOption) (*remote.EngineGetPayloadBodiesV1Response, error) { - return s.server.EngineGetPayloadBodiesByHashV1(ctx, in) -} - -func (s *EthBackendClientDirect) EngineGetPayloadBodiesByRangeV1(ctx context.Context, in *remote.EngineGetPayloadBodiesByRangeV1Request, opts ...grpc.CallOption) (*remote.EngineGetPayloadBodiesV1Response, error) { - return s.server.EngineGetPayloadBodiesByRangeV1(ctx, in) -} - func (s *EthBackendClientDirect) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) { return s.server.Version(ctx, in) } @@ -234,3 +214,7 @@ func (s *EthBackendClientDirect) AddPeer(ctx context.Context, in *remote.AddPeer func (s *EthBackendClientDirect) PendingBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*remote.PendingBlockReply, error) { return s.server.PendingBlock(ctx, in) } + +func (s *EthBackendClientDirect) BorEvent(ctx context.Context, in *remote.BorEventRequest, opts ...grpc.CallOption) (*remote.BorEventReply, error) { + return s.server.BorEvent(ctx, in) +} diff --git a/direct/execution_client.go b/direct/execution_client.go new file mode 100644 index 000000000..d5899815e --- /dev/null +++ b/direct/execution_client.go @@ -0,0 +1,98 @@ +/* + Copyright 2021 Erigon contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package direct + +import ( + "context" + + "github.com/ledgerwatch/erigon-lib/gointerfaces/execution" + "github.com/ledgerwatch/erigon-lib/gointerfaces/types" + "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/emptypb" +) + +type ExecutionClientDirect struct { + server execution.ExecutionServer +} + +func NewExecutionClientDirect(server execution.ExecutionServer) execution.ExecutionClient { + return &ExecutionClientDirect{server: server} +} + +func (s *ExecutionClientDirect) AssembleBlock(ctx context.Context, in *execution.AssembleBlockRequest, opts ...grpc.CallOption) (*execution.AssembleBlockResponse, error) { + return s.server.AssembleBlock(ctx, in) +} + +func (s *ExecutionClientDirect) GetBodiesByHashes(ctx context.Context, in *execution.GetBodiesByHashesRequest, opts ...grpc.CallOption) (*execution.GetBodiesBatchResponse, error) { + return s.server.GetBodiesByHashes(ctx, in) +} + +func (s *ExecutionClientDirect) GetBodiesByRange(ctx context.Context, in *execution.GetBodiesByRangeRequest, opts ...grpc.CallOption) (*execution.GetBodiesBatchResponse, error) { + return s.server.GetBodiesByRange(ctx, in) +} + +func (s *ExecutionClientDirect) GetAssembledBlock(ctx context.Context, in *execution.GetAssembledBlockRequest, opts ...grpc.CallOption) (*execution.GetAssembledBlockResponse, error) { + return s.server.GetAssembledBlock(ctx, in) +} + +// Chain Putters. +func (s *ExecutionClientDirect) InsertBlocks(ctx context.Context, in *execution.InsertBlocksRequest, opts ...grpc.CallOption) (*execution.InsertionResult, error) { + return s.server.InsertBlocks(ctx, in) +} + +// Chain Validation and ForkChoice. +func (s *ExecutionClientDirect) ValidateChain(ctx context.Context, in *execution.ValidationRequest, opts ...grpc.CallOption) (*execution.ValidationReceipt, error) { + return s.server.ValidateChain(ctx, in) + +} + +func (s *ExecutionClientDirect) UpdateForkChoice(ctx context.Context, in *execution.ForkChoice, opts ...grpc.CallOption) (*execution.ForkChoiceReceipt, error) { + return s.server.UpdateForkChoice(ctx, in) +} + +// Chain Getters. +func (s *ExecutionClientDirect) GetHeader(ctx context.Context, in *execution.GetSegmentRequest, opts ...grpc.CallOption) (*execution.GetHeaderResponse, error) { + return s.server.GetHeader(ctx, in) +} + +func (s *ExecutionClientDirect) CurrentHeader(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*execution.GetHeaderResponse, error) { + return s.server.CurrentHeader(ctx, in) +} + +func (s *ExecutionClientDirect) GetTD(ctx context.Context, in *execution.GetSegmentRequest, opts ...grpc.CallOption) (*execution.GetTDResponse, error) { + return s.server.GetTD(ctx, in) +} + +func (s *ExecutionClientDirect) GetBody(ctx context.Context, in *execution.GetSegmentRequest, opts ...grpc.CallOption) (*execution.GetBodyResponse, error) { + return s.server.GetBody(ctx, in) +} + +func (s *ExecutionClientDirect) IsCanonicalHash(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*execution.IsCanonicalResponse, error) { + return s.server.IsCanonicalHash(ctx, in) +} + +func (s *ExecutionClientDirect) GetHeaderHashNumber(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*execution.GetHeaderHashNumberResponse, error) { + return s.server.GetHeaderHashNumber(ctx, in) +} + +func (s *ExecutionClientDirect) GetForkChoice(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*execution.ForkChoice, error) { + return s.server.GetForkChoice(ctx, in) +} + +func (s *ExecutionClientDirect) Ready(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*execution.ReadyResponse, error) { + return s.server.Ready(ctx, in) +} diff --git a/direct/sentinel_client.go b/direct/sentinel_client.go new file mode 100644 index 000000000..b431e7061 --- /dev/null +++ b/direct/sentinel_client.go @@ -0,0 +1,103 @@ +/* + Copyright 2021 Erigon contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package direct + +import ( + "context" + "io" + + "github.com/ledgerwatch/erigon-lib/gointerfaces/sentinel" + "google.golang.org/grpc" +) + +type SentinelClientDirect struct { + server sentinel.SentinelServer +} + +func NewSentinelClientDirect(sentinel sentinel.SentinelServer) sentinel.SentinelClient { + return &SentinelClientDirect{server: sentinel} +} + +func (s *SentinelClientDirect) SendRequest(ctx context.Context, in *sentinel.RequestData, opts ...grpc.CallOption) (*sentinel.ResponseData, error) { + return s.server.SendRequest(ctx, in) +} + +func (s *SentinelClientDirect) SetStatus(ctx context.Context, in *sentinel.Status, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) { + return s.server.SetStatus(ctx, in) +} + +func (s *SentinelClientDirect) GetPeers(ctx context.Context, in *sentinel.EmptyMessage, opts ...grpc.CallOption) (*sentinel.PeerCount, error) { + return s.server.GetPeers(ctx, in) +} + +func (s *SentinelClientDirect) BanPeer(ctx context.Context, p *sentinel.Peer, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) { + return s.server.BanPeer(ctx, p) +} + +func (s *SentinelClientDirect) PublishGossip(ctx context.Context, in *sentinel.GossipData, opts ...grpc.CallOption) (*sentinel.EmptyMessage, error) { + return s.server.PublishGossip(ctx, in) +} + +// Subscribe gossip part. the only complex section of this bullshit + +func (s *SentinelClientDirect) SubscribeGossip(ctx context.Context, in *sentinel.EmptyMessage, opts ...grpc.CallOption) (sentinel.Sentinel_SubscribeGossipClient, error) { + ch := make(chan *gossipReply, 16384) + streamServer := &SentinelSubscribeGossipS{ch: ch, ctx: ctx} + go func() { + defer close(ch) + streamServer.Err(s.server.SubscribeGossip(in, streamServer)) + }() + return &SentinelSubscribeGossipC{ch: ch, ctx: ctx}, nil +} + +type SentinelSubscribeGossipC struct { + ch chan *gossipReply + ctx context.Context + grpc.ClientStream +} + +func (c *SentinelSubscribeGossipC) Recv() (*sentinel.GossipData, error) { + m, ok := <-c.ch + if !ok || m == nil { + return nil, io.EOF + } + return m.r, m.err +} +func (c *SentinelSubscribeGossipC) Context() context.Context { return c.ctx } + +type SentinelSubscribeGossipS struct { + ch chan *gossipReply + ctx context.Context + grpc.ServerStream +} + +type gossipReply struct { + r *sentinel.GossipData + err error +} + +func (s *SentinelSubscribeGossipS) Send(m *sentinel.GossipData) error { + s.ch <- &gossipReply{r: m} + return nil +} +func (s *SentinelSubscribeGossipS) Context() context.Context { return s.ctx } +func (s *SentinelSubscribeGossipS) Err(err error) { + if err == nil { + return + } + s.ch <- &gossipReply{err: err} +} diff --git a/downloader/downloader.go b/downloader/downloader.go index f86ad9f86..cf1296a45 100644 --- a/downloader/downloader.go +++ b/downloader/downloader.go @@ -18,6 +18,7 @@ package downloader import ( "context" + "errors" "fmt" "io/fs" "os" @@ -33,6 +34,7 @@ import ( common2 "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/common/dir" "github.com/ledgerwatch/erigon-lib/downloader/downloadercfg" + prototypes "github.com/ledgerwatch/erigon-lib/gointerfaces/types" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv/mdbx" "github.com/ledgerwatch/log/v3" @@ -65,7 +67,8 @@ type AggStats struct { Completed bool Progress float32 - BytesCompleted, BytesTotal uint64 + BytesCompleted, BytesTotal uint64 + DroppedCompleted, DroppedTotal atomic.Uint64 BytesDownload, BytesUpload uint64 UploadRate, DownloadRate uint64 @@ -113,7 +116,7 @@ func New(ctx context.Context, cfg *downloadercfg.Cfg) (*Downloader, error) { statsLock: &sync.RWMutex{}, } - if err := d.addSegments(); err != nil { + if err := d.addSegments(ctx); err != nil { return nil, err } return d, nil @@ -124,36 +127,110 @@ func (d *Downloader) MainLoopInBackground(ctx context.Context, silent bool) { d.wg.Add(1) go func() { defer d.wg.Done() - d.mainLoop(ctx, silent) + if err := d.mainLoop(ctx, silent); err != nil { + if !errors.Is(err, context.Canceled) { + log.Warn("[snapshots]", "err", err) + } + } }() } -func (d *Downloader) mainLoop(ctx context.Context, silent bool) { +func (d *Downloader) mainLoop(ctx context.Context, silent bool) error { var sem = semaphore.NewWeighted(int64(d.cfg.DownloadSlots)) + d.wg.Add(1) go func() { - for { - torrents := d.Torrent().Torrents() - for _, t := range torrents { - <-t.GotInfo() - if t.Complete.Bool() { - continue - } - if err := sem.Acquire(ctx, 1); err != nil { + defer d.wg.Done() + + // Torrents that are already taken care of + torrentMap := map[metainfo.Hash]struct{}{} + // First loop drops torrents that were downloaded or are already complete + // This improves efficiency of download by reducing number of active torrent (empirical observation) + DownloadLoop: + torrents := d.Torrent().Torrents() + for _, t := range torrents { + if _, already := torrentMap[t.InfoHash()]; already { + continue + } + select { + case <-ctx.Done(): + return + case <-t.GotInfo(): + } + if t.Complete.Bool() { + d.stats.DroppedCompleted.Add(uint64(t.BytesCompleted())) + d.stats.DroppedTotal.Add(uint64(t.Length())) + //t.Drop() + torrentMap[t.InfoHash()] = struct{}{} + continue + } + if err := sem.Acquire(ctx, 1); err != nil { + return + } + t.AllowDataDownload() + t.DownloadAll() + torrentMap[t.InfoHash()] = struct{}{} + d.wg.Add(1) + go func(t *torrent.Torrent) { + defer d.wg.Done() + defer sem.Release(1) + select { + case <-ctx.Done(): return + case <-t.Complete.On(): } - t.AllowDataDownload() - t.DownloadAll() - go func(t *torrent.Torrent) { - defer sem.Release(1) - //r := t.NewReader() - //r.SetReadahead(t.Length()) - //_, _ = io.Copy(io.Discard, r) // enable streaming - it will prioritize sequential download - - <-t.Complete.On() - }(t) + d.stats.DroppedCompleted.Add(uint64(t.BytesCompleted())) + d.stats.DroppedTotal.Add(uint64(t.Length())) + //t.Drop() + }(t) + } + if len(torrents) != len(d.Torrent().Torrents()) { //if amount of torrents changed - keep downloading + goto DownloadLoop + } + + if err := d.addSegments(ctx); err != nil { + return + } + DownloadLoop2: + torrents = d.Torrent().Torrents() + for _, t := range torrents { + if _, already := torrentMap[t.InfoHash()]; already { + continue + } + select { + case <-ctx.Done(): + return + case <-t.GotInfo(): } - time.Sleep(30 * time.Second) + if t.Complete.Bool() { + d.stats.DroppedCompleted.Add(uint64(t.BytesCompleted())) + d.stats.DroppedTotal.Add(uint64(t.Length())) + //t.Drop() + torrentMap[t.InfoHash()] = struct{}{} + continue + } + if err := sem.Acquire(ctx, 1); err != nil { + return + } + t.AllowDataDownload() + t.DownloadAll() + torrentMap[t.InfoHash()] = struct{}{} + d.wg.Add(1) + go func(t *torrent.Torrent) { + defer d.wg.Done() + defer sem.Release(1) + select { + case <-ctx.Done(): + return + case <-t.Complete.On(): + } + d.stats.DroppedCompleted.Add(uint64(t.BytesCompleted())) + d.stats.DroppedTotal.Add(uint64(t.Length())) + //t.Drop() + }(t) + } + if len(torrents) != len(d.Torrent().Torrents()) { //if amount of torrents changed - keep downloading + goto DownloadLoop2 } }() @@ -168,7 +245,7 @@ func (d *Downloader) mainLoop(ctx context.Context, silent bool) { for { select { case <-ctx.Done(): - return + return ctx.Err() case <-statEvery.C: d.ReCalcStats(statInterval) @@ -179,11 +256,6 @@ func (d *Downloader) mainLoop(ctx context.Context, silent bool) { stats := d.Stats() - if stats.MetadataReady < stats.FilesTotal { - log.Info(fmt.Sprintf("[snapshots] Waiting for torrents metadata: %d/%d", stats.MetadataReady, stats.FilesTotal)) - continue - } - if stats.Completed { if justCompleted { justCompleted = false @@ -237,7 +309,7 @@ func (d *Downloader) ReCalcStats(interval time.Duration) { stats.BytesDownload = uint64(connStats.BytesReadUsefulIntendedData.Int64()) stats.BytesUpload = uint64(connStats.BytesWrittenData.Int64()) - stats.BytesTotal, stats.BytesCompleted, stats.ConnectionsTotal, stats.MetadataReady = 0, 0, 0, 0 + stats.BytesTotal, stats.BytesCompleted, stats.ConnectionsTotal, stats.MetadataReady = stats.DroppedTotal.Load(), stats.DroppedCompleted.Load(), 0, 0 for _, t := range torrents { select { case <-t.GotInfo(): @@ -351,7 +423,9 @@ func (d *Downloader) VerifyData(ctx context.Context) error { logInterval := 20 * time.Second logEvery := time.NewTicker(logInterval) defer logEvery.Stop() + d.wg.Add(1) go func() { + defer d.wg.Done() for { select { case <-ctx.Done(): @@ -380,7 +454,47 @@ func (d *Downloader) VerifyData(ctx context.Context) error { return d.db.Update(context.Background(), func(tx kv.RwTx) error { return nil }) } -func (d *Downloader) addSegments() error { +func (d *Downloader) createMagnetLinkWithInfoHash(ctx context.Context, hash *prototypes.H160, snapDir string) (bool, error) { + mi := &metainfo.MetaInfo{AnnounceList: Trackers} + if hash == nil { + return false, nil + } + infoHash := Proto2InfoHash(hash) + //log.Debug("[downloader] downloading torrent and seg file", "hash", infoHash) + + if _, ok := d.torrentClient.Torrent(infoHash); ok { + //log.Debug("[downloader] torrent client related to hash found", "hash", infoHash) + return true, nil + } + + magnet := mi.Magnet(&infoHash, nil) + t, err := d.torrentClient.AddMagnet(magnet.String()) + if err != nil { + //log.Warn("[downloader] add magnet link", "err", err) + return false, err + } + t.DisallowDataDownload() + t.AllowDataUpload() + d.wg.Add(1) + go func(t *torrent.Torrent) { + defer d.wg.Done() + select { + case <-ctx.Done(): + return + case <-t.GotInfo(): + } + + mi := t.Metainfo() + if err := CreateTorrentFileIfNotExists(snapDir, t.Info(), &mi); err != nil { + log.Warn("[downloader] create torrent file", "err", err) + return + } + }(t) + //log.Debug("[downloader] downloaded both seg and torrent files", "hash", infoHash) + return false, nil +} + +func (d *Downloader) addSegments(ctx context.Context) error { logEvery := time.NewTicker(20 * time.Second) defer logEvery.Stop() _, err := BuildTorrentFilesIfNeed(context.Background(), d.SnapDir()) @@ -396,27 +510,36 @@ func (d *Downloader) addSegments() error { return fmt.Errorf("seedableHistorySnapshots: %w", err) } files = append(files, files2...) - wg := &sync.WaitGroup{} + + g, ctx := errgroup.WithContext(ctx) i := atomic.Int64{} for _, f := range files { - wg.Add(1) - go func(f string) { - defer wg.Done() + f := f + g.Go(func() error { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } _, err := AddSegment(f, d.cfg.DataDir, d.torrentClient) if err != nil { - log.Warn("[snapshots] AddSegment", "err", err) - return + return err } i.Add(1) select { + case <-ctx.Done(): + return ctx.Err() case <-logEvery.C: log.Info("[snpshots] initializing", "files", fmt.Sprintf("%d/%d", i.Load(), len(files))) default: } - }(f) + return nil + }) + } + if err := g.Wait(); err != nil { + return err } - wg.Wait() return nil } diff --git a/downloader/downloader_grpc_server.go b/downloader/downloader_grpc_server.go index eb1191740..e6e7a5c2e 100644 --- a/downloader/downloader_grpc_server.go +++ b/downloader/downloader_grpc_server.go @@ -52,6 +52,8 @@ func (s *GrpcServer) Download(ctx context.Context, request *proto_downloader.Dow snapDir := s.d.SnapDir() for i, it := range request.Items { select { + case <-ctx.Done(): + return nil, ctx.Err() case <-logEvery.C: log.Info("[snapshots] initializing", "files", fmt.Sprintf("%d/%d", i, len(request.Items))) default: @@ -72,7 +74,7 @@ func (s *GrpcServer) Download(ctx context.Context, request *proto_downloader.Dow continue } - _, err := createMagnetLinkWithInfoHash(it.TorrentHash, torrentClient, snapDir) + _, err := s.d.createMagnetLinkWithInfoHash(ctx, it.TorrentHash, snapDir) if err != nil { return nil, err } @@ -137,36 +139,3 @@ func seedNewSnapshot(it *proto_downloader.DownloadItem, torrentClient *torrent.C } // we dont have .seg or .torrent so we get them through the torrent hash -func createMagnetLinkWithInfoHash(hash *prototypes.H160, torrentClient *torrent.Client, snapDir string) (bool, error) { - mi := &metainfo.MetaInfo{AnnounceList: Trackers} - if hash == nil { - return false, nil - } - infoHash := Proto2InfoHash(hash) - //log.Debug("[downloader] downloading torrent and seg file", "hash", infoHash) - - if _, ok := torrentClient.Torrent(infoHash); ok { - //log.Debug("[downloader] torrent client related to hash found", "hash", infoHash) - return true, nil - } - - magnet := mi.Magnet(&infoHash, nil) - t, err := torrentClient.AddMagnet(magnet.String()) - if err != nil { - //log.Warn("[downloader] add magnet link", "err", err) - return false, err - } - t.DisallowDataDownload() - t.AllowDataUpload() - go func(t *torrent.Torrent) { - <-t.GotInfo() - - mi := t.Metainfo() - if err := CreateTorrentFileIfNotExists(snapDir, t.Info(), &mi); err != nil { - log.Warn("[downloader] create torrent file", "err", err) - return - } - }(t) - //log.Debug("[downloader] downloaded both seg and torrent files", "hash", infoHash) - return false, nil -} diff --git a/downloader/snaptype/files.go b/downloader/snaptype/files.go index bc276f533..424596e07 100644 --- a/downloader/snaptype/files.go +++ b/downloader/snaptype/files.go @@ -34,6 +34,8 @@ const ( Headers Type = iota Bodies Transactions + BorEvents + BorSpans NumberOfTypes ) @@ -45,6 +47,10 @@ func (ft Type) String() string { return "bodies" case Transactions: return "transactions" + case BorEvents: + return "borevents" + case BorSpans: + return "borspans" default: panic(fmt.Sprintf("unknown file type: %d", ft)) } @@ -58,6 +64,10 @@ func ParseFileType(s string) (Type, bool) { return Bodies, true case "transactions": return Transactions, true + case "borevents": + return BorEvents, true + case "borspans": + return BorSpans, true default: return NumberOfTypes, false } @@ -141,6 +151,10 @@ func ParseFileName(dir, fileName string) (res FileInfo, err error) { snapshotType = Bodies case Transactions: snapshotType = Transactions + case BorEvents: + snapshotType = BorEvents + case BorSpans: + snapshotType = BorSpans default: return res, fmt.Errorf("unexpected snapshot suffix: %s,%w", parts[2], ErrInvalidFileName) } diff --git a/downloader/trackers/embed.go b/downloader/trackers/embed.go deleted file mode 100644 index bf179e756..000000000 --- a/downloader/trackers/embed.go +++ /dev/null @@ -1,40 +0,0 @@ -package trackers - -import ( - "bufio" - "strings" - - "github.com/ledgerwatch/trackerslist" -) - -var ( - Best = split(trackerslist.Best) - Https = split(trackerslist.Https) - Http = split(trackerslist.Http) - Udp = split(trackerslist.Udp) - Ws = split(trackerslist.Ws) -) - -func split(txt string) (lines []string) { - sc := bufio.NewScanner(strings.NewReader(txt)) - for sc.Scan() { - l := sc.Text() - l = strings.TrimSpace(l) - if len(l) == 0 { - continue - } - lines = append(lines, sc.Text()) - } - - if err := sc.Err(); err != nil { - panic(err) - } - return lines -} - -func First(n int, in []string) (res []string) { - if n <= len(in) { - return in[:n] - } - return in -} diff --git a/downloader/util.go b/downloader/util.go index 6d20dc2e5..f35ecb788 100644 --- a/downloader/util.go +++ b/downloader/util.go @@ -38,19 +38,33 @@ import ( dir2 "github.com/ledgerwatch/erigon-lib/common/dir" "github.com/ledgerwatch/erigon-lib/downloader/downloadercfg" "github.com/ledgerwatch/erigon-lib/downloader/snaptype" - "github.com/ledgerwatch/erigon-lib/downloader/trackers" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/log/v3" "golang.org/x/sync/semaphore" ) +// `github.com/anacrolix/torrent` library spawning several goroutines and producing many requests for each tracker. So we limit amout of trackers by 7 +var udpOrHttpTrackers = []string{ + "udp://tracker.opentrackr.org:1337/announce", + "udp://9.rarbg.com:2810/announce", + "udp://tracker.openbittorrent.com:6969/announce", + "http://tracker.openbittorrent.com:80/announce", + "udp://opentracker.i2p.rocks:6969/announce", + "https://opentracker.i2p.rocks:443/announce", + "udp://tracker.torrent.eu.org:451/announce", + "udp://tracker.moeking.me:6969/announce", +} + +// nolint +var websocketTrackers = []string{ + "wss://tracker.btorrent.xyz", +} + // Trackers - break down by priority tier var Trackers = [][]string{ - trackers.First(7, trackers.Best), - //trackers.First(3, trackers.Udp), - //trackers.First(3, trackers.Https), - //trackers.First(10, trackers.Ws), + udpOrHttpTrackers, + //websocketTrackers // TODO: Ws protocol producing too many errors and flooding logs. But it's also very fast and reactive. } func AllTorrentPaths(dir string) ([]string, error) { @@ -190,6 +204,9 @@ func buildTorrentIfNeed(fName, root string) (err error) { if dir2.FileExist(fPath + ".torrent") { return } + if !dir2.FileExist(fPath) { + return + } info := &metainfo.Info{PieceLength: downloadercfg.DefaultPieceSize, Name: fName} if err := info.BuildFromFilePath(fPath); err != nil { return fmt.Errorf("createTorrentFileFromSegment: %w", err) @@ -232,7 +249,7 @@ func BuildTorrentFilesIfNeed(ctx context.Context, snapDir string) ([]string, err workers := cmp.Max(1, runtime.GOMAXPROCS(-1)-1) * 2 var sem = semaphore.NewWeighted(int64(workers)) i := atomic.Int32{} - for _, f := range files { + for _, file := range files { wg.Add(1) if err := sem.Acquire(ctx, 1); err != nil { return nil, err @@ -252,7 +269,7 @@ func BuildTorrentFilesIfNeed(ctx context.Context, snapDir string) ([]string, err case <-logEvery.C: log.Info("[snapshots] Creating .torrent files", "Progress", fmt.Sprintf("%d/%d", i.Load(), len(files))) } - }(f) + }(file) } go func() { wg.Wait() @@ -298,11 +315,11 @@ func createTorrentFileFromInfo(root string, info *metainfo.Info, mi *metainfo.Me if err != nil { return err } - defer file.Sync() defer file.Close() if err := mi.Write(file); err != nil { return err } + file.Sync() return nil } diff --git a/go.mod b/go.mod index e3ff27565..407a47f48 100644 --- a/go.mod +++ b/go.mod @@ -2,26 +2,25 @@ module github.com/ledgerwatch/erigon-lib go 1.19 -replace github.com/ledgerwatch/interfaces v0.0.0-20230602104541-cdc6e215fb3e => github.com/testinprod-io/erigon-interfaces v0.0.0-20230719061837-f2e7a04bba79 +replace github.com/ledgerwatch/interfaces v0.0.0-20230825231422-3f5363b4d464 => github.com/testinprod-io/erigon-interfaces v0.0.0-20230925052814-3e8d7f8f455f //for local dev: -//replace github.com/ledgerwatch/interfaces v0.0.0-20230412092010-e1c4a1a4279e => ../erigon-interfaces +//replace github.com/ledgerwatch/interfaces v0.0.0-20230825231422-3f5363b4d464 => ../erigon-interfaces require ( - github.com/ledgerwatch/interfaces v0.0.0-20230602104541-cdc6e215fb3e - github.com/ledgerwatch/log/v3 v3.8.0 + github.com/erigontech/mdbx-go v0.27.14 + github.com/ledgerwatch/interfaces v0.0.0-20230825231422-3f5363b4d464 + github.com/ledgerwatch/log/v3 v3.9.0 github.com/ledgerwatch/secp256k1 v1.0.0 - github.com/ledgerwatch/trackerslist v1.1.0 - github.com/torquem-ch/mdbx-go v0.27.10 ) require ( github.com/RoaringBitmap/roaring v1.2.3 github.com/VictoriaMetrics/metrics v1.23.1 github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444 - github.com/anacrolix/go-libutp v1.3.0 - github.com/anacrolix/log v0.14.0 - github.com/anacrolix/torrent v1.52.0 + github.com/anacrolix/go-libutp v1.3.1 + github.com/anacrolix/log v0.14.2 + github.com/anacrolix/torrent v1.52.6-0.20230816110201-613470861e67 github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b github.com/crate-crypto/go-kzg-4844 v0.3.0 github.com/deckarep/golang-set/v2 v2.3.0 @@ -30,21 +29,21 @@ require ( github.com/google/btree v1.1.2 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/hashicorp/golang-lru/v2 v2.0.4 - github.com/holiman/uint256 v1.2.2 + github.com/holiman/uint256 v1.2.3 github.com/matryer/moq v0.3.2 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/spaolacci/murmur3 v1.1.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/btree v1.6.0 - golang.org/x/crypto v0.10.0 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 + golang.org/x/crypto v0.12.0 + golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 golang.org/x/sync v0.3.0 - golang.org/x/sys v0.9.0 + golang.org/x/sys v0.12.0 golang.org/x/time v0.3.0 - google.golang.org/grpc v1.56.1 + google.golang.org/grpc v1.57.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/protobuf v1.31.0 ) require ( @@ -53,7 +52,7 @@ require ( github.com/alecthomas/atomic v0.1.0-alpha2 // indirect github.com/anacrolix/chansync v0.3.0 // indirect github.com/anacrolix/envpprof v1.2.1 // indirect - github.com/anacrolix/generics v0.0.0-20230428105757-683593396d68 // indirect + github.com/anacrolix/generics v0.0.0-20230816103846-fe11fdc0e0e3 // indirect github.com/anacrolix/missinggo v1.3.0 // indirect github.com/anacrolix/missinggo/perf v1.0.0 // indirect github.com/anacrolix/missinggo/v2 v2.7.2-0.20230527121029-a582b4f397b9 // indirect @@ -77,9 +76,8 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect - github.com/lispad/go-generics-tools v1.1.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/pion/datachannel v1.5.2 // indirect @@ -108,11 +106,11 @@ require ( go.etcd.io/bbolt v1.3.6 // indirect go.opentelemetry.io/otel v1.8.0 // indirect go.opentelemetry.io/otel/trace v1.8.0 // indirect - golang.org/x/mod v0.9.0 // indirect + golang.org/x/mod v0.11.0 // indirect golang.org/x/net v0.11.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/text v0.12.0 // indirect golang.org/x/tools v0.7.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 3dca418d7..45e3c93fc 100644 --- a/go.sum +++ b/go.sum @@ -35,16 +35,16 @@ github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54g github.com/anacrolix/envpprof v1.1.0/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4= github.com/anacrolix/envpprof v1.2.1 h1:25TJe6t/i0AfzzldiGFKCpD+s+dk8lONBcacJZB2rdE= github.com/anacrolix/envpprof v1.2.1/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4= -github.com/anacrolix/generics v0.0.0-20230428105757-683593396d68 h1:fyXlBfnlFzZSFckJ8QLb2lfmWfY++4RiUnae7ZMuv0A= -github.com/anacrolix/generics v0.0.0-20230428105757-683593396d68/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8= -github.com/anacrolix/go-libutp v1.3.0 h1:D18Pvhzq3kvTlMRmjcG0rXM7INfVdfNtfxaoJwzZm9o= -github.com/anacrolix/go-libutp v1.3.0/go.mod h1:heF41EC8kN0qCLMokLBVkB8NXiLwx3t8R8810MTNI5o= +github.com/anacrolix/generics v0.0.0-20230816103846-fe11fdc0e0e3 h1:O5xBrk97JnkTZdTsxsnQOBfD22/4L5rJXrBZrKUhJOY= +github.com/anacrolix/generics v0.0.0-20230816103846-fe11fdc0e0e3/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8= +github.com/anacrolix/go-libutp v1.3.1 h1:idJzreNLl+hNjGC3ZnUOjujEaryeOGgkwHLqSGoige0= +github.com/anacrolix/go-libutp v1.3.1/go.mod h1:heF41EC8kN0qCLMokLBVkB8NXiLwx3t8R8810MTNI5o= github.com/anacrolix/log v0.3.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU= github.com/anacrolix/log v0.6.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU= github.com/anacrolix/log v0.10.1-0.20220123034749-3920702c17f8/go.mod h1:GmnE2c0nvz8pOIPUSC9Rawgefy1sDXqposC2wgtBZE4= github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+BFxZ68= -github.com/anacrolix/log v0.14.0 h1:mYhTSemILe/Z8tIxbGdTIWWpPspI8W/fhZHpoFbDaL0= -github.com/anacrolix/log v0.14.0/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= +github.com/anacrolix/log v0.14.2 h1:i9v/Lw/CceCKthcLW+UiajkSW8M/razXCwVYlZtAKsk= +github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62 h1:P04VG6Td13FHMgS5ZBcJX23NPC/fiC4cp9bXwYujdYM= github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62/go.mod h1:66cFKPCO7Sl4vbFnAaSq7e4OXtdMhRSBagJGWgmpJbM= github.com/anacrolix/missinggo v0.0.0-20180725070939-60ef2fbf63df/go.mod h1:kwGiTUTZ0+p4vAz3VbAI5a30t2YbvemcmspjKwrAz5s= @@ -75,8 +75,8 @@ github.com/anacrolix/sync v0.4.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DC github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/anacrolix/tagflag v1.0.0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/anacrolix/tagflag v1.1.0/go.mod h1:Scxs9CV10NQatSmbyjqmqmeQNwGzlNe0CMUMIxqHIG8= -github.com/anacrolix/torrent v1.52.0 h1:bjhmB3OmwXS/dpvvLoBEfsg8GUl9r5BVnTYk3Jfmge0= -github.com/anacrolix/torrent v1.52.0/go.mod h1:+XzcWXQU97PPEWSvpC85MJyqzP1vz47M5BYGno4vIHg= +github.com/anacrolix/torrent v1.52.6-0.20230816110201-613470861e67 h1:5ExouOJzDRpy5pXhSquvFsBdmjTAVDA5YQn6CWIuam4= +github.com/anacrolix/torrent v1.52.6-0.20230816110201-613470861e67/go.mod h1:dA7tlQGWx1oCogZcnvjTCU2pQaNOyY2YgyG2kumC1H0= github.com/anacrolix/upnp v0.1.3-0.20220123035249-922794e51c96 h1:QAVZ3pN/J4/UziniAhJR2OZ9Ox5kOY2053tBbbqUPYA= github.com/anacrolix/upnp v0.1.3-0.20220123035249-922794e51c96/go.mod h1:Wa6n8cYIdaG35x15aH3Zy6d03f7P728QfdcDeD/IEOs= github.com/anacrolix/utp v0.1.0 h1:FOpQOmIwYsnENnz7tAGohA+r6iXpRjrq8ssKSre2Cp4= @@ -129,6 +129,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/erigontech/mdbx-go v0.27.14 h1:IVVeQVCAjZRpAR8bThlP2ISxrOwdV35NZdGwAgotaRw= +github.com/erigontech/mdbx-go v0.27.14/go.mod h1:FAMxbOgqOnRDx51j8HjuJZIgznbDwjX7LItd+/UWyA4= github.com/frankban/quicktest v1.9.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -205,8 +207,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru/v2 v2.0.4 h1:7GHuZcgid37q8o5i3QI9KMT4nCWQQ3Kx3Ov6bb9MfK0= github.com/hashicorp/golang-lru/v2 v2.0.4/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -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/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/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -233,21 +235,17 @@ 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/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/ledgerwatch/log/v3 v3.8.0 h1:gCpp7uGtIerEz1jKVPeDnbIopFPud9ZnCpBLlLBGqPU= -github.com/ledgerwatch/log/v3 v3.8.0/go.mod h1:J2Jl6zV/58LeA6LTaVVnCGyf1/cYYSEOOLHY4ZN8S2A= +github.com/ledgerwatch/log/v3 v3.9.0 h1:iDwrXe0PVwBC68Dd94YSsHbMgQ3ufsgjzXtFNFVZFRk= +github.com/ledgerwatch/log/v3 v3.9.0/go.mod h1:EiAY6upmI/6LkNhOVxb4eVsmsP11HZCnZ3PlJMjYiqE= github.com/ledgerwatch/secp256k1 v1.0.0 h1:Usvz87YoTG0uePIV8woOof5cQnLXGYa162rFf3YnwaQ= github.com/ledgerwatch/secp256k1 v1.0.0/go.mod h1:SPmqJFciiF/Q0mPt2jVs2dTr/1TZBTIA+kPMmKgBAak= -github.com/ledgerwatch/trackerslist v1.1.0 h1:eKhgeURD9x/J3qzMnL6C0e0cLy6Ld7Ck/VR/yF+7cZQ= -github.com/ledgerwatch/trackerslist v1.1.0/go.mod h1:wWU/V810cpsEl//o49ebwAWf0BL0WOJiu/577L4IVok= -github.com/lispad/go-generics-tools v1.1.0 h1:mbSgcxdFVmpoyso1X/MJHXbSbSL3dD+qhRryyxk+/XY= -github.com/lispad/go-generics-tools v1.1.0/go.mod h1:2csd1EJljo/gy5qG4khXol7ivCPptNjG5Uv2X8MgK84= github.com/matryer/moq v0.3.2 h1:z7oltmpTxiQ9nKNg0Jc7z45TM+eO7OhCVohxRxwaudM= github.com/matryer/moq v0.3.2/go.mod h1:RJ75ZZZD71hejp39j4crZLsEDszGk6iH4v4YsWFKH4s= 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.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -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-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= @@ -379,15 +377,13 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO 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/testinprod-io/erigon-interfaces v0.0.0-20230719061837-f2e7a04bba79 h1:QaFFMXSaJyXy8CDrfUVmSycl1q8YWfahun0my/ZhEcg= -github.com/testinprod-io/erigon-interfaces v0.0.0-20230719061837-f2e7a04bba79/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc= +github.com/testinprod-io/erigon-interfaces v0.0.0-20230925052814-3e8d7f8f455f h1:5M6ahLfvgoyK846nPZYPiH2B20u8vVoBB1viTytw1FM= +github.com/testinprod-io/erigon-interfaces v0.0.0-20230925052814-3e8d7f8f455f/go.mod h1:ugQv1QllJzBny3cKZKxUrSnykkjkBgm27eQM6dnGAcc= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/torquem-ch/mdbx-go v0.27.10 h1:iwb8Wn9gse4MEYIltAna+pxMPCY7hA1/5LLN/Qrcsx0= -github.com/torquem-ch/mdbx-go v0.27.10/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= @@ -419,11 +415,11 @@ golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -432,8 +428,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -506,11 +502,12 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -524,8 +521,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -555,8 +552,8 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -564,8 +561,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -576,8 +573,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.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/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/gointerfaces/execution/execution.pb.go b/gointerfaces/execution/execution.pb.go index 9c9b08f16..6158f5f53 100644 --- a/gointerfaces/execution/execution.pb.go +++ b/gointerfaces/execution/execution.pb.go @@ -10,6 +10,7 @@ import ( types "github.com/ledgerwatch/erigon-lib/gointerfaces/types" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) @@ -21,55 +22,61 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type ValidationStatus int32 +type ExecutionStatus int32 const ( - ValidationStatus_Success ValidationStatus = 0 // State transition simulation is successful. - ValidationStatus_InvalidChain ValidationStatus = 1 // State transition simulation is Unsuccessful. - ValidationStatus_TooFarAway ValidationStatus = 2 // Chain hash is too far away from current chain head and unfeasible to validate. - ValidationStatus_MissingSegment ValidationStatus = 3 // Chain segments are missing. + ExecutionStatus_Success ExecutionStatus = 0 + ExecutionStatus_BadBlock ExecutionStatus = 1 + ExecutionStatus_TooFarAway ExecutionStatus = 2 + ExecutionStatus_MissingSegment ExecutionStatus = 3 + ExecutionStatus_InvalidForkchoice ExecutionStatus = 4 + ExecutionStatus_Busy ExecutionStatus = 5 ) -// Enum value maps for ValidationStatus. +// Enum value maps for ExecutionStatus. var ( - ValidationStatus_name = map[int32]string{ + ExecutionStatus_name = map[int32]string{ 0: "Success", - 1: "InvalidChain", + 1: "BadBlock", 2: "TooFarAway", 3: "MissingSegment", + 4: "InvalidForkchoice", + 5: "Busy", } - ValidationStatus_value = map[string]int32{ - "Success": 0, - "InvalidChain": 1, - "TooFarAway": 2, - "MissingSegment": 3, + ExecutionStatus_value = map[string]int32{ + "Success": 0, + "BadBlock": 1, + "TooFarAway": 2, + "MissingSegment": 3, + "InvalidForkchoice": 4, + "Busy": 5, } ) -func (x ValidationStatus) Enum() *ValidationStatus { - p := new(ValidationStatus) +func (x ExecutionStatus) Enum() *ExecutionStatus { + p := new(ExecutionStatus) *p = x return p } -func (x ValidationStatus) String() string { +func (x ExecutionStatus) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (ValidationStatus) Descriptor() protoreflect.EnumDescriptor { +func (ExecutionStatus) Descriptor() protoreflect.EnumDescriptor { return file_execution_execution_proto_enumTypes[0].Descriptor() } -func (ValidationStatus) Type() protoreflect.EnumType { +func (ExecutionStatus) Type() protoreflect.EnumType { return &file_execution_execution_proto_enumTypes[0] } -func (x ValidationStatus) Number() protoreflect.EnumNumber { +func (x ExecutionStatus) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use ValidationStatus.Descriptor instead. -func (ValidationStatus) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use ExecutionStatus.Descriptor instead. +func (ExecutionStatus) EnumDescriptor() ([]byte, []int) { return file_execution_execution_proto_rawDescGZIP(), []int{0} } @@ -78,8 +85,8 @@ type ForkChoiceReceipt struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Forkchoice is either successful or unsuccessful. - LatestValidHash *types.H256 `protobuf:"bytes,2,opt,name=latest_valid_hash,json=latestValidHash,proto3" json:"latest_valid_hash,omitempty"` // Return latest valid hash in case of halt of execution. + Status ExecutionStatus `protobuf:"varint,1,opt,name=status,proto3,enum=execution.ExecutionStatus" json:"status,omitempty"` + LatestValidHash *types.H256 `protobuf:"bytes,2,opt,name=latest_valid_hash,json=latestValidHash,proto3" json:"latest_valid_hash,omitempty"` // Return latest valid hash in case of halt of execution. } func (x *ForkChoiceReceipt) Reset() { @@ -114,11 +121,11 @@ func (*ForkChoiceReceipt) Descriptor() ([]byte, []int) { return file_execution_execution_proto_rawDescGZIP(), []int{0} } -func (x *ForkChoiceReceipt) GetSuccess() bool { +func (x *ForkChoiceReceipt) GetStatus() ExecutionStatus { if x != nil { - return x.Success + return x.Status } - return false + return ExecutionStatus_Success } func (x *ForkChoiceReceipt) GetLatestValidHash() *types.H256 { @@ -134,9 +141,8 @@ type ValidationReceipt struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ValidationStatus ValidationStatus `protobuf:"varint,1,opt,name=validation_status,json=validationStatus,proto3,enum=execution.ValidationStatus" json:"validation_status,omitempty"` - LatestValidHash *types.H256 `protobuf:"bytes,2,opt,name=latest_valid_hash,json=latestValidHash,proto3" json:"latest_valid_hash,omitempty"` - MissingHash *types.H256 `protobuf:"bytes,3,opt,name=missing_hash,json=missingHash,proto3,oneof" json:"missing_hash,omitempty"` // The missing hash, in case we receive MissingSegment so that we can reverse download it. + ValidationStatus ExecutionStatus `protobuf:"varint,1,opt,name=validation_status,json=validationStatus,proto3,enum=execution.ExecutionStatus" json:"validation_status,omitempty"` + LatestValidHash *types.H256 `protobuf:"bytes,2,opt,name=latest_valid_hash,json=latestValidHash,proto3" json:"latest_valid_hash,omitempty"` } func (x *ValidationReceipt) Reset() { @@ -171,11 +177,11 @@ func (*ValidationReceipt) Descriptor() ([]byte, []int) { return file_execution_execution_proto_rawDescGZIP(), []int{1} } -func (x *ValidationReceipt) GetValidationStatus() ValidationStatus { +func (x *ValidationReceipt) GetValidationStatus() ExecutionStatus { if x != nil { return x.ValidationStatus } - return ValidationStatus_Success + return ExecutionStatus_Success } func (x *ValidationReceipt) GetLatestValidHash() *types.H256 { @@ -185,13 +191,6 @@ func (x *ValidationReceipt) GetLatestValidHash() *types.H256 { return nil } -func (x *ValidationReceipt) GetMissingHash() *types.H256 { - if x != nil { - return x.MissingHash - } - return nil -} - type IsCanonicalResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -245,26 +244,30 @@ type Header struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ParentHash *types.H256 `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` - Coinbase *types.H160 `protobuf:"bytes,2,opt,name=coinbase,proto3" json:"coinbase,omitempty"` - StateRoot *types.H256 `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` - ReceiptRoot *types.H256 `protobuf:"bytes,4,opt,name=receipt_root,json=receiptRoot,proto3" json:"receipt_root,omitempty"` - LogsBloom *types.H2048 `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty"` - PrevRandao *types.H256 `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty"` - BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Nonce uint64 `protobuf:"varint,11,opt,name=nonce,proto3" json:"nonce,omitempty"` - ExtraData []byte `protobuf:"bytes,12,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` - Difficulty *types.H256 `protobuf:"bytes,13,opt,name=difficulty,proto3" json:"difficulty,omitempty"` - BlockHash *types.H256 `protobuf:"bytes,14,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // We keep this so that we can validate it - OmmerHash *types.H256 `protobuf:"bytes,15,opt,name=ommer_hash,json=ommerHash,proto3" json:"ommer_hash,omitempty"` - TransactionHash *types.H256 `protobuf:"bytes,16,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` - BaseFeePerGas *types.H256 `protobuf:"bytes,17,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3,oneof" json:"base_fee_per_gas,omitempty"` - WithdrawalHash *types.H256 `protobuf:"bytes,18,opt,name=withdrawal_hash,json=withdrawalHash,proto3,oneof" json:"withdrawal_hash,omitempty"` - DataGasUsed *uint64 `protobuf:"varint,19,opt,name=data_gas_used,json=dataGasUsed,proto3,oneof" json:"data_gas_used,omitempty"` - ExcessDataGas *uint64 `protobuf:"varint,20,opt,name=excess_data_gas,json=excessDataGas,proto3,oneof" json:"excess_data_gas,omitempty"` + ParentHash *types.H256 `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` + Coinbase *types.H160 `protobuf:"bytes,2,opt,name=coinbase,proto3" json:"coinbase,omitempty"` + StateRoot *types.H256 `protobuf:"bytes,3,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` + ReceiptRoot *types.H256 `protobuf:"bytes,4,opt,name=receipt_root,json=receiptRoot,proto3" json:"receipt_root,omitempty"` + LogsBloom *types.H2048 `protobuf:"bytes,5,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty"` + PrevRandao *types.H256 `protobuf:"bytes,6,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty"` + BlockNumber uint64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + GasLimit uint64 `protobuf:"varint,8,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` + GasUsed uint64 `protobuf:"varint,9,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Nonce uint64 `protobuf:"varint,11,opt,name=nonce,proto3" json:"nonce,omitempty"` + ExtraData []byte `protobuf:"bytes,12,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` + Difficulty *types.H256 `protobuf:"bytes,13,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + BlockHash *types.H256 `protobuf:"bytes,14,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // We keep this so that we can validate it + OmmerHash *types.H256 `protobuf:"bytes,15,opt,name=ommer_hash,json=ommerHash,proto3" json:"ommer_hash,omitempty"` + TransactionHash *types.H256 `protobuf:"bytes,16,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` + BaseFeePerGas *types.H256 `protobuf:"bytes,17,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3,oneof" json:"base_fee_per_gas,omitempty"` + WithdrawalHash *types.H256 `protobuf:"bytes,18,opt,name=withdrawal_hash,json=withdrawalHash,proto3,oneof" json:"withdrawal_hash,omitempty"` // added in Shapella (EIP-4895) + BlobGasUsed *uint64 `protobuf:"varint,19,opt,name=blob_gas_used,json=blobGasUsed,proto3,oneof" json:"blob_gas_used,omitempty"` // added in Dencun (EIP-4844) + ExcessBlobGas *uint64 `protobuf:"varint,20,opt,name=excess_blob_gas,json=excessBlobGas,proto3,oneof" json:"excess_blob_gas,omitempty"` // added in Dencun (EIP-4844) + ParentBeaconBlockRoot *types.H256 `protobuf:"bytes,21,opt,name=parent_beacon_block_root,json=parentBeaconBlockRoot,proto3,oneof" json:"parent_beacon_block_root,omitempty"` // added in Dencun (EIP-4788) + // AuRa + AuraStep *uint64 `protobuf:"varint,22,opt,name=aura_step,json=auraStep,proto3,oneof" json:"aura_step,omitempty"` + AuraSeal []byte `protobuf:"bytes,23,opt,name=aura_seal,json=auraSeal,proto3,oneof" json:"aura_seal,omitempty"` } func (x *Header) Reset() { @@ -425,20 +428,41 @@ func (x *Header) GetWithdrawalHash() *types.H256 { return nil } -func (x *Header) GetDataGasUsed() uint64 { - if x != nil && x.DataGasUsed != nil { - return *x.DataGasUsed +func (x *Header) GetBlobGasUsed() uint64 { + if x != nil && x.BlobGasUsed != nil { + return *x.BlobGasUsed + } + return 0 +} + +func (x *Header) GetExcessBlobGas() uint64 { + if x != nil && x.ExcessBlobGas != nil { + return *x.ExcessBlobGas } return 0 } -func (x *Header) GetExcessDataGas() uint64 { - if x != nil && x.ExcessDataGas != nil { - return *x.ExcessDataGas +func (x *Header) GetParentBeaconBlockRoot() *types.H256 { + if x != nil { + return x.ParentBeaconBlockRoot + } + return nil +} + +func (x *Header) GetAuraStep() uint64 { + if x != nil && x.AuraStep != nil { + return *x.AuraStep } return 0 } +func (x *Header) GetAuraSeal() []byte { + if x != nil { + return x.AuraSeal + } + return nil +} + // Body is a block body for execution type BlockBody struct { state protoimpl.MessageState @@ -520,6 +544,61 @@ func (x *BlockBody) GetWithdrawals() []*types.Withdrawal { return nil } +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Body *BlockBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{5} +} + +func (x *Block) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} + +func (x *Block) GetBody() *BlockBody { + if x != nil { + return x.Body + } + return nil +} + type GetHeaderResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -531,7 +610,7 @@ type GetHeaderResponse struct { func (x *GetHeaderResponse) Reset() { *x = GetHeaderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[5] + mi := &file_execution_execution_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -544,7 +623,7 @@ func (x *GetHeaderResponse) String() string { func (*GetHeaderResponse) ProtoMessage() {} func (x *GetHeaderResponse) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[5] + mi := &file_execution_execution_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -557,7 +636,7 @@ func (x *GetHeaderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHeaderResponse.ProtoReflect.Descriptor instead. func (*GetHeaderResponse) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{5} + return file_execution_execution_proto_rawDescGZIP(), []int{6} } func (x *GetHeaderResponse) GetHeader() *Header { @@ -567,6 +646,53 @@ func (x *GetHeaderResponse) GetHeader() *Header { return nil } +type GetTDResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Td *types.H256 `protobuf:"bytes,1,opt,name=td,proto3,oneof" json:"td,omitempty"` +} + +func (x *GetTDResponse) Reset() { + *x = GetTDResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTDResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTDResponse) ProtoMessage() {} + +func (x *GetTDResponse) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTDResponse.ProtoReflect.Descriptor instead. +func (*GetTDResponse) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{7} +} + +func (x *GetTDResponse) GetTd() *types.H256 { + if x != nil { + return x.Td + } + return nil +} + type GetBodyResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -578,7 +704,7 @@ type GetBodyResponse struct { func (x *GetBodyResponse) Reset() { *x = GetBodyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[6] + mi := &file_execution_execution_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -591,7 +717,7 @@ func (x *GetBodyResponse) String() string { func (*GetBodyResponse) ProtoMessage() {} func (x *GetBodyResponse) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[6] + mi := &file_execution_execution_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -604,7 +730,7 @@ func (x *GetBodyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBodyResponse.ProtoReflect.Descriptor instead. func (*GetBodyResponse) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{6} + return file_execution_execution_proto_rawDescGZIP(), []int{8} } func (x *GetBodyResponse) GetBody() *BlockBody { @@ -625,7 +751,7 @@ type GetHeaderHashNumberResponse struct { func (x *GetHeaderHashNumberResponse) Reset() { *x = GetHeaderHashNumberResponse{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[7] + mi := &file_execution_execution_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -638,7 +764,7 @@ func (x *GetHeaderHashNumberResponse) String() string { func (*GetHeaderHashNumberResponse) ProtoMessage() {} func (x *GetHeaderHashNumberResponse) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[7] + mi := &file_execution_execution_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -651,7 +777,7 @@ func (x *GetHeaderHashNumberResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHeaderHashNumberResponse.ProtoReflect.Descriptor instead. func (*GetHeaderHashNumberResponse) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{7} + return file_execution_execution_proto_rawDescGZIP(), []int{9} } func (x *GetHeaderHashNumberResponse) GetBlockNumber() uint64 { @@ -674,7 +800,7 @@ type GetSegmentRequest struct { func (x *GetSegmentRequest) Reset() { *x = GetSegmentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[8] + mi := &file_execution_execution_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -687,7 +813,7 @@ func (x *GetSegmentRequest) String() string { func (*GetSegmentRequest) ProtoMessage() {} func (x *GetSegmentRequest) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[8] + mi := &file_execution_execution_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -700,7 +826,7 @@ func (x *GetSegmentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSegmentRequest.ProtoReflect.Descriptor instead. func (*GetSegmentRequest) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{8} + return file_execution_execution_proto_rawDescGZIP(), []int{10} } func (x *GetSegmentRequest) GetBlockNumber() uint64 { @@ -717,31 +843,31 @@ func (x *GetSegmentRequest) GetBlockHash() *types.H256 { return nil } -type InsertHeadersRequest struct { +type InsertBlocksRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Headers []*Header `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` + Blocks []*Block `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` } -func (x *InsertHeadersRequest) Reset() { - *x = InsertHeadersRequest{} +func (x *InsertBlocksRequest) Reset() { + *x = InsertBlocksRequest{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[9] + mi := &file_execution_execution_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *InsertHeadersRequest) String() string { +func (x *InsertBlocksRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InsertHeadersRequest) ProtoMessage() {} +func (*InsertBlocksRequest) ProtoMessage() {} -func (x *InsertHeadersRequest) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[9] +func (x *InsertBlocksRequest) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -752,43 +878,46 @@ func (x *InsertHeadersRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InsertHeadersRequest.ProtoReflect.Descriptor instead. -func (*InsertHeadersRequest) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{9} +// Deprecated: Use InsertBlocksRequest.ProtoReflect.Descriptor instead. +func (*InsertBlocksRequest) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{11} } -func (x *InsertHeadersRequest) GetHeaders() []*Header { +func (x *InsertBlocksRequest) GetBlocks() []*Block { if x != nil { - return x.Headers + return x.Blocks } return nil } -type InsertBodiesRequest struct { +type ForkChoice struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Bodies []*BlockBody `protobuf:"bytes,1,rep,name=bodies,proto3" json:"bodies,omitempty"` + HeadBlockHash *types.H256 `protobuf:"bytes,1,opt,name=head_block_hash,json=headBlockHash,proto3" json:"head_block_hash,omitempty"` + Timeout uint64 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` // Timeout in milliseconds for fcu before it becomes async. + FinalizedBlockHash *types.H256 `protobuf:"bytes,3,opt,name=finalized_block_hash,json=finalizedBlockHash,proto3,oneof" json:"finalized_block_hash,omitempty"` + SafeBlockHash *types.H256 `protobuf:"bytes,4,opt,name=safe_block_hash,json=safeBlockHash,proto3,oneof" json:"safe_block_hash,omitempty"` } -func (x *InsertBodiesRequest) Reset() { - *x = InsertBodiesRequest{} +func (x *ForkChoice) Reset() { + *x = ForkChoice{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[10] + mi := &file_execution_execution_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *InsertBodiesRequest) String() string { +func (x *ForkChoice) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InsertBodiesRequest) ProtoMessage() {} +func (*ForkChoice) ProtoMessage() {} -func (x *InsertBodiesRequest) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[10] +func (x *ForkChoice) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -799,41 +928,64 @@ func (x *InsertBodiesRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InsertBodiesRequest.ProtoReflect.Descriptor instead. -func (*InsertBodiesRequest) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{10} +// Deprecated: Use ForkChoice.ProtoReflect.Descriptor instead. +func (*ForkChoice) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{12} } -func (x *InsertBodiesRequest) GetBodies() []*BlockBody { +func (x *ForkChoice) GetHeadBlockHash() *types.H256 { if x != nil { - return x.Bodies + return x.HeadBlockHash + } + return nil +} + +func (x *ForkChoice) GetTimeout() uint64 { + if x != nil { + return x.Timeout + } + return 0 +} + +func (x *ForkChoice) GetFinalizedBlockHash() *types.H256 { + if x != nil { + return x.FinalizedBlockHash } return nil } -type EmptyMessage struct { +func (x *ForkChoice) GetSafeBlockHash() *types.H256 { + if x != nil { + return x.SafeBlockHash + } + return nil +} + +type InsertionResult struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Result ExecutionStatus `protobuf:"varint,1,opt,name=result,proto3,enum=execution.ExecutionStatus" json:"result,omitempty"` } -func (x *EmptyMessage) Reset() { - *x = EmptyMessage{} +func (x *InsertionResult) Reset() { + *x = InsertionResult{} if protoimpl.UnsafeEnabled { - mi := &file_execution_execution_proto_msgTypes[11] + mi := &file_execution_execution_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *EmptyMessage) String() string { +func (x *InsertionResult) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EmptyMessage) ProtoMessage() {} +func (*InsertionResult) ProtoMessage() {} -func (x *EmptyMessage) ProtoReflect() protoreflect.Message { - mi := &file_execution_execution_proto_msgTypes[11] +func (x *InsertionResult) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -844,301 +996,1083 @@ func (x *EmptyMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead. -func (*EmptyMessage) Descriptor() ([]byte, []int) { - return file_execution_execution_proto_rawDescGZIP(), []int{11} +// Deprecated: Use InsertionResult.ProtoReflect.Descriptor instead. +func (*InsertionResult) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{13} } -var File_execution_execution_proto protoreflect.FileDescriptor +func (x *InsertionResult) GetResult() ExecutionStatus { + if x != nil { + return x.Result + } + return ExecutionStatus_Success +} -var file_execution_execution_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x66, 0x0a, 0x11, 0x46, 0x6f, 0x72, - 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, - 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, - 0x68, 0x22, 0xdc, 0x01, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x48, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x37, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x0c, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x00, 0x52, - 0x0b, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x42, - 0x0f, 0x0a, 0x0d, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x22, 0x33, 0x0a, 0x13, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x6f, 0x6e, - 0x69, 0x63, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x6f, - 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x9c, 0x07, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x2c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, - 0x35, 0x36, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x27, - 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x08, 0x63, - 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, - 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x48, 0x32, 0x30, 0x34, 0x38, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, - 0x12, 0x2c, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, - 0x35, 0x36, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x0a, - 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0a, 0x64, - 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x0a, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x36, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x12, 0x39, 0x0a, 0x10, 0x62, 0x61, 0x73, - 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, - 0x48, 0x00, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, - 0x73, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x01, 0x52, 0x0e, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x27, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, - 0x18, 0x13, 0x20, 0x01, 0x28, 0x04, 0x48, 0x02, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x47, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, - 0x04, 0x48, 0x03, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x47, - 0x61, 0x73, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, - 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x42, 0x10, - 0x0a, 0x0e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, - 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x5f, 0x67, 0x61, 0x73, 0x22, 0xde, 0x01, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x2a, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, - 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x21, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, - 0x12, 0x33, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0x4e, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x48, 0x00, 0x52, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0x56, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, - 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x26, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x01, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x43, 0x0a, 0x14, 0x49, 0x6e, 0x73, 0x65, 0x72, - 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2b, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x22, 0x43, 0x0a, 0x13, - 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x62, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x06, 0x62, 0x6f, 0x64, 0x69, 0x65, - 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x2a, 0x55, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, 0x46, 0x61, 0x72, 0x41, 0x77, - 0x61, 0x79, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x53, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x32, 0xf7, 0x04, 0x0a, 0x09, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0d, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x47, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, - 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x17, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x0b, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x3d, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, - 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, - 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x43, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x2e, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0f, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, - 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0b, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x26, 0x2e, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x17, 0x5a, 0x15, 0x2e, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x3b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, +type ValidationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash *types.H256 `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Number uint64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` } -var ( - file_execution_execution_proto_rawDescOnce sync.Once - file_execution_execution_proto_rawDescData = file_execution_execution_proto_rawDesc -) +func (x *ValidationRequest) Reset() { + *x = ValidationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func file_execution_execution_proto_rawDescGZIP() []byte { - file_execution_execution_proto_rawDescOnce.Do(func() { - file_execution_execution_proto_rawDescData = protoimpl.X.CompressGZIP(file_execution_execution_proto_rawDescData) - }) - return file_execution_execution_proto_rawDescData +func (x *ValidationRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var file_execution_execution_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_execution_execution_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_execution_execution_proto_goTypes = []interface{}{ - (ValidationStatus)(0), // 0: execution.ValidationStatus - (*ForkChoiceReceipt)(nil), // 1: execution.ForkChoiceReceipt - (*ValidationReceipt)(nil), // 2: execution.ValidationReceipt - (*IsCanonicalResponse)(nil), // 3: execution.IsCanonicalResponse - (*Header)(nil), // 4: execution.Header - (*BlockBody)(nil), // 5: execution.BlockBody - (*GetHeaderResponse)(nil), // 6: execution.GetHeaderResponse - (*GetBodyResponse)(nil), // 7: execution.GetBodyResponse - (*GetHeaderHashNumberResponse)(nil), // 8: execution.GetHeaderHashNumberResponse - (*GetSegmentRequest)(nil), // 9: execution.GetSegmentRequest - (*InsertHeadersRequest)(nil), // 10: execution.InsertHeadersRequest - (*InsertBodiesRequest)(nil), // 11: execution.InsertBodiesRequest - (*EmptyMessage)(nil), // 12: execution.EmptyMessage - (*types.H256)(nil), // 13: types.H256 - (*types.H160)(nil), // 14: types.H160 - (*types.H2048)(nil), // 15: types.H2048 - (*types.Withdrawal)(nil), // 16: types.Withdrawal - (*types.ExecutionPayload)(nil), // 17: types.ExecutionPayload +func (*ValidationRequest) ProtoMessage() {} + +func (x *ValidationRequest) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var file_execution_execution_proto_depIdxs = []int32{ - 13, // 0: execution.ForkChoiceReceipt.latest_valid_hash:type_name -> types.H256 - 0, // 1: execution.ValidationReceipt.validation_status:type_name -> execution.ValidationStatus - 13, // 2: execution.ValidationReceipt.latest_valid_hash:type_name -> types.H256 - 13, // 3: execution.ValidationReceipt.missing_hash:type_name -> types.H256 - 13, // 4: execution.Header.parent_hash:type_name -> types.H256 - 14, // 5: execution.Header.coinbase:type_name -> types.H160 - 13, // 6: execution.Header.state_root:type_name -> types.H256 - 13, // 7: execution.Header.receipt_root:type_name -> types.H256 - 15, // 8: execution.Header.logs_bloom:type_name -> types.H2048 - 13, // 9: execution.Header.prev_randao:type_name -> types.H256 - 13, // 10: execution.Header.difficulty:type_name -> types.H256 - 13, // 11: execution.Header.block_hash:type_name -> types.H256 - 13, // 12: execution.Header.ommer_hash:type_name -> types.H256 - 13, // 13: execution.Header.transaction_hash:type_name -> types.H256 - 13, // 14: execution.Header.base_fee_per_gas:type_name -> types.H256 - 13, // 15: execution.Header.withdrawal_hash:type_name -> types.H256 - 13, // 16: execution.BlockBody.block_hash:type_name -> types.H256 - 4, // 17: execution.BlockBody.uncles:type_name -> execution.Header - 16, // 18: execution.BlockBody.withdrawals:type_name -> types.Withdrawal - 4, // 19: execution.GetHeaderResponse.header:type_name -> execution.Header - 5, // 20: execution.GetBodyResponse.body:type_name -> execution.BlockBody - 13, // 21: execution.GetSegmentRequest.block_hash:type_name -> types.H256 - 4, // 22: execution.InsertHeadersRequest.headers:type_name -> execution.Header - 5, // 23: execution.InsertBodiesRequest.bodies:type_name -> execution.BlockBody - 10, // 24: execution.Execution.InsertHeaders:input_type -> execution.InsertHeadersRequest - 11, // 25: execution.Execution.InsertBodies:input_type -> execution.InsertBodiesRequest - 13, // 26: execution.Execution.ValidateChain:input_type -> types.H256 - 13, // 27: execution.Execution.UpdateForkChoice:input_type -> types.H256 - 12, // 28: execution.Execution.AssembleBlock:input_type -> execution.EmptyMessage - 9, // 29: execution.Execution.GetHeader:input_type -> execution.GetSegmentRequest - 9, // 30: execution.Execution.GetBody:input_type -> execution.GetSegmentRequest - 13, // 31: execution.Execution.IsCanonicalHash:input_type -> types.H256 - 13, // 32: execution.Execution.GetHeaderHashNumber:input_type -> types.H256 - 12, // 33: execution.Execution.InsertHeaders:output_type -> execution.EmptyMessage - 12, // 34: execution.Execution.InsertBodies:output_type -> execution.EmptyMessage - 2, // 35: execution.Execution.ValidateChain:output_type -> execution.ValidationReceipt - 1, // 36: execution.Execution.UpdateForkChoice:output_type -> execution.ForkChoiceReceipt - 17, // 37: execution.Execution.AssembleBlock:output_type -> types.ExecutionPayload - 6, // 38: execution.Execution.GetHeader:output_type -> execution.GetHeaderResponse - 7, // 39: execution.Execution.GetBody:output_type -> execution.GetBodyResponse - 3, // 40: execution.Execution.IsCanonicalHash:output_type -> execution.IsCanonicalResponse - 8, // 41: execution.Execution.GetHeaderHashNumber:output_type -> execution.GetHeaderHashNumberResponse - 33, // [33:42] is the sub-list for method output_type - 24, // [24:33] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + +// Deprecated: Use ValidationRequest.ProtoReflect.Descriptor instead. +func (*ValidationRequest) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{14} } -func init() { file_execution_execution_proto_init() } -func file_execution_execution_proto_init() { - if File_execution_execution_proto != nil { - return +func (x *ValidationRequest) GetHash() *types.H256 { + if x != nil { + return x.Hash } - if !protoimpl.UnsafeEnabled { - file_execution_execution_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForkChoiceReceipt); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } + return nil +} + +func (x *ValidationRequest) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + +type AssembleBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ParentHash *types.H256 `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PrevRandao *types.H256 `protobuf:"bytes,3,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty"` + SuggestedFeeRecipient *types.H160 `protobuf:"bytes,4,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty"` + Withdrawals []*types.Withdrawal `protobuf:"bytes,5,rep,name=withdrawals,proto3" json:"withdrawals,omitempty"` // added in Shapella (EIP-4895) + ParentBeaconBlockRoot *types.H256 `protobuf:"bytes,6,opt,name=parent_beacon_block_root,json=parentBeaconBlockRoot,proto3,oneof" json:"parent_beacon_block_root,omitempty"` // added in Dencun (EIP-4788) + // optimism + Transactions [][]byte `protobuf:"bytes,7,rep,name=transactions,proto3" json:"transactions,omitempty"` + NoTxPool bool `protobuf:"varint,8,opt,name=no_tx_pool,json=noTxPool,proto3" json:"no_tx_pool,omitempty"` + GasLimit *uint64 `protobuf:"varint,9,opt,name=gas_limit,json=gasLimit,proto3,oneof" json:"gas_limit,omitempty"` +} + +func (x *AssembleBlockRequest) Reset() { + *x = AssembleBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AssembleBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssembleBlockRequest) ProtoMessage() {} + +func (x *AssembleBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - file_execution_execution_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidationReceipt); i { + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AssembleBlockRequest.ProtoReflect.Descriptor instead. +func (*AssembleBlockRequest) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{15} +} + +func (x *AssembleBlockRequest) GetParentHash() *types.H256 { + if x != nil { + return x.ParentHash + } + return nil +} + +func (x *AssembleBlockRequest) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *AssembleBlockRequest) GetPrevRandao() *types.H256 { + if x != nil { + return x.PrevRandao + } + return nil +} + +func (x *AssembleBlockRequest) GetSuggestedFeeRecipient() *types.H160 { + if x != nil { + return x.SuggestedFeeRecipient + } + return nil +} + +func (x *AssembleBlockRequest) GetWithdrawals() []*types.Withdrawal { + if x != nil { + return x.Withdrawals + } + return nil +} + +func (x *AssembleBlockRequest) GetParentBeaconBlockRoot() *types.H256 { + if x != nil { + return x.ParentBeaconBlockRoot + } + return nil +} + +func (x *AssembleBlockRequest) GetTransactions() [][]byte { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *AssembleBlockRequest) GetNoTxPool() bool { + if x != nil { + return x.NoTxPool + } + return false +} + +func (x *AssembleBlockRequest) GetGasLimit() uint64 { + if x != nil && x.GasLimit != nil { + return *x.GasLimit + } + return 0 +} + +type AssembleBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Busy bool `protobuf:"varint,2,opt,name=busy,proto3" json:"busy,omitempty"` +} + +func (x *AssembleBlockResponse) Reset() { + *x = AssembleBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AssembleBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssembleBlockResponse) ProtoMessage() {} + +func (x *AssembleBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AssembleBlockResponse.ProtoReflect.Descriptor instead. +func (*AssembleBlockResponse) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{16} +} + +func (x *AssembleBlockResponse) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AssembleBlockResponse) GetBusy() bool { + if x != nil { + return x.Busy + } + return false +} + +type GetAssembledBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetAssembledBlockRequest) Reset() { + *x = GetAssembledBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssembledBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssembledBlockRequest) ProtoMessage() {} + +func (x *GetAssembledBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAssembledBlockRequest.ProtoReflect.Descriptor instead. +func (*GetAssembledBlockRequest) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{17} +} + +func (x *GetAssembledBlockRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type AssembledBlockData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExecutionPayload *types.ExecutionPayload `protobuf:"bytes,1,opt,name=execution_payload,json=executionPayload,proto3" json:"execution_payload,omitempty"` + BlockValue *types.H256 `protobuf:"bytes,2,opt,name=block_value,json=blockValue,proto3" json:"block_value,omitempty"` + BlobsBundle *types.BlobsBundleV1 `protobuf:"bytes,3,opt,name=blobs_bundle,json=blobsBundle,proto3" json:"blobs_bundle,omitempty"` +} + +func (x *AssembledBlockData) Reset() { + *x = AssembledBlockData{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AssembledBlockData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssembledBlockData) ProtoMessage() {} + +func (x *AssembledBlockData) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AssembledBlockData.ProtoReflect.Descriptor instead. +func (*AssembledBlockData) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{18} +} + +func (x *AssembledBlockData) GetExecutionPayload() *types.ExecutionPayload { + if x != nil { + return x.ExecutionPayload + } + return nil +} + +func (x *AssembledBlockData) GetBlockValue() *types.H256 { + if x != nil { + return x.BlockValue + } + return nil +} + +func (x *AssembledBlockData) GetBlobsBundle() *types.BlobsBundleV1 { + if x != nil { + return x.BlobsBundle + } + return nil +} + +type GetAssembledBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *AssembledBlockData `protobuf:"bytes,1,opt,name=data,proto3,oneof" json:"data,omitempty"` + Busy bool `protobuf:"varint,2,opt,name=busy,proto3" json:"busy,omitempty"` +} + +func (x *GetAssembledBlockResponse) Reset() { + *x = GetAssembledBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAssembledBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssembledBlockResponse) ProtoMessage() {} + +func (x *GetAssembledBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAssembledBlockResponse.ProtoReflect.Descriptor instead. +func (*GetAssembledBlockResponse) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{19} +} + +func (x *GetAssembledBlockResponse) GetData() *AssembledBlockData { + if x != nil { + return x.Data + } + return nil +} + +func (x *GetAssembledBlockResponse) GetBusy() bool { + if x != nil { + return x.Busy + } + return false +} + +type GetBodiesBatchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bodies []*BlockBody `protobuf:"bytes,1,rep,name=bodies,proto3" json:"bodies,omitempty"` +} + +func (x *GetBodiesBatchResponse) Reset() { + *x = GetBodiesBatchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBodiesBatchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBodiesBatchResponse) ProtoMessage() {} + +func (x *GetBodiesBatchResponse) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBodiesBatchResponse.ProtoReflect.Descriptor instead. +func (*GetBodiesBatchResponse) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{20} +} + +func (x *GetBodiesBatchResponse) GetBodies() []*BlockBody { + if x != nil { + return x.Bodies + } + return nil +} + +type GetBodiesByHashesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hashes []*types.H256 `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` +} + +func (x *GetBodiesByHashesRequest) Reset() { + *x = GetBodiesByHashesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBodiesByHashesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBodiesByHashesRequest) ProtoMessage() {} + +func (x *GetBodiesByHashesRequest) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBodiesByHashesRequest.ProtoReflect.Descriptor instead. +func (*GetBodiesByHashesRequest) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{21} +} + +func (x *GetBodiesByHashesRequest) GetHashes() []*types.H256 { + if x != nil { + return x.Hashes + } + return nil +} + +type GetBodiesByRangeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetBodiesByRangeRequest) Reset() { + *x = GetBodiesByRangeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBodiesByRangeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBodiesByRangeRequest) ProtoMessage() {} + +func (x *GetBodiesByRangeRequest) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBodiesByRangeRequest.ProtoReflect.Descriptor instead. +func (*GetBodiesByRangeRequest) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{22} +} + +func (x *GetBodiesByRangeRequest) GetStart() uint64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *GetBodiesByRangeRequest) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type ReadyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` +} + +func (x *ReadyResponse) Reset() { + *x = ReadyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_execution_execution_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadyResponse) ProtoMessage() {} + +func (x *ReadyResponse) ProtoReflect() protoreflect.Message { + mi := &file_execution_execution_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadyResponse.ProtoReflect.Descriptor instead. +func (*ReadyResponse) Descriptor() ([]byte, []int) { + return file_execution_execution_proto_rawDescGZIP(), []int{23} +} + +func (x *ReadyResponse) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +var File_execution_execution_proto protoreflect.FileDescriptor + +var file_execution_execution_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x11, 0x46, 0x6f, 0x72, 0x6b, 0x43, + 0x68, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x32, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x37, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, 0x68, 0x22, 0x95, 0x01, 0x0a, 0x11, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, + 0x47, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, + 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, + 0x68, 0x22, 0x33, 0x0a, 0x13, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x6f, + 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x61, 0x6e, + 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x22, 0xe4, 0x08, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x2c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, + 0x32, 0x35, 0x36, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x27, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x08, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, + 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x48, 0x32, 0x30, 0x34, 0x38, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, + 0x6d, 0x12, 0x2c, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, + 0x32, 0x35, 0x36, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, + 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, + 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0a, + 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x0a, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x0a, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x36, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x12, 0x39, 0x0a, 0x10, 0x62, 0x61, + 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, + 0x36, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, + 0x61, 0x73, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x01, 0x52, 0x0e, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, + 0x12, 0x27, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x04, 0x48, 0x02, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0f, 0x65, 0x78, 0x63, + 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x04, 0x48, 0x03, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, + 0x47, 0x61, 0x73, 0x88, 0x01, 0x01, 0x12, 0x49, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x04, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x20, 0x0a, 0x09, 0x61, 0x75, 0x72, 0x61, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x16, + 0x20, 0x01, 0x28, 0x04, 0x48, 0x05, 0x52, 0x08, 0x61, 0x75, 0x72, 0x61, 0x53, 0x74, 0x65, 0x70, + 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x61, 0x75, 0x72, 0x61, 0x5f, 0x73, 0x65, 0x61, 0x6c, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x06, 0x52, 0x08, 0x61, 0x75, 0x72, 0x61, 0x53, 0x65, + 0x61, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, + 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x42, 0x10, + 0x0a, 0x0e, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, + 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, + 0x5f, 0x67, 0x61, 0x73, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x75, 0x72, 0x61, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x42, + 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x75, 0x72, 0x61, 0x5f, 0x73, 0x65, 0x61, 0x6c, 0x22, 0xde, 0x01, + 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2a, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, + 0x0a, 0x06, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x06, 0x75, 0x6e, 0x63, 0x6c, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x0b, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, + 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x22, 0x5c, + 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x29, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x28, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x4e, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x88, 0x01, + 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x38, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x54, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, + 0x02, 0x74, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x00, 0x52, 0x02, 0x74, 0x64, 0x88, 0x01, 0x01, 0x42, + 0x05, 0x0a, 0x03, 0x5f, 0x74, 0x64, 0x22, 0x49, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x48, 0x00, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, + 0x79, 0x22, 0x56, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, + 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x26, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x26, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x48, 0x01, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x3f, 0x0a, 0x13, 0x49, 0x6e, 0x73, 0x65, + 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x28, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x86, 0x02, 0x0a, 0x0a, 0x46, 0x6f, + 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0d, + 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, + 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x42, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, + 0x35, 0x36, 0x48, 0x00, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x0f, 0x73, + 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, + 0x36, 0x48, 0x01, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x88, 0x01, 0x01, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x42, 0x12, + 0x0a, 0x10, 0x5f, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x22, 0x45, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x4c, 0x0a, 0x11, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, + 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xe4, 0x03, 0x0a, 0x14, 0x41, 0x73, 0x73, 0x65, + 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, + 0x35, 0x36, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0a, + 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x43, 0x0a, 0x17, 0x73, 0x75, + 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x15, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x33, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x61, 0x6c, 0x73, 0x12, 0x49, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, + 0x32, 0x35, 0x36, 0x48, 0x00, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x22, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x0a, 0x6e, 0x6f, 0x5f, 0x74, 0x78, 0x5f, 0x70, 0x6f, 0x6f, + 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x6f, 0x54, 0x78, 0x50, 0x6f, 0x6f, + 0x6c, 0x12, 0x20, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x88, 0x01, 0x01, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, + 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x3b, + 0x0a, 0x15, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x75, 0x73, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x75, 0x73, 0x79, 0x22, 0x2a, 0x0a, 0x18, 0x47, + 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0xc1, 0x01, 0x0a, 0x12, 0x41, 0x73, 0x73, 0x65, + 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x44, + 0x0a, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2c, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x70, 0x0a, 0x19, 0x47, + 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, + 0x12, 0x12, 0x0a, 0x04, 0x62, 0x75, 0x73, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, + 0x62, 0x75, 0x73, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x22, 0x46, 0x0a, + 0x16, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x62, 0x6f, 0x64, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x06, 0x62, + 0x6f, 0x64, 0x69, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, + 0x65, 0x73, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x23, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x45, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, + 0x69, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x25, 0x0a, + 0x0d, 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, + 0x65, 0x61, 0x64, 0x79, 0x2a, 0x71, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, 0x46, 0x61, 0x72, 0x41, 0x77, 0x61, 0x79, + 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x46, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x10, 0x04, 0x12, 0x08, 0x0a, + 0x04, 0x42, 0x75, 0x73, 0x79, 0x10, 0x05, 0x32, 0xf6, 0x08, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x4b, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x47, + 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, + 0x63, 0x65, 0x12, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, + 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x52, 0x0a, 0x0d, 0x41, 0x73, 0x73, 0x65, 0x6d, + 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x23, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x43, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x54, 0x44, 0x12, 0x1c, 0x2e, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x59, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x22, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x12, 0x23, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, + 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0f, 0x49, 0x73, 0x43, + 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x12, 0x0b, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x1e, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x73, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x1a, 0x26, 0x2e, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x72, 0x6b, + 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, + 0x68, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x17, 0x5a, 0x15, 0x2e, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3b, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_execution_execution_proto_rawDescOnce sync.Once + file_execution_execution_proto_rawDescData = file_execution_execution_proto_rawDesc +) + +func file_execution_execution_proto_rawDescGZIP() []byte { + file_execution_execution_proto_rawDescOnce.Do(func() { + file_execution_execution_proto_rawDescData = protoimpl.X.CompressGZIP(file_execution_execution_proto_rawDescData) + }) + return file_execution_execution_proto_rawDescData +} + +var file_execution_execution_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_execution_execution_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_execution_execution_proto_goTypes = []interface{}{ + (ExecutionStatus)(0), // 0: execution.ExecutionStatus + (*ForkChoiceReceipt)(nil), // 1: execution.ForkChoiceReceipt + (*ValidationReceipt)(nil), // 2: execution.ValidationReceipt + (*IsCanonicalResponse)(nil), // 3: execution.IsCanonicalResponse + (*Header)(nil), // 4: execution.Header + (*BlockBody)(nil), // 5: execution.BlockBody + (*Block)(nil), // 6: execution.Block + (*GetHeaderResponse)(nil), // 7: execution.GetHeaderResponse + (*GetTDResponse)(nil), // 8: execution.GetTDResponse + (*GetBodyResponse)(nil), // 9: execution.GetBodyResponse + (*GetHeaderHashNumberResponse)(nil), // 10: execution.GetHeaderHashNumberResponse + (*GetSegmentRequest)(nil), // 11: execution.GetSegmentRequest + (*InsertBlocksRequest)(nil), // 12: execution.InsertBlocksRequest + (*ForkChoice)(nil), // 13: execution.ForkChoice + (*InsertionResult)(nil), // 14: execution.InsertionResult + (*ValidationRequest)(nil), // 15: execution.ValidationRequest + (*AssembleBlockRequest)(nil), // 16: execution.AssembleBlockRequest + (*AssembleBlockResponse)(nil), // 17: execution.AssembleBlockResponse + (*GetAssembledBlockRequest)(nil), // 18: execution.GetAssembledBlockRequest + (*AssembledBlockData)(nil), // 19: execution.AssembledBlockData + (*GetAssembledBlockResponse)(nil), // 20: execution.GetAssembledBlockResponse + (*GetBodiesBatchResponse)(nil), // 21: execution.GetBodiesBatchResponse + (*GetBodiesByHashesRequest)(nil), // 22: execution.GetBodiesByHashesRequest + (*GetBodiesByRangeRequest)(nil), // 23: execution.GetBodiesByRangeRequest + (*ReadyResponse)(nil), // 24: execution.ReadyResponse + (*types.H256)(nil), // 25: types.H256 + (*types.H160)(nil), // 26: types.H160 + (*types.H2048)(nil), // 27: types.H2048 + (*types.Withdrawal)(nil), // 28: types.Withdrawal + (*types.ExecutionPayload)(nil), // 29: types.ExecutionPayload + (*types.BlobsBundleV1)(nil), // 30: types.BlobsBundleV1 + (*emptypb.Empty)(nil), // 31: google.protobuf.Empty +} +var file_execution_execution_proto_depIdxs = []int32{ + 0, // 0: execution.ForkChoiceReceipt.status:type_name -> execution.ExecutionStatus + 25, // 1: execution.ForkChoiceReceipt.latest_valid_hash:type_name -> types.H256 + 0, // 2: execution.ValidationReceipt.validation_status:type_name -> execution.ExecutionStatus + 25, // 3: execution.ValidationReceipt.latest_valid_hash:type_name -> types.H256 + 25, // 4: execution.Header.parent_hash:type_name -> types.H256 + 26, // 5: execution.Header.coinbase:type_name -> types.H160 + 25, // 6: execution.Header.state_root:type_name -> types.H256 + 25, // 7: execution.Header.receipt_root:type_name -> types.H256 + 27, // 8: execution.Header.logs_bloom:type_name -> types.H2048 + 25, // 9: execution.Header.prev_randao:type_name -> types.H256 + 25, // 10: execution.Header.difficulty:type_name -> types.H256 + 25, // 11: execution.Header.block_hash:type_name -> types.H256 + 25, // 12: execution.Header.ommer_hash:type_name -> types.H256 + 25, // 13: execution.Header.transaction_hash:type_name -> types.H256 + 25, // 14: execution.Header.base_fee_per_gas:type_name -> types.H256 + 25, // 15: execution.Header.withdrawal_hash:type_name -> types.H256 + 25, // 16: execution.Header.parent_beacon_block_root:type_name -> types.H256 + 25, // 17: execution.BlockBody.block_hash:type_name -> types.H256 + 4, // 18: execution.BlockBody.uncles:type_name -> execution.Header + 28, // 19: execution.BlockBody.withdrawals:type_name -> types.Withdrawal + 4, // 20: execution.Block.header:type_name -> execution.Header + 5, // 21: execution.Block.body:type_name -> execution.BlockBody + 4, // 22: execution.GetHeaderResponse.header:type_name -> execution.Header + 25, // 23: execution.GetTDResponse.td:type_name -> types.H256 + 5, // 24: execution.GetBodyResponse.body:type_name -> execution.BlockBody + 25, // 25: execution.GetSegmentRequest.block_hash:type_name -> types.H256 + 6, // 26: execution.InsertBlocksRequest.blocks:type_name -> execution.Block + 25, // 27: execution.ForkChoice.head_block_hash:type_name -> types.H256 + 25, // 28: execution.ForkChoice.finalized_block_hash:type_name -> types.H256 + 25, // 29: execution.ForkChoice.safe_block_hash:type_name -> types.H256 + 0, // 30: execution.InsertionResult.result:type_name -> execution.ExecutionStatus + 25, // 31: execution.ValidationRequest.hash:type_name -> types.H256 + 25, // 32: execution.AssembleBlockRequest.parent_hash:type_name -> types.H256 + 25, // 33: execution.AssembleBlockRequest.prev_randao:type_name -> types.H256 + 26, // 34: execution.AssembleBlockRequest.suggested_fee_recipient:type_name -> types.H160 + 28, // 35: execution.AssembleBlockRequest.withdrawals:type_name -> types.Withdrawal + 25, // 36: execution.AssembleBlockRequest.parent_beacon_block_root:type_name -> types.H256 + 29, // 37: execution.AssembledBlockData.execution_payload:type_name -> types.ExecutionPayload + 25, // 38: execution.AssembledBlockData.block_value:type_name -> types.H256 + 30, // 39: execution.AssembledBlockData.blobs_bundle:type_name -> types.BlobsBundleV1 + 19, // 40: execution.GetAssembledBlockResponse.data:type_name -> execution.AssembledBlockData + 5, // 41: execution.GetBodiesBatchResponse.bodies:type_name -> execution.BlockBody + 25, // 42: execution.GetBodiesByHashesRequest.hashes:type_name -> types.H256 + 12, // 43: execution.Execution.InsertBlocks:input_type -> execution.InsertBlocksRequest + 15, // 44: execution.Execution.ValidateChain:input_type -> execution.ValidationRequest + 13, // 45: execution.Execution.UpdateForkChoice:input_type -> execution.ForkChoice + 16, // 46: execution.Execution.AssembleBlock:input_type -> execution.AssembleBlockRequest + 18, // 47: execution.Execution.GetAssembledBlock:input_type -> execution.GetAssembledBlockRequest + 31, // 48: execution.Execution.CurrentHeader:input_type -> google.protobuf.Empty + 11, // 49: execution.Execution.GetTD:input_type -> execution.GetSegmentRequest + 11, // 50: execution.Execution.GetHeader:input_type -> execution.GetSegmentRequest + 11, // 51: execution.Execution.GetBody:input_type -> execution.GetSegmentRequest + 23, // 52: execution.Execution.GetBodiesByRange:input_type -> execution.GetBodiesByRangeRequest + 22, // 53: execution.Execution.GetBodiesByHashes:input_type -> execution.GetBodiesByHashesRequest + 25, // 54: execution.Execution.IsCanonicalHash:input_type -> types.H256 + 25, // 55: execution.Execution.GetHeaderHashNumber:input_type -> types.H256 + 31, // 56: execution.Execution.GetForkChoice:input_type -> google.protobuf.Empty + 31, // 57: execution.Execution.Ready:input_type -> google.protobuf.Empty + 14, // 58: execution.Execution.InsertBlocks:output_type -> execution.InsertionResult + 2, // 59: execution.Execution.ValidateChain:output_type -> execution.ValidationReceipt + 1, // 60: execution.Execution.UpdateForkChoice:output_type -> execution.ForkChoiceReceipt + 17, // 61: execution.Execution.AssembleBlock:output_type -> execution.AssembleBlockResponse + 20, // 62: execution.Execution.GetAssembledBlock:output_type -> execution.GetAssembledBlockResponse + 7, // 63: execution.Execution.CurrentHeader:output_type -> execution.GetHeaderResponse + 8, // 64: execution.Execution.GetTD:output_type -> execution.GetTDResponse + 7, // 65: execution.Execution.GetHeader:output_type -> execution.GetHeaderResponse + 9, // 66: execution.Execution.GetBody:output_type -> execution.GetBodyResponse + 21, // 67: execution.Execution.GetBodiesByRange:output_type -> execution.GetBodiesBatchResponse + 21, // 68: execution.Execution.GetBodiesByHashes:output_type -> execution.GetBodiesBatchResponse + 3, // 69: execution.Execution.IsCanonicalHash:output_type -> execution.IsCanonicalResponse + 10, // 70: execution.Execution.GetHeaderHashNumber:output_type -> execution.GetHeaderHashNumberResponse + 13, // 71: execution.Execution.GetForkChoice:output_type -> execution.ForkChoice + 24, // 72: execution.Execution.Ready:output_type -> execution.ReadyResponse + 58, // [58:73] is the sub-list for method output_type + 43, // [43:58] is the sub-list for method input_type + 43, // [43:43] is the sub-list for extension type_name + 43, // [43:43] is the sub-list for extension extendee + 0, // [0:43] is the sub-list for field type_name +} + +func init() { file_execution_execution_proto_init() } +func file_execution_execution_proto_init() { + if File_execution_execution_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_execution_execution_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ForkChoiceReceipt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidationReceipt); i { case 0: return &v.state case 1: @@ -1186,7 +2120,7 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHeaderResponse); i { + switch v := v.(*Block); i { case 0: return &v.state case 1: @@ -1198,7 +2132,7 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBodyResponse); i { + switch v := v.(*GetHeaderResponse); i { case 0: return &v.state case 1: @@ -1210,7 +2144,7 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHeaderHashNumberResponse); i { + switch v := v.(*GetTDResponse); i { case 0: return &v.state case 1: @@ -1222,7 +2156,7 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSegmentRequest); i { + switch v := v.(*GetBodyResponse); i { case 0: return &v.state case 1: @@ -1234,7 +2168,7 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InsertHeadersRequest); i { + switch v := v.(*GetHeaderHashNumberResponse); i { case 0: return &v.state case 1: @@ -1246,7 +2180,7 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InsertBodiesRequest); i { + switch v := v.(*GetSegmentRequest); i { case 0: return &v.state case 1: @@ -1258,7 +2192,151 @@ func file_execution_execution_proto_init() { } } file_execution_execution_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyMessage); i { + switch v := v.(*InsertBlocksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ForkChoice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InsertionResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AssembleBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AssembleBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssembledBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AssembledBlockData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAssembledBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBodiesBatchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBodiesByHashesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBodiesByRangeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_execution_execution_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadyResponse); i { case 0: return &v.state case 1: @@ -1270,19 +2348,22 @@ func file_execution_execution_proto_init() { } } } - file_execution_execution_proto_msgTypes[1].OneofWrappers = []interface{}{} file_execution_execution_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_execution_execution_proto_msgTypes[5].OneofWrappers = []interface{}{} file_execution_execution_proto_msgTypes[6].OneofWrappers = []interface{}{} file_execution_execution_proto_msgTypes[7].OneofWrappers = []interface{}{} file_execution_execution_proto_msgTypes[8].OneofWrappers = []interface{}{} + file_execution_execution_proto_msgTypes[9].OneofWrappers = []interface{}{} + file_execution_execution_proto_msgTypes[10].OneofWrappers = []interface{}{} + file_execution_execution_proto_msgTypes[12].OneofWrappers = []interface{}{} + file_execution_execution_proto_msgTypes[15].OneofWrappers = []interface{}{} + file_execution_execution_proto_msgTypes[19].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_execution_execution_proto_rawDesc, NumEnums: 1, - NumMessages: 12, + NumMessages: 24, NumExtensions: 0, NumServices: 1, }, diff --git a/gointerfaces/execution/execution_grpc.pb.go b/gointerfaces/execution/execution_grpc.pb.go index 06e53271f..9faac8573 100644 --- a/gointerfaces/execution/execution_grpc.pb.go +++ b/gointerfaces/execution/execution_grpc.pb.go @@ -12,6 +12,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file @@ -20,15 +21,21 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Execution_InsertHeaders_FullMethodName = "/execution.Execution/InsertHeaders" - Execution_InsertBodies_FullMethodName = "/execution.Execution/InsertBodies" + Execution_InsertBlocks_FullMethodName = "/execution.Execution/InsertBlocks" Execution_ValidateChain_FullMethodName = "/execution.Execution/ValidateChain" Execution_UpdateForkChoice_FullMethodName = "/execution.Execution/UpdateForkChoice" Execution_AssembleBlock_FullMethodName = "/execution.Execution/AssembleBlock" + Execution_GetAssembledBlock_FullMethodName = "/execution.Execution/GetAssembledBlock" + Execution_CurrentHeader_FullMethodName = "/execution.Execution/CurrentHeader" + Execution_GetTD_FullMethodName = "/execution.Execution/GetTD" Execution_GetHeader_FullMethodName = "/execution.Execution/GetHeader" Execution_GetBody_FullMethodName = "/execution.Execution/GetBody" + Execution_GetBodiesByRange_FullMethodName = "/execution.Execution/GetBodiesByRange" + Execution_GetBodiesByHashes_FullMethodName = "/execution.Execution/GetBodiesByHashes" Execution_IsCanonicalHash_FullMethodName = "/execution.Execution/IsCanonicalHash" Execution_GetHeaderHashNumber_FullMethodName = "/execution.Execution/GetHeaderHashNumber" + Execution_GetForkChoice_FullMethodName = "/execution.Execution/GetForkChoice" + Execution_Ready_FullMethodName = "/execution.Execution/Ready" ) // ExecutionClient is the client API for Execution service. @@ -36,17 +43,29 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ExecutionClient interface { // Chain Putters. - InsertHeaders(ctx context.Context, in *InsertHeadersRequest, opts ...grpc.CallOption) (*EmptyMessage, error) - InsertBodies(ctx context.Context, in *InsertBodiesRequest, opts ...grpc.CallOption) (*EmptyMessage, error) + InsertBlocks(ctx context.Context, in *InsertBlocksRequest, opts ...grpc.CallOption) (*InsertionResult, error) // Chain Validation and ForkChoice. - ValidateChain(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*ValidationReceipt, error) - UpdateForkChoice(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*ForkChoiceReceipt, error) - AssembleBlock(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*types.ExecutionPayload, error) + ValidateChain(ctx context.Context, in *ValidationRequest, opts ...grpc.CallOption) (*ValidationReceipt, error) + UpdateForkChoice(ctx context.Context, in *ForkChoice, opts ...grpc.CallOption) (*ForkChoiceReceipt, error) + // Block Assembly + // EAGAIN design here, AssembleBlock initiates the asynchronous request, and GetAssembleBlock just return it if ready. + AssembleBlock(ctx context.Context, in *AssembleBlockRequest, opts ...grpc.CallOption) (*AssembleBlockResponse, error) + GetAssembledBlock(ctx context.Context, in *GetAssembledBlockRequest, opts ...grpc.CallOption) (*GetAssembledBlockResponse, error) // Chain Getters. + CurrentHeader(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetHeaderResponse, error) + GetTD(ctx context.Context, in *GetSegmentRequest, opts ...grpc.CallOption) (*GetTDResponse, error) GetHeader(ctx context.Context, in *GetSegmentRequest, opts ...grpc.CallOption) (*GetHeaderResponse, error) GetBody(ctx context.Context, in *GetSegmentRequest, opts ...grpc.CallOption) (*GetBodyResponse, error) + // Ranges + GetBodiesByRange(ctx context.Context, in *GetBodiesByRangeRequest, opts ...grpc.CallOption) (*GetBodiesBatchResponse, error) + GetBodiesByHashes(ctx context.Context, in *GetBodiesByHashesRequest, opts ...grpc.CallOption) (*GetBodiesBatchResponse, error) + // Chain checkers IsCanonicalHash(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*IsCanonicalResponse, error) GetHeaderHashNumber(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*GetHeaderHashNumberResponse, error) + GetForkChoice(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ForkChoice, error) + // Misc + // We want to figure out whether we processed snapshots and cleanup sync cycles. + Ready(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ReadyResponse, error) } type executionClient struct { @@ -57,45 +76,63 @@ func NewExecutionClient(cc grpc.ClientConnInterface) ExecutionClient { return &executionClient{cc} } -func (c *executionClient) InsertHeaders(ctx context.Context, in *InsertHeadersRequest, opts ...grpc.CallOption) (*EmptyMessage, error) { - out := new(EmptyMessage) - err := c.cc.Invoke(ctx, Execution_InsertHeaders_FullMethodName, in, out, opts...) +func (c *executionClient) InsertBlocks(ctx context.Context, in *InsertBlocksRequest, opts ...grpc.CallOption) (*InsertionResult, error) { + out := new(InsertionResult) + err := c.cc.Invoke(ctx, Execution_InsertBlocks_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *executionClient) InsertBodies(ctx context.Context, in *InsertBodiesRequest, opts ...grpc.CallOption) (*EmptyMessage, error) { - out := new(EmptyMessage) - err := c.cc.Invoke(ctx, Execution_InsertBodies_FullMethodName, in, out, opts...) +func (c *executionClient) ValidateChain(ctx context.Context, in *ValidationRequest, opts ...grpc.CallOption) (*ValidationReceipt, error) { + out := new(ValidationReceipt) + err := c.cc.Invoke(ctx, Execution_ValidateChain_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *executionClient) ValidateChain(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*ValidationReceipt, error) { - out := new(ValidationReceipt) - err := c.cc.Invoke(ctx, Execution_ValidateChain_FullMethodName, in, out, opts...) +func (c *executionClient) UpdateForkChoice(ctx context.Context, in *ForkChoice, opts ...grpc.CallOption) (*ForkChoiceReceipt, error) { + out := new(ForkChoiceReceipt) + err := c.cc.Invoke(ctx, Execution_UpdateForkChoice_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *executionClient) UpdateForkChoice(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*ForkChoiceReceipt, error) { - out := new(ForkChoiceReceipt) - err := c.cc.Invoke(ctx, Execution_UpdateForkChoice_FullMethodName, in, out, opts...) +func (c *executionClient) AssembleBlock(ctx context.Context, in *AssembleBlockRequest, opts ...grpc.CallOption) (*AssembleBlockResponse, error) { + out := new(AssembleBlockResponse) + err := c.cc.Invoke(ctx, Execution_AssembleBlock_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *executionClient) AssembleBlock(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*types.ExecutionPayload, error) { - out := new(types.ExecutionPayload) - err := c.cc.Invoke(ctx, Execution_AssembleBlock_FullMethodName, in, out, opts...) +func (c *executionClient) GetAssembledBlock(ctx context.Context, in *GetAssembledBlockRequest, opts ...grpc.CallOption) (*GetAssembledBlockResponse, error) { + out := new(GetAssembledBlockResponse) + err := c.cc.Invoke(ctx, Execution_GetAssembledBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionClient) CurrentHeader(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetHeaderResponse, error) { + out := new(GetHeaderResponse) + err := c.cc.Invoke(ctx, Execution_CurrentHeader_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionClient) GetTD(ctx context.Context, in *GetSegmentRequest, opts ...grpc.CallOption) (*GetTDResponse, error) { + out := new(GetTDResponse) + err := c.cc.Invoke(ctx, Execution_GetTD_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -120,6 +157,24 @@ func (c *executionClient) GetBody(ctx context.Context, in *GetSegmentRequest, op return out, nil } +func (c *executionClient) GetBodiesByRange(ctx context.Context, in *GetBodiesByRangeRequest, opts ...grpc.CallOption) (*GetBodiesBatchResponse, error) { + out := new(GetBodiesBatchResponse) + err := c.cc.Invoke(ctx, Execution_GetBodiesByRange_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionClient) GetBodiesByHashes(ctx context.Context, in *GetBodiesByHashesRequest, opts ...grpc.CallOption) (*GetBodiesBatchResponse, error) { + out := new(GetBodiesBatchResponse) + err := c.cc.Invoke(ctx, Execution_GetBodiesByHashes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *executionClient) IsCanonicalHash(ctx context.Context, in *types.H256, opts ...grpc.CallOption) (*IsCanonicalResponse, error) { out := new(IsCanonicalResponse) err := c.cc.Invoke(ctx, Execution_IsCanonicalHash_FullMethodName, in, out, opts...) @@ -138,22 +193,52 @@ func (c *executionClient) GetHeaderHashNumber(ctx context.Context, in *types.H25 return out, nil } +func (c *executionClient) GetForkChoice(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ForkChoice, error) { + out := new(ForkChoice) + err := c.cc.Invoke(ctx, Execution_GetForkChoice_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionClient) Ready(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ReadyResponse, error) { + out := new(ReadyResponse) + err := c.cc.Invoke(ctx, Execution_Ready_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ExecutionServer is the server API for Execution service. // All implementations must embed UnimplementedExecutionServer // for forward compatibility type ExecutionServer interface { // Chain Putters. - InsertHeaders(context.Context, *InsertHeadersRequest) (*EmptyMessage, error) - InsertBodies(context.Context, *InsertBodiesRequest) (*EmptyMessage, error) + InsertBlocks(context.Context, *InsertBlocksRequest) (*InsertionResult, error) // Chain Validation and ForkChoice. - ValidateChain(context.Context, *types.H256) (*ValidationReceipt, error) - UpdateForkChoice(context.Context, *types.H256) (*ForkChoiceReceipt, error) - AssembleBlock(context.Context, *EmptyMessage) (*types.ExecutionPayload, error) + ValidateChain(context.Context, *ValidationRequest) (*ValidationReceipt, error) + UpdateForkChoice(context.Context, *ForkChoice) (*ForkChoiceReceipt, error) + // Block Assembly + // EAGAIN design here, AssembleBlock initiates the asynchronous request, and GetAssembleBlock just return it if ready. + AssembleBlock(context.Context, *AssembleBlockRequest) (*AssembleBlockResponse, error) + GetAssembledBlock(context.Context, *GetAssembledBlockRequest) (*GetAssembledBlockResponse, error) // Chain Getters. + CurrentHeader(context.Context, *emptypb.Empty) (*GetHeaderResponse, error) + GetTD(context.Context, *GetSegmentRequest) (*GetTDResponse, error) GetHeader(context.Context, *GetSegmentRequest) (*GetHeaderResponse, error) GetBody(context.Context, *GetSegmentRequest) (*GetBodyResponse, error) + // Ranges + GetBodiesByRange(context.Context, *GetBodiesByRangeRequest) (*GetBodiesBatchResponse, error) + GetBodiesByHashes(context.Context, *GetBodiesByHashesRequest) (*GetBodiesBatchResponse, error) + // Chain checkers IsCanonicalHash(context.Context, *types.H256) (*IsCanonicalResponse, error) GetHeaderHashNumber(context.Context, *types.H256) (*GetHeaderHashNumberResponse, error) + GetForkChoice(context.Context, *emptypb.Empty) (*ForkChoice, error) + // Misc + // We want to figure out whether we processed snapshots and cleanup sync cycles. + Ready(context.Context, *emptypb.Empty) (*ReadyResponse, error) mustEmbedUnimplementedExecutionServer() } @@ -161,33 +246,51 @@ type ExecutionServer interface { type UnimplementedExecutionServer struct { } -func (UnimplementedExecutionServer) InsertHeaders(context.Context, *InsertHeadersRequest) (*EmptyMessage, error) { - return nil, status.Errorf(codes.Unimplemented, "method InsertHeaders not implemented") -} -func (UnimplementedExecutionServer) InsertBodies(context.Context, *InsertBodiesRequest) (*EmptyMessage, error) { - return nil, status.Errorf(codes.Unimplemented, "method InsertBodies not implemented") +func (UnimplementedExecutionServer) InsertBlocks(context.Context, *InsertBlocksRequest) (*InsertionResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method InsertBlocks not implemented") } -func (UnimplementedExecutionServer) ValidateChain(context.Context, *types.H256) (*ValidationReceipt, error) { +func (UnimplementedExecutionServer) ValidateChain(context.Context, *ValidationRequest) (*ValidationReceipt, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateChain not implemented") } -func (UnimplementedExecutionServer) UpdateForkChoice(context.Context, *types.H256) (*ForkChoiceReceipt, error) { +func (UnimplementedExecutionServer) UpdateForkChoice(context.Context, *ForkChoice) (*ForkChoiceReceipt, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateForkChoice not implemented") } -func (UnimplementedExecutionServer) AssembleBlock(context.Context, *EmptyMessage) (*types.ExecutionPayload, error) { +func (UnimplementedExecutionServer) AssembleBlock(context.Context, *AssembleBlockRequest) (*AssembleBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AssembleBlock not implemented") } +func (UnimplementedExecutionServer) GetAssembledBlock(context.Context, *GetAssembledBlockRequest) (*GetAssembledBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAssembledBlock not implemented") +} +func (UnimplementedExecutionServer) CurrentHeader(context.Context, *emptypb.Empty) (*GetHeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CurrentHeader not implemented") +} +func (UnimplementedExecutionServer) GetTD(context.Context, *GetSegmentRequest) (*GetTDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTD not implemented") +} func (UnimplementedExecutionServer) GetHeader(context.Context, *GetSegmentRequest) (*GetHeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHeader not implemented") } func (UnimplementedExecutionServer) GetBody(context.Context, *GetSegmentRequest) (*GetBodyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBody not implemented") } +func (UnimplementedExecutionServer) GetBodiesByRange(context.Context, *GetBodiesByRangeRequest) (*GetBodiesBatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBodiesByRange not implemented") +} +func (UnimplementedExecutionServer) GetBodiesByHashes(context.Context, *GetBodiesByHashesRequest) (*GetBodiesBatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBodiesByHashes not implemented") +} func (UnimplementedExecutionServer) IsCanonicalHash(context.Context, *types.H256) (*IsCanonicalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method IsCanonicalHash not implemented") } func (UnimplementedExecutionServer) GetHeaderHashNumber(context.Context, *types.H256) (*GetHeaderHashNumberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHeaderHashNumber not implemented") } +func (UnimplementedExecutionServer) GetForkChoice(context.Context, *emptypb.Empty) (*ForkChoice, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetForkChoice not implemented") +} +func (UnimplementedExecutionServer) Ready(context.Context, *emptypb.Empty) (*ReadyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ready not implemented") +} func (UnimplementedExecutionServer) mustEmbedUnimplementedExecutionServer() {} // UnsafeExecutionServer may be embedded to opt out of forward compatibility for this service. @@ -201,92 +304,128 @@ func RegisterExecutionServer(s grpc.ServiceRegistrar, srv ExecutionServer) { s.RegisterService(&Execution_ServiceDesc, srv) } -func _Execution_InsertHeaders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InsertHeadersRequest) +func _Execution_InsertBlocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InsertBlocksRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ExecutionServer).InsertHeaders(ctx, in) + return srv.(ExecutionServer).InsertBlocks(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Execution_InsertHeaders_FullMethodName, + FullMethod: Execution_InsertBlocks_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutionServer).InsertHeaders(ctx, req.(*InsertHeadersRequest)) + return srv.(ExecutionServer).InsertBlocks(ctx, req.(*InsertBlocksRequest)) } return interceptor(ctx, in, info, handler) } -func _Execution_InsertBodies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InsertBodiesRequest) +func _Execution_ValidateChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ExecutionServer).InsertBodies(ctx, in) + return srv.(ExecutionServer).ValidateChain(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Execution_InsertBodies_FullMethodName, + FullMethod: Execution_ValidateChain_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutionServer).InsertBodies(ctx, req.(*InsertBodiesRequest)) + return srv.(ExecutionServer).ValidateChain(ctx, req.(*ValidationRequest)) } return interceptor(ctx, in, info, handler) } -func _Execution_ValidateChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.H256) +func _Execution_UpdateForkChoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ForkChoice) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ExecutionServer).ValidateChain(ctx, in) + return srv.(ExecutionServer).UpdateForkChoice(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Execution_ValidateChain_FullMethodName, + FullMethod: Execution_UpdateForkChoice_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutionServer).ValidateChain(ctx, req.(*types.H256)) + return srv.(ExecutionServer).UpdateForkChoice(ctx, req.(*ForkChoice)) } return interceptor(ctx, in, info, handler) } -func _Execution_UpdateForkChoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.H256) +func _Execution_AssembleBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AssembleBlockRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ExecutionServer).UpdateForkChoice(ctx, in) + return srv.(ExecutionServer).AssembleBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Execution_UpdateForkChoice_FullMethodName, + FullMethod: Execution_AssembleBlock_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutionServer).UpdateForkChoice(ctx, req.(*types.H256)) + return srv.(ExecutionServer).AssembleBlock(ctx, req.(*AssembleBlockRequest)) } return interceptor(ctx, in, info, handler) } -func _Execution_AssembleBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyMessage) +func _Execution_GetAssembledBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAssembledBlockRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ExecutionServer).AssembleBlock(ctx, in) + return srv.(ExecutionServer).GetAssembledBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Execution_AssembleBlock_FullMethodName, + FullMethod: Execution_GetAssembledBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).GetAssembledBlock(ctx, req.(*GetAssembledBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Execution_CurrentHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).CurrentHeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_CurrentHeader_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).CurrentHeader(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Execution_GetTD_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSegmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).GetTD(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_GetTD_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExecutionServer).AssembleBlock(ctx, req.(*EmptyMessage)) + return srv.(ExecutionServer).GetTD(ctx, req.(*GetSegmentRequest)) } return interceptor(ctx, in, info, handler) } @@ -327,6 +466,42 @@ func _Execution_GetBody_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Execution_GetBodiesByRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBodiesByRangeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).GetBodiesByRange(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_GetBodiesByRange_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).GetBodiesByRange(ctx, req.(*GetBodiesByRangeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Execution_GetBodiesByHashes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBodiesByHashesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).GetBodiesByHashes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_GetBodiesByHashes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).GetBodiesByHashes(ctx, req.(*GetBodiesByHashesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Execution_IsCanonicalHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(types.H256) if err := dec(in); err != nil { @@ -363,6 +538,42 @@ func _Execution_GetHeaderHashNumber_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Execution_GetForkChoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).GetForkChoice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_GetForkChoice_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).GetForkChoice(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Execution_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServer).Ready(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Execution_Ready_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServer).Ready(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + // Execution_ServiceDesc is the grpc.ServiceDesc for Execution service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -371,12 +582,8 @@ var Execution_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*ExecutionServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "InsertHeaders", - Handler: _Execution_InsertHeaders_Handler, - }, - { - MethodName: "InsertBodies", - Handler: _Execution_InsertBodies_Handler, + MethodName: "InsertBlocks", + Handler: _Execution_InsertBlocks_Handler, }, { MethodName: "ValidateChain", @@ -390,6 +597,18 @@ var Execution_ServiceDesc = grpc.ServiceDesc{ MethodName: "AssembleBlock", Handler: _Execution_AssembleBlock_Handler, }, + { + MethodName: "GetAssembledBlock", + Handler: _Execution_GetAssembledBlock_Handler, + }, + { + MethodName: "CurrentHeader", + Handler: _Execution_CurrentHeader_Handler, + }, + { + MethodName: "GetTD", + Handler: _Execution_GetTD_Handler, + }, { MethodName: "GetHeader", Handler: _Execution_GetHeader_Handler, @@ -398,6 +617,14 @@ var Execution_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetBody", Handler: _Execution_GetBody_Handler, }, + { + MethodName: "GetBodiesByRange", + Handler: _Execution_GetBodiesByRange_Handler, + }, + { + MethodName: "GetBodiesByHashes", + Handler: _Execution_GetBodiesByHashes_Handler, + }, { MethodName: "IsCanonicalHash", Handler: _Execution_IsCanonicalHash_Handler, @@ -406,6 +633,14 @@ var Execution_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetHeaderHashNumber", Handler: _Execution_GetHeaderHashNumber_Handler, }, + { + MethodName: "GetForkChoice", + Handler: _Execution_GetForkChoice_Handler, + }, + { + MethodName: "Ready", + Handler: _Execution_Ready_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "execution/execution.proto", diff --git a/gointerfaces/remote/ethbackend.pb.go b/gointerfaces/remote/ethbackend.pb.go index 888310e18..43d907e4a 100644 --- a/gointerfaces/remote/ethbackend.pb.go +++ b/gointerfaces/remote/ethbackend.pb.go @@ -77,59 +77,51 @@ func (Event) EnumDescriptor() ([]byte, []int) { return file_remote_ethbackend_proto_rawDescGZIP(), []int{0} } -type EngineStatus int32 +type PendingBlockReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -const ( - EngineStatus_VALID EngineStatus = 0 - EngineStatus_INVALID EngineStatus = 1 - EngineStatus_SYNCING EngineStatus = 2 - EngineStatus_ACCEPTED EngineStatus = 3 - EngineStatus_INVALID_BLOCK_HASH EngineStatus = 4 -) + BlockRlp []byte `protobuf:"bytes,1,opt,name=block_rlp,json=blockRlp,proto3" json:"block_rlp,omitempty"` +} -// Enum value maps for EngineStatus. -var ( - EngineStatus_name = map[int32]string{ - 0: "VALID", - 1: "INVALID", - 2: "SYNCING", - 3: "ACCEPTED", - 4: "INVALID_BLOCK_HASH", - } - EngineStatus_value = map[string]int32{ - "VALID": 0, - "INVALID": 1, - "SYNCING": 2, - "ACCEPTED": 3, - "INVALID_BLOCK_HASH": 4, +func (x *PendingBlockReply) Reset() { + *x = PendingBlockReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -) - -func (x EngineStatus) Enum() *EngineStatus { - p := new(EngineStatus) - *p = x - return p } -func (x EngineStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +func (x *PendingBlockReply) String() string { + return protoimpl.X.MessageStringOf(x) } -func (EngineStatus) Descriptor() protoreflect.EnumDescriptor { - return file_remote_ethbackend_proto_enumTypes[1].Descriptor() -} +func (*PendingBlockReply) ProtoMessage() {} -func (EngineStatus) Type() protoreflect.EnumType { - return &file_remote_ethbackend_proto_enumTypes[1] +func (x *PendingBlockReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (x EngineStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) +// Deprecated: Use PendingBlockReply.ProtoReflect.Descriptor instead. +func (*PendingBlockReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{0} } -// Deprecated: Use EngineStatus.Descriptor instead. -func (EngineStatus) EnumDescriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{1} +func (x *PendingBlockReply) GetBlockRlp() []byte { + if x != nil { + return x.BlockRlp + } + return nil } type EtherbaseRequest struct { @@ -141,7 +133,7 @@ type EtherbaseRequest struct { func (x *EtherbaseRequest) Reset() { *x = EtherbaseRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[0] + mi := &file_remote_ethbackend_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -154,7 +146,7 @@ func (x *EtherbaseRequest) String() string { func (*EtherbaseRequest) ProtoMessage() {} func (x *EtherbaseRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[0] + mi := &file_remote_ethbackend_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -167,7 +159,7 @@ func (x *EtherbaseRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EtherbaseRequest.ProtoReflect.Descriptor instead. func (*EtherbaseRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{0} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{1} } type EtherbaseReply struct { @@ -181,7 +173,7 @@ type EtherbaseReply struct { func (x *EtherbaseReply) Reset() { *x = EtherbaseReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[1] + mi := &file_remote_ethbackend_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -194,7 +186,7 @@ func (x *EtherbaseReply) String() string { func (*EtherbaseReply) ProtoMessage() {} func (x *EtherbaseReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[1] + mi := &file_remote_ethbackend_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -207,7 +199,7 @@ func (x *EtherbaseReply) ProtoReflect() protoreflect.Message { // Deprecated: Use EtherbaseReply.ProtoReflect.Descriptor instead. func (*EtherbaseReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{1} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{2} } func (x *EtherbaseReply) GetAddress() *types.H160 { @@ -226,7 +218,7 @@ type NetVersionRequest struct { func (x *NetVersionRequest) Reset() { *x = NetVersionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[2] + mi := &file_remote_ethbackend_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -239,7 +231,7 @@ func (x *NetVersionRequest) String() string { func (*NetVersionRequest) ProtoMessage() {} func (x *NetVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[2] + mi := &file_remote_ethbackend_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -252,7 +244,7 @@ func (x *NetVersionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NetVersionRequest.ProtoReflect.Descriptor instead. func (*NetVersionRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{2} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{3} } type NetVersionReply struct { @@ -266,7 +258,7 @@ type NetVersionReply struct { func (x *NetVersionReply) Reset() { *x = NetVersionReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[3] + mi := &file_remote_ethbackend_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +271,7 @@ func (x *NetVersionReply) String() string { func (*NetVersionReply) ProtoMessage() {} func (x *NetVersionReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[3] + mi := &file_remote_ethbackend_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +284,7 @@ func (x *NetVersionReply) ProtoReflect() protoreflect.Message { // Deprecated: Use NetVersionReply.ProtoReflect.Descriptor instead. func (*NetVersionReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{3} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{4} } func (x *NetVersionReply) GetId() uint64 { @@ -311,7 +303,7 @@ type NetPeerCountRequest struct { func (x *NetPeerCountRequest) Reset() { *x = NetPeerCountRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[4] + mi := &file_remote_ethbackend_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -324,7 +316,7 @@ func (x *NetPeerCountRequest) String() string { func (*NetPeerCountRequest) ProtoMessage() {} func (x *NetPeerCountRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[4] + mi := &file_remote_ethbackend_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -337,7 +329,7 @@ func (x *NetPeerCountRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NetPeerCountRequest.ProtoReflect.Descriptor instead. func (*NetPeerCountRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{4} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{5} } type NetPeerCountReply struct { @@ -351,7 +343,7 @@ type NetPeerCountReply struct { func (x *NetPeerCountReply) Reset() { *x = NetPeerCountReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[5] + mi := &file_remote_ethbackend_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -364,7 +356,7 @@ func (x *NetPeerCountReply) String() string { func (*NetPeerCountReply) ProtoMessage() {} func (x *NetPeerCountReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[5] + mi := &file_remote_ethbackend_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -377,7 +369,7 @@ func (x *NetPeerCountReply) ProtoReflect() protoreflect.Message { // Deprecated: Use NetPeerCountReply.ProtoReflect.Descriptor instead. func (*NetPeerCountReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{5} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{6} } func (x *NetPeerCountReply) GetCount() uint64 { @@ -387,455 +379,6 @@ func (x *NetPeerCountReply) GetCount() uint64 { return 0 } -type EngineGetPayloadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PayloadId uint64 `protobuf:"varint,1,opt,name=payload_id,json=payloadId,proto3" json:"payload_id,omitempty"` -} - -func (x *EngineGetPayloadRequest) Reset() { - *x = EngineGetPayloadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EngineGetPayloadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EngineGetPayloadRequest) ProtoMessage() {} - -func (x *EngineGetPayloadRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EngineGetPayloadRequest.ProtoReflect.Descriptor instead. -func (*EngineGetPayloadRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{6} -} - -func (x *EngineGetPayloadRequest) GetPayloadId() uint64 { - if x != nil { - return x.PayloadId - } - return 0 -} - -type EnginePayloadStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status EngineStatus `protobuf:"varint,1,opt,name=status,proto3,enum=remote.EngineStatus" json:"status,omitempty"` - LatestValidHash *types.H256 `protobuf:"bytes,2,opt,name=latest_valid_hash,json=latestValidHash,proto3" json:"latest_valid_hash,omitempty"` - ValidationError string `protobuf:"bytes,3,opt,name=validation_error,json=validationError,proto3" json:"validation_error,omitempty"` -} - -func (x *EnginePayloadStatus) Reset() { - *x = EnginePayloadStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnginePayloadStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnginePayloadStatus) ProtoMessage() {} - -func (x *EnginePayloadStatus) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EnginePayloadStatus.ProtoReflect.Descriptor instead. -func (*EnginePayloadStatus) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{7} -} - -func (x *EnginePayloadStatus) GetStatus() EngineStatus { - if x != nil { - return x.Status - } - return EngineStatus_VALID -} - -func (x *EnginePayloadStatus) GetLatestValidHash() *types.H256 { - if x != nil { - return x.LatestValidHash - } - return nil -} - -func (x *EnginePayloadStatus) GetValidationError() string { - if x != nil { - return x.ValidationError - } - return "" -} - -type EnginePayloadAttributes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // v1 - no withdrawals, v2 - with withdrawals - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PrevRandao *types.H256 `protobuf:"bytes,3,opt,name=prev_randao,json=prevRandao,proto3" json:"prev_randao,omitempty"` - SuggestedFeeRecipient *types.H160 `protobuf:"bytes,4,opt,name=suggested_fee_recipient,json=suggestedFeeRecipient,proto3" json:"suggested_fee_recipient,omitempty"` - Withdrawals []*types.Withdrawal `protobuf:"bytes,5,rep,name=withdrawals,proto3" json:"withdrawals,omitempty"` - NoTxPool *bool `protobuf:"varint,6,opt,name=noTxPool,proto3,oneof" json:"noTxPool,omitempty"` - Transactions [][]byte `protobuf:"bytes,7,rep,name=transactions,proto3" json:"transactions,omitempty"` - GasLimit *uint64 `protobuf:"varint,8,opt,name=gasLimit,proto3,oneof" json:"gasLimit,omitempty"` -} - -func (x *EnginePayloadAttributes) Reset() { - *x = EnginePayloadAttributes{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnginePayloadAttributes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnginePayloadAttributes) ProtoMessage() {} - -func (x *EnginePayloadAttributes) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EnginePayloadAttributes.ProtoReflect.Descriptor instead. -func (*EnginePayloadAttributes) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{8} -} - -func (x *EnginePayloadAttributes) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *EnginePayloadAttributes) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *EnginePayloadAttributes) GetPrevRandao() *types.H256 { - if x != nil { - return x.PrevRandao - } - return nil -} - -func (x *EnginePayloadAttributes) GetSuggestedFeeRecipient() *types.H160 { - if x != nil { - return x.SuggestedFeeRecipient - } - return nil -} - -func (x *EnginePayloadAttributes) GetWithdrawals() []*types.Withdrawal { - if x != nil { - return x.Withdrawals - } - return nil -} - -func (x *EnginePayloadAttributes) GetNoTxPool() bool { - if x != nil && x.NoTxPool != nil { - return *x.NoTxPool - } - return false -} - -func (x *EnginePayloadAttributes) GetTransactions() [][]byte { - if x != nil { - return x.Transactions - } - return nil -} - -func (x *EnginePayloadAttributes) GetGasLimit() uint64 { - if x != nil && x.GasLimit != nil { - return *x.GasLimit - } - return 0 -} - -type EngineForkChoiceState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HeadBlockHash *types.H256 `protobuf:"bytes,1,opt,name=head_block_hash,json=headBlockHash,proto3" json:"head_block_hash,omitempty"` - SafeBlockHash *types.H256 `protobuf:"bytes,2,opt,name=safe_block_hash,json=safeBlockHash,proto3" json:"safe_block_hash,omitempty"` - FinalizedBlockHash *types.H256 `protobuf:"bytes,3,opt,name=finalized_block_hash,json=finalizedBlockHash,proto3" json:"finalized_block_hash,omitempty"` -} - -func (x *EngineForkChoiceState) Reset() { - *x = EngineForkChoiceState{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EngineForkChoiceState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EngineForkChoiceState) ProtoMessage() {} - -func (x *EngineForkChoiceState) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EngineForkChoiceState.ProtoReflect.Descriptor instead. -func (*EngineForkChoiceState) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{9} -} - -func (x *EngineForkChoiceState) GetHeadBlockHash() *types.H256 { - if x != nil { - return x.HeadBlockHash - } - return nil -} - -func (x *EngineForkChoiceState) GetSafeBlockHash() *types.H256 { - if x != nil { - return x.SafeBlockHash - } - return nil -} - -func (x *EngineForkChoiceState) GetFinalizedBlockHash() *types.H256 { - if x != nil { - return x.FinalizedBlockHash - } - return nil -} - -type EngineForkChoiceUpdatedRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ForkchoiceState *EngineForkChoiceState `protobuf:"bytes,1,opt,name=forkchoice_state,json=forkchoiceState,proto3" json:"forkchoice_state,omitempty"` - PayloadAttributes *EnginePayloadAttributes `protobuf:"bytes,2,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"` -} - -func (x *EngineForkChoiceUpdatedRequest) Reset() { - *x = EngineForkChoiceUpdatedRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EngineForkChoiceUpdatedRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EngineForkChoiceUpdatedRequest) ProtoMessage() {} - -func (x *EngineForkChoiceUpdatedRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EngineForkChoiceUpdatedRequest.ProtoReflect.Descriptor instead. -func (*EngineForkChoiceUpdatedRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{10} -} - -func (x *EngineForkChoiceUpdatedRequest) GetForkchoiceState() *EngineForkChoiceState { - if x != nil { - return x.ForkchoiceState - } - return nil -} - -func (x *EngineForkChoiceUpdatedRequest) GetPayloadAttributes() *EnginePayloadAttributes { - if x != nil { - return x.PayloadAttributes - } - return nil -} - -type EngineForkChoiceUpdatedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PayloadStatus *EnginePayloadStatus `protobuf:"bytes,1,opt,name=payload_status,json=payloadStatus,proto3" json:"payload_status,omitempty"` - PayloadId uint64 `protobuf:"varint,2,opt,name=payload_id,json=payloadId,proto3" json:"payload_id,omitempty"` -} - -func (x *EngineForkChoiceUpdatedResponse) Reset() { - *x = EngineForkChoiceUpdatedResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EngineForkChoiceUpdatedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EngineForkChoiceUpdatedResponse) ProtoMessage() {} - -func (x *EngineForkChoiceUpdatedResponse) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EngineForkChoiceUpdatedResponse.ProtoReflect.Descriptor instead. -func (*EngineForkChoiceUpdatedResponse) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{11} -} - -func (x *EngineForkChoiceUpdatedResponse) GetPayloadStatus() *EnginePayloadStatus { - if x != nil { - return x.PayloadStatus - } - return nil -} - -func (x *EngineForkChoiceUpdatedResponse) GetPayloadId() uint64 { - if x != nil { - return x.PayloadId - } - return 0 -} - -type EngineGetPayloadResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ExecutionPayload *types.ExecutionPayload `protobuf:"bytes,1,opt,name=execution_payload,json=executionPayload,proto3" json:"execution_payload,omitempty"` - BlockValue *types.H256 `protobuf:"bytes,2,opt,name=block_value,json=blockValue,proto3" json:"block_value,omitempty"` - BlobsBundle *types.BlobsBundleV1 `protobuf:"bytes,3,opt,name=blobs_bundle,json=blobsBundle,proto3" json:"blobs_bundle,omitempty"` -} - -func (x *EngineGetPayloadResponse) Reset() { - *x = EngineGetPayloadResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EngineGetPayloadResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EngineGetPayloadResponse) ProtoMessage() {} - -func (x *EngineGetPayloadResponse) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EngineGetPayloadResponse.ProtoReflect.Descriptor instead. -func (*EngineGetPayloadResponse) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{12} -} - -func (x *EngineGetPayloadResponse) GetExecutionPayload() *types.ExecutionPayload { - if x != nil { - return x.ExecutionPayload - } - return nil -} - -func (x *EngineGetPayloadResponse) GetBlockValue() *types.H256 { - if x != nil { - return x.BlockValue - } - return nil -} - -func (x *EngineGetPayloadResponse) GetBlobsBundle() *types.BlobsBundleV1 { - if x != nil { - return x.BlobsBundle - } - return nil -} - type ProtocolVersionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -845,7 +388,7 @@ type ProtocolVersionRequest struct { func (x *ProtocolVersionRequest) Reset() { *x = ProtocolVersionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[13] + mi := &file_remote_ethbackend_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -858,7 +401,7 @@ func (x *ProtocolVersionRequest) String() string { func (*ProtocolVersionRequest) ProtoMessage() {} func (x *ProtocolVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[13] + mi := &file_remote_ethbackend_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -871,7 +414,7 @@ func (x *ProtocolVersionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtocolVersionRequest.ProtoReflect.Descriptor instead. func (*ProtocolVersionRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{13} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{7} } type ProtocolVersionReply struct { @@ -885,7 +428,7 @@ type ProtocolVersionReply struct { func (x *ProtocolVersionReply) Reset() { *x = ProtocolVersionReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[14] + mi := &file_remote_ethbackend_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -898,7 +441,7 @@ func (x *ProtocolVersionReply) String() string { func (*ProtocolVersionReply) ProtoMessage() {} func (x *ProtocolVersionReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[14] + mi := &file_remote_ethbackend_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -911,7 +454,7 @@ func (x *ProtocolVersionReply) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtocolVersionReply.ProtoReflect.Descriptor instead. func (*ProtocolVersionReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{14} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{8} } func (x *ProtocolVersionReply) GetId() uint64 { @@ -930,7 +473,7 @@ type ClientVersionRequest struct { func (x *ClientVersionRequest) Reset() { *x = ClientVersionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[15] + mi := &file_remote_ethbackend_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -943,7 +486,7 @@ func (x *ClientVersionRequest) String() string { func (*ClientVersionRequest) ProtoMessage() {} func (x *ClientVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[15] + mi := &file_remote_ethbackend_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -956,7 +499,7 @@ func (x *ClientVersionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientVersionRequest.ProtoReflect.Descriptor instead. func (*ClientVersionRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{15} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{9} } type ClientVersionReply struct { @@ -970,7 +513,7 @@ type ClientVersionReply struct { func (x *ClientVersionReply) Reset() { *x = ClientVersionReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[16] + mi := &file_remote_ethbackend_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -983,7 +526,7 @@ func (x *ClientVersionReply) String() string { func (*ClientVersionReply) ProtoMessage() {} func (x *ClientVersionReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[16] + mi := &file_remote_ethbackend_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -996,7 +539,7 @@ func (x *ClientVersionReply) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientVersionReply.ProtoReflect.Descriptor instead. func (*ClientVersionReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{16} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{10} } func (x *ClientVersionReply) GetNodeName() string { @@ -1017,7 +560,7 @@ type SubscribeRequest struct { func (x *SubscribeRequest) Reset() { *x = SubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[17] + mi := &file_remote_ethbackend_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1030,7 +573,7 @@ func (x *SubscribeRequest) String() string { func (*SubscribeRequest) ProtoMessage() {} func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[17] + mi := &file_remote_ethbackend_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1043,7 +586,7 @@ func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{17} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{11} } func (x *SubscribeRequest) GetType() Event { @@ -1065,7 +608,7 @@ type SubscribeReply struct { func (x *SubscribeReply) Reset() { *x = SubscribeReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[18] + mi := &file_remote_ethbackend_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1078,7 +621,7 @@ func (x *SubscribeReply) String() string { func (*SubscribeReply) ProtoMessage() {} func (x *SubscribeReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[18] + mi := &file_remote_ethbackend_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1091,7 +634,7 @@ func (x *SubscribeReply) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeReply.ProtoReflect.Descriptor instead. func (*SubscribeReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{18} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{12} } func (x *SubscribeReply) GetType() Event { @@ -1122,7 +665,7 @@ type LogsFilterRequest struct { func (x *LogsFilterRequest) Reset() { *x = LogsFilterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[19] + mi := &file_remote_ethbackend_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1135,7 +678,7 @@ func (x *LogsFilterRequest) String() string { func (*LogsFilterRequest) ProtoMessage() {} func (x *LogsFilterRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[19] + mi := &file_remote_ethbackend_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1148,7 +691,7 @@ func (x *LogsFilterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogsFilterRequest.ProtoReflect.Descriptor instead. func (*LogsFilterRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{19} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{13} } func (x *LogsFilterRequest) GetAllAddresses() bool { @@ -1198,7 +741,7 @@ type SubscribeLogsReply struct { func (x *SubscribeLogsReply) Reset() { *x = SubscribeLogsReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[20] + mi := &file_remote_ethbackend_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1211,7 +754,7 @@ func (x *SubscribeLogsReply) String() string { func (*SubscribeLogsReply) ProtoMessage() {} func (x *SubscribeLogsReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[20] + mi := &file_remote_ethbackend_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1224,7 +767,7 @@ func (x *SubscribeLogsReply) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeLogsReply.ProtoReflect.Descriptor instead. func (*SubscribeLogsReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{20} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{14} } func (x *SubscribeLogsReply) GetAddress() *types.H160 { @@ -1302,7 +845,7 @@ type BlockRequest struct { func (x *BlockRequest) Reset() { *x = BlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[21] + mi := &file_remote_ethbackend_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1315,7 +858,7 @@ func (x *BlockRequest) String() string { func (*BlockRequest) ProtoMessage() {} func (x *BlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[21] + mi := &file_remote_ethbackend_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1328,7 +871,7 @@ func (x *BlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead. func (*BlockRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{21} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{15} } func (x *BlockRequest) GetBlockHeight() uint64 { @@ -1357,7 +900,7 @@ type BlockReply struct { func (x *BlockReply) Reset() { *x = BlockReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[22] + mi := &file_remote_ethbackend_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1370,7 +913,7 @@ func (x *BlockReply) String() string { func (*BlockReply) ProtoMessage() {} func (x *BlockReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[22] + mi := &file_remote_ethbackend_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1383,7 +926,7 @@ func (x *BlockReply) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockReply.ProtoReflect.Descriptor instead. func (*BlockReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{22} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{16} } func (x *BlockReply) GetBlockRlp() []byte { @@ -1411,7 +954,7 @@ type TxnLookupRequest struct { func (x *TxnLookupRequest) Reset() { *x = TxnLookupRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[23] + mi := &file_remote_ethbackend_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1424,7 +967,7 @@ func (x *TxnLookupRequest) String() string { func (*TxnLookupRequest) ProtoMessage() {} func (x *TxnLookupRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[23] + mi := &file_remote_ethbackend_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1437,7 +980,7 @@ func (x *TxnLookupRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TxnLookupRequest.ProtoReflect.Descriptor instead. func (*TxnLookupRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{23} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{17} } func (x *TxnLookupRequest) GetTxnHash() *types.H256 { @@ -1458,7 +1001,7 @@ type TxnLookupReply struct { func (x *TxnLookupReply) Reset() { *x = TxnLookupReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[24] + mi := &file_remote_ethbackend_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1471,7 +1014,7 @@ func (x *TxnLookupReply) String() string { func (*TxnLookupReply) ProtoMessage() {} func (x *TxnLookupReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[24] + mi := &file_remote_ethbackend_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1484,7 +1027,7 @@ func (x *TxnLookupReply) ProtoReflect() protoreflect.Message { // Deprecated: Use TxnLookupReply.ProtoReflect.Descriptor instead. func (*TxnLookupReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{24} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{18} } func (x *TxnLookupReply) GetBlockNumber() uint64 { @@ -1505,7 +1048,7 @@ type NodesInfoRequest struct { func (x *NodesInfoRequest) Reset() { *x = NodesInfoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[25] + mi := &file_remote_ethbackend_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1518,7 +1061,7 @@ func (x *NodesInfoRequest) String() string { func (*NodesInfoRequest) ProtoMessage() {} func (x *NodesInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[25] + mi := &file_remote_ethbackend_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1531,7 +1074,7 @@ func (x *NodesInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NodesInfoRequest.ProtoReflect.Descriptor instead. func (*NodesInfoRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{25} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{19} } func (x *NodesInfoRequest) GetLimit() uint32 { @@ -1552,7 +1095,7 @@ type AddPeerRequest struct { func (x *AddPeerRequest) Reset() { *x = AddPeerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[26] + mi := &file_remote_ethbackend_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1565,7 +1108,7 @@ func (x *AddPeerRequest) String() string { func (*AddPeerRequest) ProtoMessage() {} func (x *AddPeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[26] + mi := &file_remote_ethbackend_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1578,7 +1121,7 @@ func (x *AddPeerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddPeerRequest.ProtoReflect.Descriptor instead. func (*AddPeerRequest) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{26} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{20} } func (x *AddPeerRequest) GetUrl() string { @@ -1599,7 +1142,7 @@ type NodesInfoReply struct { func (x *NodesInfoReply) Reset() { *x = NodesInfoReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[27] + mi := &file_remote_ethbackend_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1612,7 +1155,7 @@ func (x *NodesInfoReply) String() string { func (*NodesInfoReply) ProtoMessage() {} func (x *NodesInfoReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[27] + mi := &file_remote_ethbackend_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1625,7 +1168,7 @@ func (x *NodesInfoReply) ProtoReflect() protoreflect.Message { // Deprecated: Use NodesInfoReply.ProtoReflect.Descriptor instead. func (*NodesInfoReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{27} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{21} } func (x *NodesInfoReply) GetNodesInfo() []*types.NodeInfoReply { @@ -1646,7 +1189,7 @@ type PeersReply struct { func (x *PeersReply) Reset() { *x = PeersReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[28] + mi := &file_remote_ethbackend_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1659,7 +1202,7 @@ func (x *PeersReply) String() string { func (*PeersReply) ProtoMessage() {} func (x *PeersReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[28] + mi := &file_remote_ethbackend_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1672,7 +1215,7 @@ func (x *PeersReply) ProtoReflect() protoreflect.Message { // Deprecated: Use PeersReply.ProtoReflect.Descriptor instead. func (*PeersReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{28} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{22} } func (x *PeersReply) GetPeers() []*types.PeerInfo { @@ -1693,7 +1236,7 @@ type AddPeerReply struct { func (x *AddPeerReply) Reset() { *x = AddPeerReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[29] + mi := &file_remote_ethbackend_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1706,7 +1249,7 @@ func (x *AddPeerReply) String() string { func (*AddPeerReply) ProtoMessage() {} func (x *AddPeerReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[29] + mi := &file_remote_ethbackend_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1719,7 +1262,7 @@ func (x *AddPeerReply) ProtoReflect() protoreflect.Message { // Deprecated: Use AddPeerReply.ProtoReflect.Descriptor instead. func (*AddPeerReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{29} + return file_remote_ethbackend_proto_rawDescGZIP(), []int{23} } func (x *AddPeerReply) GetSuccess() bool { @@ -1729,78 +1272,31 @@ func (x *AddPeerReply) GetSuccess() bool { return false } -type PendingBlockReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BlockRlp []byte `protobuf:"bytes,1,opt,name=block_rlp,json=blockRlp,proto3" json:"block_rlp,omitempty"` -} - -func (x *PendingBlockReply) Reset() { - *x = PendingBlockReply{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PendingBlockReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PendingBlockReply) ProtoMessage() {} - -func (x *PendingBlockReply) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PendingBlockReply.ProtoReflect.Descriptor instead. -func (*PendingBlockReply) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{30} -} - -func (x *PendingBlockReply) GetBlockRlp() []byte { - if x != nil { - return x.BlockRlp - } - return nil -} - -type EngineGetPayloadBodiesByHashV1Request struct { +type BorEventRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Hashes []*types.H256 `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` + BorTxHash *types.H256 `protobuf:"bytes,1,opt,name=bor_tx_hash,json=borTxHash,proto3" json:"bor_tx_hash,omitempty"` } -func (x *EngineGetPayloadBodiesByHashV1Request) Reset() { - *x = EngineGetPayloadBodiesByHashV1Request{} +func (x *BorEventRequest) Reset() { + *x = BorEventRequest{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[31] + mi := &file_remote_ethbackend_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *EngineGetPayloadBodiesByHashV1Request) String() string { +func (x *BorEventRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EngineGetPayloadBodiesByHashV1Request) ProtoMessage() {} +func (*BorEventRequest) ProtoMessage() {} -func (x *EngineGetPayloadBodiesByHashV1Request) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[31] +func (x *BorEventRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1811,44 +1307,45 @@ func (x *EngineGetPayloadBodiesByHashV1Request) ProtoReflect() protoreflect.Mess return mi.MessageOf(x) } -// Deprecated: Use EngineGetPayloadBodiesByHashV1Request.ProtoReflect.Descriptor instead. -func (*EngineGetPayloadBodiesByHashV1Request) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{31} +// Deprecated: Use BorEventRequest.ProtoReflect.Descriptor instead. +func (*BorEventRequest) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{24} } -func (x *EngineGetPayloadBodiesByHashV1Request) GetHashes() []*types.H256 { +func (x *BorEventRequest) GetBorTxHash() *types.H256 { if x != nil { - return x.Hashes + return x.BorTxHash } return nil } -type EngineGetPayloadBodiesByRangeV1Request struct { +type BorEventReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` - Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Present bool `protobuf:"varint,1,opt,name=present,proto3" json:"present,omitempty"` + BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + EventRlps [][]byte `protobuf:"bytes,3,rep,name=event_rlps,json=eventRlps,proto3" json:"event_rlps,omitempty"` } -func (x *EngineGetPayloadBodiesByRangeV1Request) Reset() { - *x = EngineGetPayloadBodiesByRangeV1Request{} +func (x *BorEventReply) Reset() { + *x = BorEventReply{} if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[32] + mi := &file_remote_ethbackend_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *EngineGetPayloadBodiesByRangeV1Request) String() string { +func (x *BorEventReply) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EngineGetPayloadBodiesByRangeV1Request) ProtoMessage() {} +func (*BorEventReply) ProtoMessage() {} -func (x *EngineGetPayloadBodiesByRangeV1Request) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[32] +func (x *BorEventReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1859,68 +1356,28 @@ func (x *EngineGetPayloadBodiesByRangeV1Request) ProtoReflect() protoreflect.Mes return mi.MessageOf(x) } -// Deprecated: Use EngineGetPayloadBodiesByRangeV1Request.ProtoReflect.Descriptor instead. -func (*EngineGetPayloadBodiesByRangeV1Request) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{32} +// Deprecated: Use BorEventReply.ProtoReflect.Descriptor instead. +func (*BorEventReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{25} } -func (x *EngineGetPayloadBodiesByRangeV1Request) GetStart() uint64 { +func (x *BorEventReply) GetPresent() bool { if x != nil { - return x.Start + return x.Present } - return 0 + return false } -func (x *EngineGetPayloadBodiesByRangeV1Request) GetCount() uint64 { +func (x *BorEventReply) GetBlockNumber() uint64 { if x != nil { - return x.Count + return x.BlockNumber } return 0 } -type EngineGetPayloadBodiesV1Response struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bodies []*types.ExecutionPayloadBodyV1 `protobuf:"bytes,1,rep,name=bodies,proto3" json:"bodies,omitempty"` -} - -func (x *EngineGetPayloadBodiesV1Response) Reset() { - *x = EngineGetPayloadBodiesV1Response{} - if protoimpl.UnsafeEnabled { - mi := &file_remote_ethbackend_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EngineGetPayloadBodiesV1Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EngineGetPayloadBodiesV1Response) ProtoMessage() {} - -func (x *EngineGetPayloadBodiesV1Response) ProtoReflect() protoreflect.Message { - mi := &file_remote_ethbackend_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EngineGetPayloadBodiesV1Response.ProtoReflect.Descriptor instead. -func (*EngineGetPayloadBodiesV1Response) Descriptor() ([]byte, []int) { - return file_remote_ethbackend_proto_rawDescGZIP(), []int{33} -} - -func (x *EngineGetPayloadBodiesV1Response) GetBodies() []*types.ExecutionPayloadBodyV1 { +func (x *BorEventReply) GetEventRlps() [][]byte { if x != nil { - return x.Bodies + return x.EventRlps } return nil } @@ -1933,305 +1390,183 @@ var file_remote_ethbackend_proto_rawDesc = []byte{ 0x65, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x37, 0x0a, 0x0e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, - 0x73, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x13, - 0x0a, 0x11, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x21, 0x0a, 0x0f, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, - 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x29, 0x0a, - 0x11, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x38, 0x0a, 0x17, 0x45, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x49, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x11, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x6f, 0x22, 0x30, 0x0a, 0x11, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x72, 0x6c, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x6c, 0x70, 0x22, 0x12, 0x0a, 0x10, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x37, 0x0a, 0x0e, 0x45, 0x74, 0x68, 0x65, 0x72, + 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x21, 0x0a, 0x0f, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x4e, 0x65, 0x74, 0x50, + 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x29, 0x0a, 0x11, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x18, 0x0a, 0x16, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x26, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x16, 0x0a, 0x14, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x31, 0x0a, 0x12, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, + 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x47, + 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x21, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa7, 0x01, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x73, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x61, 0x6c, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x29, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, + 0x36, 0x30, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x23, 0x0a, 0x06, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x73, 0x22, 0xdf, 0x02, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4c, + 0x6f, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x2a, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, - 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xf9, 0x02, 0x0a, - 0x17, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x2c, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, - 0x35, 0x36, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x43, - 0x0a, 0x17, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x65, 0x5f, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x15, 0x73, 0x75, - 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, - 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x6e, 0x6f, 0x54, 0x78, - 0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x6e, 0x6f, - 0x54, 0x78, 0x50, 0x6f, 0x6f, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, - 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x48, - 0x01, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x6e, 0x6f, 0x54, 0x78, 0x50, 0x6f, 0x6f, 0x6c, 0x42, 0x0b, 0x0a, 0x09, 0x5f, - 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xc0, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x33, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x0f, 0x73, 0x61, 0x66, 0x65, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0d, 0x73, - 0x61, 0x66, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3d, 0x0a, 0x14, - 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x23, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x06, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x73, 0x12, 0x36, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x11, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x64, 0x22, 0x5d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2a, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0xba, 0x01, 0x0a, 0x1e, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, - 0x0a, 0x10, 0x66, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, - 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x6b, 0x63, 0x68, 0x6f, - 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4e, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x1f, 0x45, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0e, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, - 0xc7, 0x01, 0x0a, 0x18, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x11, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x12, 0x2c, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x48, 0x32, 0x35, 0x36, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x37, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, 0x52, 0x0b, 0x62, 0x6c, - 0x6f, 0x62, 0x73, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x26, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x31, 0x0a, 0x12, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, - 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x47, 0x0a, - 0x0e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x21, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa7, 0x01, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x73, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x61, 0x6c, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x12, 0x29, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x31, 0x36, - 0x30, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, - 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x23, 0x0a, 0x06, 0x74, - 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, - 0x22, 0xdf, 0x02, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4c, 0x6f, - 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x48, 0x31, 0x36, 0x30, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2a, - 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, - 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x23, - 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x06, 0x74, 0x6f, 0x70, - 0x69, 0x63, 0x73, 0x12, 0x36, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x11, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x64, 0x22, 0x5d, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2a, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x22, 0x43, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6c, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6c, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x22, 0x3a, 0x0a, 0x10, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, - 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x08, 0x74, 0x78, - 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x07, 0x74, 0x78, 0x6e, 0x48, 0x61, - 0x73, 0x68, 0x22, 0x33, 0x0a, 0x0e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x22, 0x22, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x45, 0x0a, 0x0e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x73, - 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x33, 0x0a, 0x0a, - 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x70, 0x65, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, - 0x73, 0x22, 0x28, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x30, 0x0a, 0x11, 0x50, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x22, 0x43, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6c, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6c, 0x70, 0x22, 0x4c, 0x0a, - 0x25, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x56, 0x31, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, - 0x32, 0x35, 0x36, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x54, 0x0a, 0x26, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, - 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x56, 0x31, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x22, 0x59, 0x0a, 0x20, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x56, 0x31, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x62, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, - 0x64, 0x79, 0x56, 0x31, 0x52, 0x06, 0x62, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x2a, 0x4a, 0x0a, 0x05, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, - 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x47, - 0x53, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x42, - 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x45, 0x57, 0x5f, 0x53, 0x4e, - 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x03, 0x2a, 0x59, 0x0a, 0x0c, 0x45, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0c, 0x0a, - 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x49, - 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x48, 0x41, 0x53, - 0x48, 0x10, 0x04, 0x32, 0x9c, 0x0b, 0x0a, 0x0a, 0x45, 0x54, 0x48, 0x42, 0x41, 0x43, 0x4b, 0x45, - 0x4e, 0x44, 0x12, 0x3d, 0x0a, 0x09, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x12, - 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, - 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, - 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, - 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x48, 0x0a, 0x10, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x4e, 0x65, 0x77, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x6a, 0x0a, 0x17, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x46, - 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x12, 0x26, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, - 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, - 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x55, 0x0a, 0x10, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x1e, 0x45, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x69, - 0x65, 0x73, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x56, 0x31, 0x12, 0x2d, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, - 0x56, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x56, 0x31, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x1f, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x56, 0x31, 0x12, 0x2e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x56, 0x31, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, - 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x56, 0x31, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4f, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x49, 0x0a, 0x0d, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3f, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x30, 0x01, 0x12, 0x4a, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, - 0x4c, 0x6f, 0x67, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, - 0x01, 0x12, 0x31, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, - 0x70, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x12, 0x3c, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x12, 0x33, 0x0a, 0x05, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x65, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, - 0x72, 0x12, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x41, 0x0a, 0x0c, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6c, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x22, 0x3a, 0x0a, 0x10, 0x54, 0x78, 0x6e, 0x4c, 0x6f, + 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x08, 0x74, + 0x78, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x07, 0x74, 0x78, 0x6e, 0x48, + 0x61, 0x73, 0x68, 0x22, 0x33, 0x0a, 0x0e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x22, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x45, 0x0a, 0x0e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, + 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x33, 0x0a, + 0x0a, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x70, 0x65, 0x65, + 0x72, 0x73, 0x22, 0x28, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x3e, 0x0a, 0x0f, + 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2b, 0x0a, 0x0b, 0x62, 0x6f, 0x72, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, + 0x36, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x6b, 0x0a, 0x0d, + 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6c, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x6c, 0x70, 0x73, 0x2a, 0x4a, 0x0a, 0x05, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x00, 0x12, 0x10, + 0x0a, 0x0c, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x47, 0x53, 0x10, 0x01, + 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x4c, 0x4f, 0x43, + 0x4b, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x45, 0x57, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, + 0x48, 0x4f, 0x54, 0x10, 0x03, 0x32, 0xd3, 0x07, 0x0a, 0x0a, 0x45, 0x54, 0x48, 0x42, 0x41, 0x43, + 0x4b, 0x45, 0x4e, 0x44, 0x12, 0x3d, 0x0a, 0x09, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, + 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, + 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, + 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x50, + 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, + 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4f, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x49, 0x0a, 0x0d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x3f, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x18, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x30, 0x01, 0x12, 0x4a, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4c, + 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x67, + 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, 0x01, 0x12, 0x31, + 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x18, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x3c, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, + 0x0a, 0x05, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x16, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, + 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x41, 0x0a, 0x0c, + 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x3a, 0x0a, 0x08, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, + 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x11, 0x5a, 0x0f, 0x2e, + 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2246,129 +1581,93 @@ func file_remote_ethbackend_proto_rawDescGZIP() []byte { return file_remote_ethbackend_proto_rawDescData } -var file_remote_ethbackend_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_remote_ethbackend_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_remote_ethbackend_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_remote_ethbackend_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_remote_ethbackend_proto_goTypes = []interface{}{ - (Event)(0), // 0: remote.Event - (EngineStatus)(0), // 1: remote.EngineStatus - (*EtherbaseRequest)(nil), // 2: remote.EtherbaseRequest - (*EtherbaseReply)(nil), // 3: remote.EtherbaseReply - (*NetVersionRequest)(nil), // 4: remote.NetVersionRequest - (*NetVersionReply)(nil), // 5: remote.NetVersionReply - (*NetPeerCountRequest)(nil), // 6: remote.NetPeerCountRequest - (*NetPeerCountReply)(nil), // 7: remote.NetPeerCountReply - (*EngineGetPayloadRequest)(nil), // 8: remote.EngineGetPayloadRequest - (*EnginePayloadStatus)(nil), // 9: remote.EnginePayloadStatus - (*EnginePayloadAttributes)(nil), // 10: remote.EnginePayloadAttributes - (*EngineForkChoiceState)(nil), // 11: remote.EngineForkChoiceState - (*EngineForkChoiceUpdatedRequest)(nil), // 12: remote.EngineForkChoiceUpdatedRequest - (*EngineForkChoiceUpdatedResponse)(nil), // 13: remote.EngineForkChoiceUpdatedResponse - (*EngineGetPayloadResponse)(nil), // 14: remote.EngineGetPayloadResponse - (*ProtocolVersionRequest)(nil), // 15: remote.ProtocolVersionRequest - (*ProtocolVersionReply)(nil), // 16: remote.ProtocolVersionReply - (*ClientVersionRequest)(nil), // 17: remote.ClientVersionRequest - (*ClientVersionReply)(nil), // 18: remote.ClientVersionReply - (*SubscribeRequest)(nil), // 19: remote.SubscribeRequest - (*SubscribeReply)(nil), // 20: remote.SubscribeReply - (*LogsFilterRequest)(nil), // 21: remote.LogsFilterRequest - (*SubscribeLogsReply)(nil), // 22: remote.SubscribeLogsReply - (*BlockRequest)(nil), // 23: remote.BlockRequest - (*BlockReply)(nil), // 24: remote.BlockReply - (*TxnLookupRequest)(nil), // 25: remote.TxnLookupRequest - (*TxnLookupReply)(nil), // 26: remote.TxnLookupReply - (*NodesInfoRequest)(nil), // 27: remote.NodesInfoRequest - (*AddPeerRequest)(nil), // 28: remote.AddPeerRequest - (*NodesInfoReply)(nil), // 29: remote.NodesInfoReply - (*PeersReply)(nil), // 30: remote.PeersReply - (*AddPeerReply)(nil), // 31: remote.AddPeerReply - (*PendingBlockReply)(nil), // 32: remote.PendingBlockReply - (*EngineGetPayloadBodiesByHashV1Request)(nil), // 33: remote.EngineGetPayloadBodiesByHashV1Request - (*EngineGetPayloadBodiesByRangeV1Request)(nil), // 34: remote.EngineGetPayloadBodiesByRangeV1Request - (*EngineGetPayloadBodiesV1Response)(nil), // 35: remote.EngineGetPayloadBodiesV1Response - (*types.H160)(nil), // 36: types.H160 - (*types.H256)(nil), // 37: types.H256 - (*types.Withdrawal)(nil), // 38: types.Withdrawal - (*types.ExecutionPayload)(nil), // 39: types.ExecutionPayload - (*types.BlobsBundleV1)(nil), // 40: types.BlobsBundleV1 - (*types.NodeInfoReply)(nil), // 41: types.NodeInfoReply - (*types.PeerInfo)(nil), // 42: types.PeerInfo - (*types.ExecutionPayloadBodyV1)(nil), // 43: types.ExecutionPayloadBodyV1 - (*emptypb.Empty)(nil), // 44: google.protobuf.Empty - (*types.VersionReply)(nil), // 45: types.VersionReply + (Event)(0), // 0: remote.Event + (*PendingBlockReply)(nil), // 1: remote.PendingBlockReply + (*EtherbaseRequest)(nil), // 2: remote.EtherbaseRequest + (*EtherbaseReply)(nil), // 3: remote.EtherbaseReply + (*NetVersionRequest)(nil), // 4: remote.NetVersionRequest + (*NetVersionReply)(nil), // 5: remote.NetVersionReply + (*NetPeerCountRequest)(nil), // 6: remote.NetPeerCountRequest + (*NetPeerCountReply)(nil), // 7: remote.NetPeerCountReply + (*ProtocolVersionRequest)(nil), // 8: remote.ProtocolVersionRequest + (*ProtocolVersionReply)(nil), // 9: remote.ProtocolVersionReply + (*ClientVersionRequest)(nil), // 10: remote.ClientVersionRequest + (*ClientVersionReply)(nil), // 11: remote.ClientVersionReply + (*SubscribeRequest)(nil), // 12: remote.SubscribeRequest + (*SubscribeReply)(nil), // 13: remote.SubscribeReply + (*LogsFilterRequest)(nil), // 14: remote.LogsFilterRequest + (*SubscribeLogsReply)(nil), // 15: remote.SubscribeLogsReply + (*BlockRequest)(nil), // 16: remote.BlockRequest + (*BlockReply)(nil), // 17: remote.BlockReply + (*TxnLookupRequest)(nil), // 18: remote.TxnLookupRequest + (*TxnLookupReply)(nil), // 19: remote.TxnLookupReply + (*NodesInfoRequest)(nil), // 20: remote.NodesInfoRequest + (*AddPeerRequest)(nil), // 21: remote.AddPeerRequest + (*NodesInfoReply)(nil), // 22: remote.NodesInfoReply + (*PeersReply)(nil), // 23: remote.PeersReply + (*AddPeerReply)(nil), // 24: remote.AddPeerReply + (*BorEventRequest)(nil), // 25: remote.BorEventRequest + (*BorEventReply)(nil), // 26: remote.BorEventReply + (*types.H160)(nil), // 27: types.H160 + (*types.H256)(nil), // 28: types.H256 + (*types.NodeInfoReply)(nil), // 29: types.NodeInfoReply + (*types.PeerInfo)(nil), // 30: types.PeerInfo + (*emptypb.Empty)(nil), // 31: google.protobuf.Empty + (*types.VersionReply)(nil), // 32: types.VersionReply } var file_remote_ethbackend_proto_depIdxs = []int32{ - 36, // 0: remote.EtherbaseReply.address:type_name -> types.H160 - 1, // 1: remote.EnginePayloadStatus.status:type_name -> remote.EngineStatus - 37, // 2: remote.EnginePayloadStatus.latest_valid_hash:type_name -> types.H256 - 37, // 3: remote.EnginePayloadAttributes.prev_randao:type_name -> types.H256 - 36, // 4: remote.EnginePayloadAttributes.suggested_fee_recipient:type_name -> types.H160 - 38, // 5: remote.EnginePayloadAttributes.withdrawals:type_name -> types.Withdrawal - 37, // 6: remote.EngineForkChoiceState.head_block_hash:type_name -> types.H256 - 37, // 7: remote.EngineForkChoiceState.safe_block_hash:type_name -> types.H256 - 37, // 8: remote.EngineForkChoiceState.finalized_block_hash:type_name -> types.H256 - 11, // 9: remote.EngineForkChoiceUpdatedRequest.forkchoice_state:type_name -> remote.EngineForkChoiceState - 10, // 10: remote.EngineForkChoiceUpdatedRequest.payload_attributes:type_name -> remote.EnginePayloadAttributes - 9, // 11: remote.EngineForkChoiceUpdatedResponse.payload_status:type_name -> remote.EnginePayloadStatus - 39, // 12: remote.EngineGetPayloadResponse.execution_payload:type_name -> types.ExecutionPayload - 37, // 13: remote.EngineGetPayloadResponse.block_value:type_name -> types.H256 - 40, // 14: remote.EngineGetPayloadResponse.blobs_bundle:type_name -> types.BlobsBundleV1 - 0, // 15: remote.SubscribeRequest.type:type_name -> remote.Event - 0, // 16: remote.SubscribeReply.type:type_name -> remote.Event - 36, // 17: remote.LogsFilterRequest.addresses:type_name -> types.H160 - 37, // 18: remote.LogsFilterRequest.topics:type_name -> types.H256 - 36, // 19: remote.SubscribeLogsReply.address:type_name -> types.H160 - 37, // 20: remote.SubscribeLogsReply.block_hash:type_name -> types.H256 - 37, // 21: remote.SubscribeLogsReply.topics:type_name -> types.H256 - 37, // 22: remote.SubscribeLogsReply.transaction_hash:type_name -> types.H256 - 37, // 23: remote.BlockRequest.block_hash:type_name -> types.H256 - 37, // 24: remote.TxnLookupRequest.txn_hash:type_name -> types.H256 - 41, // 25: remote.NodesInfoReply.nodes_info:type_name -> types.NodeInfoReply - 42, // 26: remote.PeersReply.peers:type_name -> types.PeerInfo - 37, // 27: remote.EngineGetPayloadBodiesByHashV1Request.hashes:type_name -> types.H256 - 43, // 28: remote.EngineGetPayloadBodiesV1Response.bodies:type_name -> types.ExecutionPayloadBodyV1 - 2, // 29: remote.ETHBACKEND.Etherbase:input_type -> remote.EtherbaseRequest - 4, // 30: remote.ETHBACKEND.NetVersion:input_type -> remote.NetVersionRequest - 6, // 31: remote.ETHBACKEND.NetPeerCount:input_type -> remote.NetPeerCountRequest - 39, // 32: remote.ETHBACKEND.EngineNewPayload:input_type -> types.ExecutionPayload - 12, // 33: remote.ETHBACKEND.EngineForkChoiceUpdated:input_type -> remote.EngineForkChoiceUpdatedRequest - 8, // 34: remote.ETHBACKEND.EngineGetPayload:input_type -> remote.EngineGetPayloadRequest - 33, // 35: remote.ETHBACKEND.EngineGetPayloadBodiesByHashV1:input_type -> remote.EngineGetPayloadBodiesByHashV1Request - 34, // 36: remote.ETHBACKEND.EngineGetPayloadBodiesByRangeV1:input_type -> remote.EngineGetPayloadBodiesByRangeV1Request - 44, // 37: remote.ETHBACKEND.Version:input_type -> google.protobuf.Empty - 15, // 38: remote.ETHBACKEND.ProtocolVersion:input_type -> remote.ProtocolVersionRequest - 17, // 39: remote.ETHBACKEND.ClientVersion:input_type -> remote.ClientVersionRequest - 19, // 40: remote.ETHBACKEND.Subscribe:input_type -> remote.SubscribeRequest - 21, // 41: remote.ETHBACKEND.SubscribeLogs:input_type -> remote.LogsFilterRequest - 23, // 42: remote.ETHBACKEND.Block:input_type -> remote.BlockRequest - 25, // 43: remote.ETHBACKEND.TxnLookup:input_type -> remote.TxnLookupRequest - 27, // 44: remote.ETHBACKEND.NodeInfo:input_type -> remote.NodesInfoRequest - 44, // 45: remote.ETHBACKEND.Peers:input_type -> google.protobuf.Empty - 28, // 46: remote.ETHBACKEND.AddPeer:input_type -> remote.AddPeerRequest - 44, // 47: remote.ETHBACKEND.PendingBlock:input_type -> google.protobuf.Empty - 3, // 48: remote.ETHBACKEND.Etherbase:output_type -> remote.EtherbaseReply - 5, // 49: remote.ETHBACKEND.NetVersion:output_type -> remote.NetVersionReply - 7, // 50: remote.ETHBACKEND.NetPeerCount:output_type -> remote.NetPeerCountReply - 9, // 51: remote.ETHBACKEND.EngineNewPayload:output_type -> remote.EnginePayloadStatus - 13, // 52: remote.ETHBACKEND.EngineForkChoiceUpdated:output_type -> remote.EngineForkChoiceUpdatedResponse - 14, // 53: remote.ETHBACKEND.EngineGetPayload:output_type -> remote.EngineGetPayloadResponse - 35, // 54: remote.ETHBACKEND.EngineGetPayloadBodiesByHashV1:output_type -> remote.EngineGetPayloadBodiesV1Response - 35, // 55: remote.ETHBACKEND.EngineGetPayloadBodiesByRangeV1:output_type -> remote.EngineGetPayloadBodiesV1Response - 45, // 56: remote.ETHBACKEND.Version:output_type -> types.VersionReply - 16, // 57: remote.ETHBACKEND.ProtocolVersion:output_type -> remote.ProtocolVersionReply - 18, // 58: remote.ETHBACKEND.ClientVersion:output_type -> remote.ClientVersionReply - 20, // 59: remote.ETHBACKEND.Subscribe:output_type -> remote.SubscribeReply - 22, // 60: remote.ETHBACKEND.SubscribeLogs:output_type -> remote.SubscribeLogsReply - 24, // 61: remote.ETHBACKEND.Block:output_type -> remote.BlockReply - 26, // 62: remote.ETHBACKEND.TxnLookup:output_type -> remote.TxnLookupReply - 29, // 63: remote.ETHBACKEND.NodeInfo:output_type -> remote.NodesInfoReply - 30, // 64: remote.ETHBACKEND.Peers:output_type -> remote.PeersReply - 31, // 65: remote.ETHBACKEND.AddPeer:output_type -> remote.AddPeerReply - 32, // 66: remote.ETHBACKEND.PendingBlock:output_type -> remote.PendingBlockReply - 48, // [48:67] is the sub-list for method output_type - 29, // [29:48] is the sub-list for method input_type - 29, // [29:29] is the sub-list for extension type_name - 29, // [29:29] is the sub-list for extension extendee - 0, // [0:29] is the sub-list for field type_name + 27, // 0: remote.EtherbaseReply.address:type_name -> types.H160 + 0, // 1: remote.SubscribeRequest.type:type_name -> remote.Event + 0, // 2: remote.SubscribeReply.type:type_name -> remote.Event + 27, // 3: remote.LogsFilterRequest.addresses:type_name -> types.H160 + 28, // 4: remote.LogsFilterRequest.topics:type_name -> types.H256 + 27, // 5: remote.SubscribeLogsReply.address:type_name -> types.H160 + 28, // 6: remote.SubscribeLogsReply.block_hash:type_name -> types.H256 + 28, // 7: remote.SubscribeLogsReply.topics:type_name -> types.H256 + 28, // 8: remote.SubscribeLogsReply.transaction_hash:type_name -> types.H256 + 28, // 9: remote.BlockRequest.block_hash:type_name -> types.H256 + 28, // 10: remote.TxnLookupRequest.txn_hash:type_name -> types.H256 + 29, // 11: remote.NodesInfoReply.nodes_info:type_name -> types.NodeInfoReply + 30, // 12: remote.PeersReply.peers:type_name -> types.PeerInfo + 28, // 13: remote.BorEventRequest.bor_tx_hash:type_name -> types.H256 + 2, // 14: remote.ETHBACKEND.Etherbase:input_type -> remote.EtherbaseRequest + 4, // 15: remote.ETHBACKEND.NetVersion:input_type -> remote.NetVersionRequest + 6, // 16: remote.ETHBACKEND.NetPeerCount:input_type -> remote.NetPeerCountRequest + 31, // 17: remote.ETHBACKEND.Version:input_type -> google.protobuf.Empty + 8, // 18: remote.ETHBACKEND.ProtocolVersion:input_type -> remote.ProtocolVersionRequest + 10, // 19: remote.ETHBACKEND.ClientVersion:input_type -> remote.ClientVersionRequest + 12, // 20: remote.ETHBACKEND.Subscribe:input_type -> remote.SubscribeRequest + 14, // 21: remote.ETHBACKEND.SubscribeLogs:input_type -> remote.LogsFilterRequest + 16, // 22: remote.ETHBACKEND.Block:input_type -> remote.BlockRequest + 18, // 23: remote.ETHBACKEND.TxnLookup:input_type -> remote.TxnLookupRequest + 20, // 24: remote.ETHBACKEND.NodeInfo:input_type -> remote.NodesInfoRequest + 31, // 25: remote.ETHBACKEND.Peers:input_type -> google.protobuf.Empty + 21, // 26: remote.ETHBACKEND.AddPeer:input_type -> remote.AddPeerRequest + 31, // 27: remote.ETHBACKEND.PendingBlock:input_type -> google.protobuf.Empty + 25, // 28: remote.ETHBACKEND.BorEvent:input_type -> remote.BorEventRequest + 3, // 29: remote.ETHBACKEND.Etherbase:output_type -> remote.EtherbaseReply + 5, // 30: remote.ETHBACKEND.NetVersion:output_type -> remote.NetVersionReply + 7, // 31: remote.ETHBACKEND.NetPeerCount:output_type -> remote.NetPeerCountReply + 32, // 32: remote.ETHBACKEND.Version:output_type -> types.VersionReply + 9, // 33: remote.ETHBACKEND.ProtocolVersion:output_type -> remote.ProtocolVersionReply + 11, // 34: remote.ETHBACKEND.ClientVersion:output_type -> remote.ClientVersionReply + 13, // 35: remote.ETHBACKEND.Subscribe:output_type -> remote.SubscribeReply + 15, // 36: remote.ETHBACKEND.SubscribeLogs:output_type -> remote.SubscribeLogsReply + 17, // 37: remote.ETHBACKEND.Block:output_type -> remote.BlockReply + 19, // 38: remote.ETHBACKEND.TxnLookup:output_type -> remote.TxnLookupReply + 22, // 39: remote.ETHBACKEND.NodeInfo:output_type -> remote.NodesInfoReply + 23, // 40: remote.ETHBACKEND.Peers:output_type -> remote.PeersReply + 24, // 41: remote.ETHBACKEND.AddPeer:output_type -> remote.AddPeerReply + 1, // 42: remote.ETHBACKEND.PendingBlock:output_type -> remote.PendingBlockReply + 26, // 43: remote.ETHBACKEND.BorEvent:output_type -> remote.BorEventReply + 29, // [29:44] is the sub-list for method output_type + 14, // [14:29] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_remote_ethbackend_proto_init() } @@ -2378,7 +1677,7 @@ func file_remote_ethbackend_proto_init() { } if !protoimpl.UnsafeEnabled { file_remote_ethbackend_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EtherbaseRequest); i { + switch v := v.(*PendingBlockReply); i { case 0: return &v.state case 1: @@ -2390,7 +1689,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EtherbaseReply); i { + switch v := v.(*EtherbaseRequest); i { case 0: return &v.state case 1: @@ -2402,7 +1701,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetVersionRequest); i { + switch v := v.(*EtherbaseReply); i { case 0: return &v.state case 1: @@ -2414,7 +1713,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetVersionReply); i { + switch v := v.(*NetVersionRequest); i { case 0: return &v.state case 1: @@ -2426,7 +1725,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetPeerCountRequest); i { + switch v := v.(*NetVersionReply); i { case 0: return &v.state case 1: @@ -2438,7 +1737,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetPeerCountReply); i { + switch v := v.(*NetPeerCountRequest); i { case 0: return &v.state case 1: @@ -2450,7 +1749,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineGetPayloadRequest); i { + switch v := v.(*NetPeerCountReply); i { case 0: return &v.state case 1: @@ -2462,7 +1761,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnginePayloadStatus); i { + switch v := v.(*ProtocolVersionRequest); i { case 0: return &v.state case 1: @@ -2474,7 +1773,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnginePayloadAttributes); i { + switch v := v.(*ProtocolVersionReply); i { case 0: return &v.state case 1: @@ -2486,7 +1785,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineForkChoiceState); i { + switch v := v.(*ClientVersionRequest); i { case 0: return &v.state case 1: @@ -2498,7 +1797,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineForkChoiceUpdatedRequest); i { + switch v := v.(*ClientVersionReply); i { case 0: return &v.state case 1: @@ -2510,7 +1809,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineForkChoiceUpdatedResponse); i { + switch v := v.(*SubscribeRequest); i { case 0: return &v.state case 1: @@ -2522,7 +1821,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineGetPayloadResponse); i { + switch v := v.(*SubscribeReply); i { case 0: return &v.state case 1: @@ -2534,7 +1833,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtocolVersionRequest); i { + switch v := v.(*LogsFilterRequest); i { case 0: return &v.state case 1: @@ -2546,7 +1845,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtocolVersionReply); i { + switch v := v.(*SubscribeLogsReply); i { case 0: return &v.state case 1: @@ -2558,7 +1857,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientVersionRequest); i { + switch v := v.(*BlockRequest); i { case 0: return &v.state case 1: @@ -2570,7 +1869,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientVersionReply); i { + switch v := v.(*BlockReply); i { case 0: return &v.state case 1: @@ -2582,7 +1881,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeRequest); i { + switch v := v.(*TxnLookupRequest); i { case 0: return &v.state case 1: @@ -2594,7 +1893,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeReply); i { + switch v := v.(*TxnLookupReply); i { case 0: return &v.state case 1: @@ -2606,7 +1905,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LogsFilterRequest); i { + switch v := v.(*NodesInfoRequest); i { case 0: return &v.state case 1: @@ -2618,7 +1917,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeLogsReply); i { + switch v := v.(*AddPeerRequest); i { case 0: return &v.state case 1: @@ -2630,7 +1929,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockRequest); i { + switch v := v.(*NodesInfoReply); i { case 0: return &v.state case 1: @@ -2642,7 +1941,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockReply); i { + switch v := v.(*PeersReply); i { case 0: return &v.state case 1: @@ -2654,7 +1953,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TxnLookupRequest); i { + switch v := v.(*AddPeerReply); i { case 0: return &v.state case 1: @@ -2666,7 +1965,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TxnLookupReply); i { + switch v := v.(*BorEventRequest); i { case 0: return &v.state case 1: @@ -2678,103 +1977,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodesInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddPeerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodesInfoReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeersReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddPeerReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PendingBlockReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineGetPayloadBodiesByHashV1Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineGetPayloadBodiesByRangeV1Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_remote_ethbackend_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EngineGetPayloadBodiesV1Response); i { + switch v := v.(*BorEventReply); i { case 0: return &v.state case 1: @@ -2786,14 +1989,13 @@ func file_remote_ethbackend_proto_init() { } } } - file_remote_ethbackend_proto_msgTypes[8].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_remote_ethbackend_proto_rawDesc, - NumEnums: 2, - NumMessages: 34, + NumEnums: 1, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/gointerfaces/remote/ethbackend_grpc.pb.go b/gointerfaces/remote/ethbackend_grpc.pb.go index 5b2c179f0..8e986e082 100644 --- a/gointerfaces/remote/ethbackend_grpc.pb.go +++ b/gointerfaces/remote/ethbackend_grpc.pb.go @@ -21,25 +21,21 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ETHBACKEND_Etherbase_FullMethodName = "/remote.ETHBACKEND/Etherbase" - ETHBACKEND_NetVersion_FullMethodName = "/remote.ETHBACKEND/NetVersion" - ETHBACKEND_NetPeerCount_FullMethodName = "/remote.ETHBACKEND/NetPeerCount" - ETHBACKEND_EngineNewPayload_FullMethodName = "/remote.ETHBACKEND/EngineNewPayload" - ETHBACKEND_EngineForkChoiceUpdated_FullMethodName = "/remote.ETHBACKEND/EngineForkChoiceUpdated" - ETHBACKEND_EngineGetPayload_FullMethodName = "/remote.ETHBACKEND/EngineGetPayload" - ETHBACKEND_EngineGetPayloadBodiesByHashV1_FullMethodName = "/remote.ETHBACKEND/EngineGetPayloadBodiesByHashV1" - ETHBACKEND_EngineGetPayloadBodiesByRangeV1_FullMethodName = "/remote.ETHBACKEND/EngineGetPayloadBodiesByRangeV1" - ETHBACKEND_Version_FullMethodName = "/remote.ETHBACKEND/Version" - ETHBACKEND_ProtocolVersion_FullMethodName = "/remote.ETHBACKEND/ProtocolVersion" - ETHBACKEND_ClientVersion_FullMethodName = "/remote.ETHBACKEND/ClientVersion" - ETHBACKEND_Subscribe_FullMethodName = "/remote.ETHBACKEND/Subscribe" - ETHBACKEND_SubscribeLogs_FullMethodName = "/remote.ETHBACKEND/SubscribeLogs" - ETHBACKEND_Block_FullMethodName = "/remote.ETHBACKEND/Block" - ETHBACKEND_TxnLookup_FullMethodName = "/remote.ETHBACKEND/TxnLookup" - ETHBACKEND_NodeInfo_FullMethodName = "/remote.ETHBACKEND/NodeInfo" - ETHBACKEND_Peers_FullMethodName = "/remote.ETHBACKEND/Peers" - ETHBACKEND_AddPeer_FullMethodName = "/remote.ETHBACKEND/AddPeer" - ETHBACKEND_PendingBlock_FullMethodName = "/remote.ETHBACKEND/PendingBlock" + ETHBACKEND_Etherbase_FullMethodName = "/remote.ETHBACKEND/Etherbase" + ETHBACKEND_NetVersion_FullMethodName = "/remote.ETHBACKEND/NetVersion" + ETHBACKEND_NetPeerCount_FullMethodName = "/remote.ETHBACKEND/NetPeerCount" + ETHBACKEND_Version_FullMethodName = "/remote.ETHBACKEND/Version" + ETHBACKEND_ProtocolVersion_FullMethodName = "/remote.ETHBACKEND/ProtocolVersion" + ETHBACKEND_ClientVersion_FullMethodName = "/remote.ETHBACKEND/ClientVersion" + ETHBACKEND_Subscribe_FullMethodName = "/remote.ETHBACKEND/Subscribe" + ETHBACKEND_SubscribeLogs_FullMethodName = "/remote.ETHBACKEND/SubscribeLogs" + ETHBACKEND_Block_FullMethodName = "/remote.ETHBACKEND/Block" + ETHBACKEND_TxnLookup_FullMethodName = "/remote.ETHBACKEND/TxnLookup" + ETHBACKEND_NodeInfo_FullMethodName = "/remote.ETHBACKEND/NodeInfo" + ETHBACKEND_Peers_FullMethodName = "/remote.ETHBACKEND/Peers" + ETHBACKEND_AddPeer_FullMethodName = "/remote.ETHBACKEND/AddPeer" + ETHBACKEND_PendingBlock_FullMethodName = "/remote.ETHBACKEND/PendingBlock" + ETHBACKEND_BorEvent_FullMethodName = "/remote.ETHBACKEND/BorEvent" ) // ETHBACKENDClient is the client API for ETHBACKEND service. @@ -49,14 +45,6 @@ type ETHBACKENDClient interface { Etherbase(ctx context.Context, in *EtherbaseRequest, opts ...grpc.CallOption) (*EtherbaseReply, error) NetVersion(ctx context.Context, in *NetVersionRequest, opts ...grpc.CallOption) (*NetVersionReply, error) NetPeerCount(ctx context.Context, in *NetPeerCountRequest, opts ...grpc.CallOption) (*NetPeerCountReply, error) - // Validate and possibly execute the payload. - EngineNewPayload(ctx context.Context, in *types.ExecutionPayload, opts ...grpc.CallOption) (*EnginePayloadStatus, error) - // Update fork choice - EngineForkChoiceUpdated(ctx context.Context, in *EngineForkChoiceUpdatedRequest, opts ...grpc.CallOption) (*EngineForkChoiceUpdatedResponse, error) - // Fetch the payload along with its blobs by ID. - EngineGetPayload(ctx context.Context, in *EngineGetPayloadRequest, opts ...grpc.CallOption) (*EngineGetPayloadResponse, error) - EngineGetPayloadBodiesByHashV1(ctx context.Context, in *EngineGetPayloadBodiesByHashV1Request, opts ...grpc.CallOption) (*EngineGetPayloadBodiesV1Response, error) - EngineGetPayloadBodiesByRangeV1(ctx context.Context, in *EngineGetPayloadBodiesByRangeV1Request, opts ...grpc.CallOption) (*EngineGetPayloadBodiesV1Response, error) // Version returns the service version number Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) // ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66). @@ -78,7 +66,9 @@ type ETHBACKENDClient interface { // Peers collects and returns peers information from all running sentry instances. Peers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*AddPeerReply, error) + // PendingBlock returns latest built block. PendingBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PendingBlockReply, error) + BorEvent(ctx context.Context, in *BorEventRequest, opts ...grpc.CallOption) (*BorEventReply, error) } type eTHBACKENDClient struct { @@ -116,51 +106,6 @@ func (c *eTHBACKENDClient) NetPeerCount(ctx context.Context, in *NetPeerCountReq return out, nil } -func (c *eTHBACKENDClient) EngineNewPayload(ctx context.Context, in *types.ExecutionPayload, opts ...grpc.CallOption) (*EnginePayloadStatus, error) { - out := new(EnginePayloadStatus) - err := c.cc.Invoke(ctx, ETHBACKEND_EngineNewPayload_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eTHBACKENDClient) EngineForkChoiceUpdated(ctx context.Context, in *EngineForkChoiceUpdatedRequest, opts ...grpc.CallOption) (*EngineForkChoiceUpdatedResponse, error) { - out := new(EngineForkChoiceUpdatedResponse) - err := c.cc.Invoke(ctx, ETHBACKEND_EngineForkChoiceUpdated_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eTHBACKENDClient) EngineGetPayload(ctx context.Context, in *EngineGetPayloadRequest, opts ...grpc.CallOption) (*EngineGetPayloadResponse, error) { - out := new(EngineGetPayloadResponse) - err := c.cc.Invoke(ctx, ETHBACKEND_EngineGetPayload_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eTHBACKENDClient) EngineGetPayloadBodiesByHashV1(ctx context.Context, in *EngineGetPayloadBodiesByHashV1Request, opts ...grpc.CallOption) (*EngineGetPayloadBodiesV1Response, error) { - out := new(EngineGetPayloadBodiesV1Response) - err := c.cc.Invoke(ctx, ETHBACKEND_EngineGetPayloadBodiesByHashV1_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eTHBACKENDClient) EngineGetPayloadBodiesByRangeV1(ctx context.Context, in *EngineGetPayloadBodiesByRangeV1Request, opts ...grpc.CallOption) (*EngineGetPayloadBodiesV1Response, error) { - out := new(EngineGetPayloadBodiesV1Response) - err := c.cc.Invoke(ctx, ETHBACKEND_EngineGetPayloadBodiesByRangeV1_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *eTHBACKENDClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) { out := new(types.VersionReply) err := c.cc.Invoke(ctx, ETHBACKEND_Version_FullMethodName, in, out, opts...) @@ -305,6 +250,15 @@ func (c *eTHBACKENDClient) PendingBlock(ctx context.Context, in *emptypb.Empty, return out, nil } +func (c *eTHBACKENDClient) BorEvent(ctx context.Context, in *BorEventRequest, opts ...grpc.CallOption) (*BorEventReply, error) { + out := new(BorEventReply) + err := c.cc.Invoke(ctx, ETHBACKEND_BorEvent_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ETHBACKENDServer is the server API for ETHBACKEND service. // All implementations must embed UnimplementedETHBACKENDServer // for forward compatibility @@ -312,14 +266,6 @@ type ETHBACKENDServer interface { Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) NetPeerCount(context.Context, *NetPeerCountRequest) (*NetPeerCountReply, error) - // Validate and possibly execute the payload. - EngineNewPayload(context.Context, *types.ExecutionPayload) (*EnginePayloadStatus, error) - // Update fork choice - EngineForkChoiceUpdated(context.Context, *EngineForkChoiceUpdatedRequest) (*EngineForkChoiceUpdatedResponse, error) - // Fetch the payload along with its blobs by ID. - EngineGetPayload(context.Context, *EngineGetPayloadRequest) (*EngineGetPayloadResponse, error) - EngineGetPayloadBodiesByHashV1(context.Context, *EngineGetPayloadBodiesByHashV1Request) (*EngineGetPayloadBodiesV1Response, error) - EngineGetPayloadBodiesByRangeV1(context.Context, *EngineGetPayloadBodiesByRangeV1Request) (*EngineGetPayloadBodiesV1Response, error) // Version returns the service version number Version(context.Context, *emptypb.Empty) (*types.VersionReply, error) // ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66). @@ -341,7 +287,9 @@ type ETHBACKENDServer interface { // Peers collects and returns peers information from all running sentry instances. Peers(context.Context, *emptypb.Empty) (*PeersReply, error) AddPeer(context.Context, *AddPeerRequest) (*AddPeerReply, error) + // PendingBlock returns latest built block. PendingBlock(context.Context, *emptypb.Empty) (*PendingBlockReply, error) + BorEvent(context.Context, *BorEventRequest) (*BorEventReply, error) mustEmbedUnimplementedETHBACKENDServer() } @@ -358,21 +306,6 @@ func (UnimplementedETHBACKENDServer) NetVersion(context.Context, *NetVersionRequ func (UnimplementedETHBACKENDServer) NetPeerCount(context.Context, *NetPeerCountRequest) (*NetPeerCountReply, error) { return nil, status.Errorf(codes.Unimplemented, "method NetPeerCount not implemented") } -func (UnimplementedETHBACKENDServer) EngineNewPayload(context.Context, *types.ExecutionPayload) (*EnginePayloadStatus, error) { - return nil, status.Errorf(codes.Unimplemented, "method EngineNewPayload not implemented") -} -func (UnimplementedETHBACKENDServer) EngineForkChoiceUpdated(context.Context, *EngineForkChoiceUpdatedRequest) (*EngineForkChoiceUpdatedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EngineForkChoiceUpdated not implemented") -} -func (UnimplementedETHBACKENDServer) EngineGetPayload(context.Context, *EngineGetPayloadRequest) (*EngineGetPayloadResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method EngineGetPayload not implemented") -} -func (UnimplementedETHBACKENDServer) EngineGetPayloadBodiesByHashV1(context.Context, *EngineGetPayloadBodiesByHashV1Request) (*EngineGetPayloadBodiesV1Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method EngineGetPayloadBodiesByHashV1 not implemented") -} -func (UnimplementedETHBACKENDServer) EngineGetPayloadBodiesByRangeV1(context.Context, *EngineGetPayloadBodiesByRangeV1Request) (*EngineGetPayloadBodiesV1Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method EngineGetPayloadBodiesByRangeV1 not implemented") -} func (UnimplementedETHBACKENDServer) Version(context.Context, *emptypb.Empty) (*types.VersionReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") } @@ -406,6 +339,9 @@ func (UnimplementedETHBACKENDServer) AddPeer(context.Context, *AddPeerRequest) ( func (UnimplementedETHBACKENDServer) PendingBlock(context.Context, *emptypb.Empty) (*PendingBlockReply, error) { return nil, status.Errorf(codes.Unimplemented, "method PendingBlock not implemented") } +func (UnimplementedETHBACKENDServer) BorEvent(context.Context, *BorEventRequest) (*BorEventReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BorEvent not implemented") +} func (UnimplementedETHBACKENDServer) mustEmbedUnimplementedETHBACKENDServer() {} // UnsafeETHBACKENDServer may be embedded to opt out of forward compatibility for this service. @@ -473,96 +409,6 @@ func _ETHBACKEND_NetPeerCount_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _ETHBACKEND_EngineNewPayload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(types.ExecutionPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ETHBACKENDServer).EngineNewPayload(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ETHBACKEND_EngineNewPayload_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ETHBACKENDServer).EngineNewPayload(ctx, req.(*types.ExecutionPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _ETHBACKEND_EngineForkChoiceUpdated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EngineForkChoiceUpdatedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ETHBACKENDServer).EngineForkChoiceUpdated(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ETHBACKEND_EngineForkChoiceUpdated_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ETHBACKENDServer).EngineForkChoiceUpdated(ctx, req.(*EngineForkChoiceUpdatedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ETHBACKEND_EngineGetPayload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EngineGetPayloadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ETHBACKENDServer).EngineGetPayload(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ETHBACKEND_EngineGetPayload_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ETHBACKENDServer).EngineGetPayload(ctx, req.(*EngineGetPayloadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ETHBACKEND_EngineGetPayloadBodiesByHashV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EngineGetPayloadBodiesByHashV1Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ETHBACKENDServer).EngineGetPayloadBodiesByHashV1(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ETHBACKEND_EngineGetPayloadBodiesByHashV1_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ETHBACKENDServer).EngineGetPayloadBodiesByHashV1(ctx, req.(*EngineGetPayloadBodiesByHashV1Request)) - } - return interceptor(ctx, in, info, handler) -} - -func _ETHBACKEND_EngineGetPayloadBodiesByRangeV1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EngineGetPayloadBodiesByRangeV1Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ETHBACKENDServer).EngineGetPayloadBodiesByRangeV1(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ETHBACKEND_EngineGetPayloadBodiesByRangeV1_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ETHBACKENDServer).EngineGetPayloadBodiesByRangeV1(ctx, req.(*EngineGetPayloadBodiesByRangeV1Request)) - } - return interceptor(ctx, in, info, handler) -} - func _ETHBACKEND_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { @@ -772,6 +618,24 @@ func _ETHBACKEND_PendingBlock_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ETHBACKEND_BorEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BorEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ETHBACKENDServer).BorEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ETHBACKEND_BorEvent_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ETHBACKENDServer).BorEvent(ctx, req.(*BorEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ETHBACKEND_ServiceDesc is the grpc.ServiceDesc for ETHBACKEND service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -791,26 +655,6 @@ var ETHBACKEND_ServiceDesc = grpc.ServiceDesc{ MethodName: "NetPeerCount", Handler: _ETHBACKEND_NetPeerCount_Handler, }, - { - MethodName: "EngineNewPayload", - Handler: _ETHBACKEND_EngineNewPayload_Handler, - }, - { - MethodName: "EngineForkChoiceUpdated", - Handler: _ETHBACKEND_EngineForkChoiceUpdated_Handler, - }, - { - MethodName: "EngineGetPayload", - Handler: _ETHBACKEND_EngineGetPayload_Handler, - }, - { - MethodName: "EngineGetPayloadBodiesByHashV1", - Handler: _ETHBACKEND_EngineGetPayloadBodiesByHashV1_Handler, - }, - { - MethodName: "EngineGetPayloadBodiesByRangeV1", - Handler: _ETHBACKEND_EngineGetPayloadBodiesByRangeV1_Handler, - }, { MethodName: "Version", Handler: _ETHBACKEND_Version_Handler, @@ -847,6 +691,10 @@ var ETHBACKEND_ServiceDesc = grpc.ServiceDesc{ MethodName: "PendingBlock", Handler: _ETHBACKEND_PendingBlock_Handler, }, + { + MethodName: "BorEvent", + Handler: _ETHBACKEND_BorEvent_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/gointerfaces/types/types.pb.go b/gointerfaces/types/types.pb.go index 21418148a..088bbfb73 100644 --- a/gointerfaces/types/types.pb.go +++ b/gointerfaces/types/types.pb.go @@ -423,7 +423,7 @@ type ExecutionPayload struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // v1 - no withdrawals, v2 - with withdrawals, v3 - with excess data gas + Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // v1 - no withdrawals, v2 - with withdrawals, v3 - with blob gas ParentHash *H256 `protobuf:"bytes,2,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` Coinbase *H160 `protobuf:"bytes,3,opt,name=coinbase,proto3" json:"coinbase,omitempty"` StateRoot *H256 `protobuf:"bytes,4,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` @@ -439,8 +439,8 @@ type ExecutionPayload struct { BlockHash *H256 `protobuf:"bytes,14,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` Transactions [][]byte `protobuf:"bytes,15,rep,name=transactions,proto3" json:"transactions,omitempty"` Withdrawals []*Withdrawal `protobuf:"bytes,16,rep,name=withdrawals,proto3" json:"withdrawals,omitempty"` - DataGasUsed *uint64 `protobuf:"varint,17,opt,name=data_gas_used,json=dataGasUsed,proto3,oneof" json:"data_gas_used,omitempty"` - ExcessDataGas *uint64 `protobuf:"varint,18,opt,name=excess_data_gas,json=excessDataGas,proto3,oneof" json:"excess_data_gas,omitempty"` + BlobGasUsed *uint64 `protobuf:"varint,17,opt,name=blob_gas_used,json=blobGasUsed,proto3,oneof" json:"blob_gas_used,omitempty"` + ExcessBlobGas *uint64 `protobuf:"varint,18,opt,name=excess_blob_gas,json=excessBlobGas,proto3,oneof" json:"excess_blob_gas,omitempty"` } func (x *ExecutionPayload) Reset() { @@ -587,16 +587,16 @@ func (x *ExecutionPayload) GetWithdrawals() []*Withdrawal { return nil } -func (x *ExecutionPayload) GetDataGasUsed() uint64 { - if x != nil && x.DataGasUsed != nil { - return *x.DataGasUsed +func (x *ExecutionPayload) GetBlobGasUsed() uint64 { + if x != nil && x.BlobGasUsed != nil { + return *x.BlobGasUsed } return 0 } -func (x *ExecutionPayload) GetExcessDataGas() uint64 { - if x != nil && x.ExcessDataGas != nil { - return *x.ExcessDataGas +func (x *ExecutionPayload) GetExcessBlobGas() uint64 { + if x != nil && x.ExcessBlobGas != nil { + return *x.ExcessBlobGas } return 0 } @@ -1173,14 +1173,14 @@ var file_types_types_proto_rawDesc = []byte{ 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x27, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x73, 0x12, 0x27, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, - 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x88, 0x01, 0x01, - 0x12, 0x2b, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x88, 0x01, 0x01, + 0x12, 0x2b, 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x78, 0x63, - 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x47, 0x61, 0x73, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, - 0x0e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x42, - 0x12, 0x0a, 0x10, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, + 0x0e, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x42, + 0x12, 0x0a, 0x10, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, diff --git a/kv/Readme.md b/kv/Readme.md index cba4f0538..cf98fc4ba 100644 --- a/kv/Readme.md +++ b/kv/Readme.md @@ -21,7 +21,7 @@ open_cursor/seek/write_data_from_current_position/move_to_end/step_back/step_for // And show which classes satisfy which interfaces. +-----------------------------------+ +-----------------------------------+ -| github.com/torquem-ch/mdbx-go | | google.golang.org/grpc.ClientConn | +| github.com/erigonteh/mdbx-go | | google.golang.org/grpc.ClientConn | | (app-agnostic MDBX go bindings) | | (app-agnostic RPC and streaming) | +-----------------------------------+ +-----------------------------------+ | | diff --git a/kv/bitmapdb/fixed_size.go b/kv/bitmapdb/fixed_size.go index 96e8768c1..97bc501b7 100644 --- a/kv/bitmapdb/fixed_size.go +++ b/kv/bitmapdb/fixed_size.go @@ -80,18 +80,19 @@ func OpenFixedSizeBitmaps(filePath string, bitsPerBitmap int) (*FixedSizeBitmaps func (bm *FixedSizeBitmaps) FileName() string { return bm.fileName } func (bm *FixedSizeBitmaps) FilePath() string { return bm.filePath } -func (bm *FixedSizeBitmaps) Close() error { +func (bm *FixedSizeBitmaps) Close() { if bm.m != nil { if err := bm.m.Unmap(); err != nil { log.Trace("unmap", "err", err, "file", bm.FileName()) } + bm.m = nil } if bm.f != nil { if err := bm.f.Close(); err != nil { - return err + log.Trace("close", "err", err, "file", bm.FileName()) } + bm.f = nil } - return nil } func (bm *FixedSizeBitmaps) At(item uint64) (res []uint64, err error) { @@ -168,11 +169,14 @@ type FixedSizeBitmapsWriter struct { amount uint64 size int bitsPerBitmap uint64 + + logger log.Logger + noFsync bool // fsync is enabled by default, but tests can manually disable } const MetaHeaderSize = 64 -func NewFixedSizeBitmapsWriter(indexFile string, bitsPerBitmap int, amount uint64) (*FixedSizeBitmapsWriter, error) { +func NewFixedSizeBitmapsWriter(indexFile string, bitsPerBitmap int, amount uint64, logger log.Logger) (*FixedSizeBitmapsWriter, error) { pageSize := os.Getpagesize() //TODO: use math.SafeMul() bytesAmount := MetaHeaderSize + (bitsPerBitmap*int(amount))/8 @@ -184,6 +188,7 @@ func NewFixedSizeBitmapsWriter(indexFile string, bitsPerBitmap int, amount uint6 size: size, amount: amount, version: 1, + logger: logger, } _ = os.Remove(idx.tmpIdxFilePath) @@ -215,8 +220,18 @@ func NewFixedSizeBitmapsWriter(indexFile string, bitsPerBitmap int, amount uint6 return idx, nil } func (w *FixedSizeBitmapsWriter) Close() { - _ = w.m.Unmap() - _ = w.f.Close() + if w.m != nil { + if err := w.m.Unmap(); err != nil { + log.Trace("unmap", "err", err, "file", w.f.Name()) + } + w.m = nil + } + if w.f != nil { + if err := w.f.Close(); err != nil { + log.Trace("close", "err", err, "file", w.f.Name()) + } + w.f = nil + } } func growFileToSize(f *os.File, size int) error { pageSize := os.Getpagesize() @@ -267,7 +282,7 @@ func (w *FixedSizeBitmapsWriter) Build() error { if err := w.m.Flush(); err != nil { return err } - if err := w.f.Sync(); err != nil { + if err := w.fsync(); err != nil { return err } @@ -287,3 +302,19 @@ func (w *FixedSizeBitmapsWriter) Build() error { } return nil } + +func (w *FixedSizeBitmapsWriter) DisableFsync() { w.noFsync = true } + +// fsync - other processes/goroutines must see only "fully-complete" (valid) files. No partial-writes. +// To achieve it: write to .tmp file then `rename` when file is ready. +// Machine may power-off right after `rename` - it means `fsync` must be before `rename` +func (w *FixedSizeBitmapsWriter) fsync() error { + if w.noFsync { + return nil + } + if err := w.f.Sync(); err != nil { + w.logger.Warn("couldn't fsync", "err", err, "file", w.tmpIdxFilePath) + return err + } + return nil +} diff --git a/kv/bitmapdb/fixed_size_test.go b/kv/bitmapdb/fixed_size_test.go index ac23a47a1..9f513c583 100644 --- a/kv/bitmapdb/fixed_size_test.go +++ b/kv/bitmapdb/fixed_size_test.go @@ -21,6 +21,7 @@ import ( "path/filepath" "testing" + "github.com/ledgerwatch/log/v3" "github.com/stretchr/testify/require" ) @@ -29,7 +30,7 @@ func TestFixedSizeBitmaps(t *testing.T) { tmpDir, require := t.TempDir(), require.New(t) must := require.NoError idxPath := filepath.Join(tmpDir, "idx.tmp") - wr, err := NewFixedSizeBitmapsWriter(idxPath, 14, 7) + wr, err := NewFixedSizeBitmapsWriter(idxPath, 14, 7, log.New()) require.NoError(err) defer wr.Close() @@ -94,13 +95,13 @@ func TestPageAlined(t *testing.T) { tmpDir, require := t.TempDir(), require.New(t) idxPath := filepath.Join(tmpDir, "idx.tmp") - bm2, err := NewFixedSizeBitmapsWriter(idxPath, 128, 100) + bm2, err := NewFixedSizeBitmapsWriter(idxPath, 128, 100, log.New()) require.NoError(err) require.Equal((128/8*100/os.Getpagesize()+1)*os.Getpagesize(), bm2.size) defer bm2.Close() bm2.Close() - bm3, err := NewFixedSizeBitmapsWriter(idxPath, 128, 1000) + bm3, err := NewFixedSizeBitmapsWriter(idxPath, 128, 1000, log.New()) require.NoError(err) require.Equal((128/8*1000/os.Getpagesize()+1)*os.Getpagesize(), bm3.size) defer bm3.Close() diff --git a/kv/helpers.go b/kv/helpers.go index a1f8d71ee..727a140a1 100644 --- a/kv/helpers.go +++ b/kv/helpers.go @@ -24,8 +24,8 @@ import ( "sync/atomic" "time" + "github.com/erigontech/mdbx-go/mdbx" "github.com/ledgerwatch/erigon-lib/common" - "github.com/torquem-ch/mdbx-go/mdbx" ) func DefaultPageSize() uint64 { diff --git a/kv/kv_interface.go b/kv/kv_interface.go index bd51347cd..d1d4f0de5 100644 --- a/kv/kv_interface.go +++ b/kv/kv_interface.go @@ -82,29 +82,29 @@ const Unlim int = -1 var ( ErrAttemptToDeleteNonDeprecatedBucket = errors.New("only buckets from dbutils.ChaindataDeprecatedTables can be deleted") - DbSize = metrics.NewCounter(`db_size`) //nolint - TxLimit = metrics.NewCounter(`tx_limit`) //nolint - TxSpill = metrics.NewCounter(`tx_spill`) //nolint - TxUnspill = metrics.NewCounter(`tx_unspill`) //nolint - TxDirty = metrics.NewCounter(`tx_dirty`) //nolint - - DbCommitPreparation = metrics.GetOrCreateSummary(`db_commit_seconds{phase="preparation"}`) //nolint - DbGCWallClock = metrics.GetOrCreateSummary(`db_commit_seconds{phase="gc_wall_clock"}`) //nolint - DbGCCpuTime = metrics.GetOrCreateSummary(`db_commit_seconds{phase="gc_cpu_time"}`) //nolint - DbCommitAudit = metrics.GetOrCreateSummary(`db_commit_seconds{phase="audit"}`) //nolint - DbCommitWrite = metrics.GetOrCreateSummary(`db_commit_seconds{phase="write"}`) //nolint - DbCommitSync = metrics.GetOrCreateSummary(`db_commit_seconds{phase="sync"}`) //nolint - DbCommitEnding = metrics.GetOrCreateSummary(`db_commit_seconds{phase="ending"}`) //nolint - DbCommitTotal = metrics.GetOrCreateSummary(`db_commit_seconds{phase="total"}`) //nolint - - DbPgopsNewly = metrics.NewCounter(`db_pgops{phase="newly"}`) //nolint - DbPgopsCow = metrics.NewCounter(`db_pgops{phase="cow"}`) //nolint - DbPgopsClone = metrics.NewCounter(`db_pgops{phase="clone"}`) //nolint - DbPgopsSplit = metrics.NewCounter(`db_pgops{phase="split"}`) //nolint - DbPgopsMerge = metrics.NewCounter(`db_pgops{phase="merge"}`) //nolint - DbPgopsSpill = metrics.NewCounter(`db_pgops{phase="spill"}`) //nolint - DbPgopsUnspill = metrics.NewCounter(`db_pgops{phase="unspill"}`) //nolint - DbPgopsWops = metrics.NewCounter(`db_pgops{phase="wops"}`) //nolint + DbSize = metrics.GetOrCreateCounter(`db_size`) //nolint + TxLimit = metrics.GetOrCreateCounter(`tx_limit`) //nolint + TxSpill = metrics.GetOrCreateCounter(`tx_spill`) //nolint + TxUnspill = metrics.GetOrCreateCounter(`tx_unspill`) //nolint + TxDirty = metrics.GetOrCreateCounter(`tx_dirty`) //nolint + + DbCommitPreparation = metrics.GetOrCreateSummary(`db_commit_seconds{phase="preparation"}`) //nolint + //DbGCWallClock = metrics.GetOrCreateSummary(`db_commit_seconds{phase="gc_wall_clock"}`) //nolint + //DbGCCpuTime = metrics.GetOrCreateSummary(`db_commit_seconds{phase="gc_cpu_time"}`) //nolint + //DbCommitAudit = metrics.GetOrCreateSummary(`db_commit_seconds{phase="audit"}`) //nolint + DbCommitWrite = metrics.GetOrCreateSummary(`db_commit_seconds{phase="write"}`) //nolint + DbCommitSync = metrics.GetOrCreateSummary(`db_commit_seconds{phase="sync"}`) //nolint + DbCommitEnding = metrics.GetOrCreateSummary(`db_commit_seconds{phase="ending"}`) //nolint + DbCommitTotal = metrics.GetOrCreateSummary(`db_commit_seconds{phase="total"}`) //nolint + + DbPgopsNewly = metrics.GetOrCreateCounter(`db_pgops{phase="newly"}`) //nolint + DbPgopsCow = metrics.GetOrCreateCounter(`db_pgops{phase="cow"}`) //nolint + DbPgopsClone = metrics.GetOrCreateCounter(`db_pgops{phase="clone"}`) //nolint + DbPgopsSplit = metrics.GetOrCreateCounter(`db_pgops{phase="split"}`) //nolint + DbPgopsMerge = metrics.GetOrCreateCounter(`db_pgops{phase="merge"}`) //nolint + DbPgopsSpill = metrics.GetOrCreateCounter(`db_pgops{phase="spill"}`) //nolint + DbPgopsUnspill = metrics.GetOrCreateCounter(`db_pgops{phase="unspill"}`) //nolint + DbPgopsWops = metrics.GetOrCreateCounter(`db_pgops{phase="wops"}`) //nolint /* DbPgopsPrefault = metrics.NewCounter(`db_pgops{phase="prefault"}`) //nolint DbPgopsMinicore = metrics.NewCounter(`db_pgops{phase="minicore"}`) //nolint @@ -138,9 +138,9 @@ var ( //DbGcSelfPnlMergeVolume = metrics.NewCounter(`db_gc_pnl{phase="self_merge_volume"}`) //nolint //DbGcSelfPnlMergeCalls = metrics.NewCounter(`db_gc_pnl{phase="slef_merge_calls"}`) //nolint - GcLeafMetric = metrics.NewCounter(`db_gc_leaf`) //nolint - GcOverflowMetric = metrics.NewCounter(`db_gc_overflow`) //nolint - GcPagesMetric = metrics.NewCounter(`db_gc_pages`) //nolint + GcLeafMetric = metrics.GetOrCreateCounter(`db_gc_leaf`) //nolint + GcOverflowMetric = metrics.GetOrCreateCounter(`db_gc_overflow`) //nolint + GcPagesMetric = metrics.GetOrCreateCounter(`db_gc_pages`) //nolint ) diff --git a/kv/mdbx/kv_mdbx.go b/kv/mdbx/kv_mdbx.go index 45eebc919..847f772f2 100644 --- a/kv/mdbx/kv_mdbx.go +++ b/kv/mdbx/kv_mdbx.go @@ -30,6 +30,7 @@ import ( "time" "github.com/c2h5oh/datasize" + "github.com/erigontech/mdbx-go/mdbx" stack2 "github.com/go-stack/stack" "github.com/ledgerwatch/erigon-lib/common/dbg" "github.com/ledgerwatch/erigon-lib/kv" @@ -37,7 +38,6 @@ import ( "github.com/ledgerwatch/erigon-lib/kv/order" "github.com/ledgerwatch/log/v3" "github.com/pbnjay/memory" - "github.com/torquem-ch/mdbx-go/mdbx" "golang.org/x/exp/maps" "golang.org/x/sync/semaphore" ) @@ -85,6 +85,7 @@ func NewMDBX(log log.Logger) MdbxOpts { growthStep: 2 * datasize.GB, mergeThreshold: 3 * 8192, shrinkThreshold: -1, // default + label: kv.InMem, } return opts } @@ -803,7 +804,7 @@ func (tx *MdbxTx) Commit() error { if tx.db.opts.label == kv.ChainDB { kv.DbCommitPreparation.Update(latency.Preparation.Seconds()) - kv.DbCommitAudit.Update(latency.Audit.Seconds()) + //kv.DbCommitAudit.Update(latency.Audit.Seconds()) kv.DbCommitWrite.Update(latency.Write.Seconds()) kv.DbCommitSync.Update(latency.Sync.Seconds()) kv.DbCommitEnding.Update(latency.Ending.Seconds()) diff --git a/kv/mdbx/kv_mdbx_temporary.go b/kv/mdbx/kv_mdbx_temporary.go index faf6baed3..f6723b85c 100644 --- a/kv/mdbx/kv_mdbx_temporary.go +++ b/kv/mdbx/kv_mdbx_temporary.go @@ -29,8 +29,8 @@ type TemporaryMdbx struct { path string } -func NewTemporaryMdbx() (kv.RwDB, error) { - path, err := os.MkdirTemp("", "mdbx-temp") +func NewTemporaryMdbx(tempdir string) (kv.RwDB, error) { + path, err := os.MkdirTemp(tempdir, "mdbx-temp") if err != nil { return &TemporaryMdbx{}, err } diff --git a/kv/mdbx/util.go b/kv/mdbx/util.go index c6daf23a1..ca16ee273 100644 --- a/kv/mdbx/util.go +++ b/kv/mdbx/util.go @@ -17,9 +17,9 @@ package mdbx import ( + mdbxbind "github.com/erigontech/mdbx-go/mdbx" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/log/v3" - mdbxbind "github.com/torquem-ch/mdbx-go/mdbx" ) func MustOpen(path string) kv.RwDB { diff --git a/kv/memdb/memory_mutation.go b/kv/memdb/memory_mutation.go index 4706a8c0a..bca696ddc 100644 --- a/kv/memdb/memory_mutation.go +++ b/kv/memdb/memory_mutation.go @@ -17,6 +17,7 @@ import ( "bytes" "context" + "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv/iter" "github.com/ledgerwatch/erigon-lib/kv/order" "github.com/ledgerwatch/log/v3" @@ -61,6 +62,16 @@ func NewMemoryBatch(tx kv.Tx, tmpDir string) *MemoryMutation { } } +func NewMemoryBatchWithCustomDB(tx kv.Tx, db kv.RwDB, uTx kv.RwTx, tmpDir string) *MemoryMutation { + return &MemoryMutation{ + db: tx, + memDb: db, + memTx: uTx, + deletedEntries: make(map[string]map[string]struct{}), + clearedTables: make(map[string]struct{}), + } +} + func (m *MemoryMutation) UpdateTxn(tx kv.Tx) { m.db = tx m.statelessCursors = nil @@ -368,6 +379,72 @@ func (m *MemoryMutation) Flush(tx kv.RwTx) error { return nil } +func (m *MemoryMutation) Diff() (*MemoryDiff, error) { + memDiff := &MemoryDiff{ + diff: make(map[table][]entry), + deletedEntries: make(map[string][]string), + } + // Obtain buckets touched. + buckets, err := m.memTx.ListBuckets() + if err != nil { + return nil, err + } + // Obliterate buckets who are to be deleted + for bucket := range m.clearedTables { + memDiff.clearedTableNames = append(memDiff.clearedTableNames, bucket) + } + // Obliterate entries who are to be deleted + for bucket, keys := range m.deletedEntries { + for key := range keys { + memDiff.deletedEntries[bucket] = append(memDiff.deletedEntries[bucket], key) + } + } + // Iterate over each bucket and apply changes accordingly. + for _, bucket := range buckets { + if isTablePurelyDupsort(bucket) { + cbucket, err := m.memTx.CursorDupSort(bucket) + if err != nil { + return nil, err + } + defer cbucket.Close() + + t := table{ + name: bucket, + dupsort: true, + } + for k, v, err := cbucket.First(); k != nil; k, v, err = cbucket.Next() { + if err != nil { + return nil, err + } + memDiff.diff[t] = append(memDiff.diff[t], entry{ + k: common.Copy(k), + v: common.Copy(v), + }) + } + } else { + cbucket, err := m.memTx.Cursor(bucket) + if err != nil { + return nil, err + } + defer cbucket.Close() + t := table{ + name: bucket, + dupsort: false, + } + for k, v, err := cbucket.First(); k != nil; k, v, err = cbucket.Next() { + if err != nil { + return nil, err + } + memDiff.diff[t] = append(memDiff.diff[t], entry{ + k: common.Copy(k), + v: common.Copy(v), + }) + } + } + } + return memDiff, nil +} + // Check if a bucket is dupsorted and has dupsort conversion off func isTablePurelyDupsort(bucket string) bool { config, ok := kv.ChaindataTablesCfg[bucket] @@ -378,6 +455,14 @@ func isTablePurelyDupsort(bucket string) bool { return !config.AutoDupSortKeysConversion && config.Flags == kv.DupSort } +func (m *MemoryMutation) MemDB() kv.RwDB { + return m.memDb +} + +func (m *MemoryMutation) MemTx() kv.RwTx { + return m.memTx +} + // Cursor creates a new cursor (the real fun begins here) func (m *MemoryMutation) makeCursor(bucket string) (kv.RwCursorDupSort, error) { c := &memoryMutationCursor{} diff --git a/kv/memdb/memory_mutation_cursor.go b/kv/memdb/memory_mutation_cursor.go index a4da2819e..792bfe34b 100644 --- a/kv/memdb/memory_mutation_cursor.go +++ b/kv/memdb/memory_mutation_cursor.go @@ -339,7 +339,7 @@ func (m *memoryMutationCursor) Delete(k []byte) error { func (m *memoryMutationCursor) DeleteCurrent() error { panic("DeleteCurrent Not implemented") } -func (m *memoryMutationCursor) DeleteExact(k1, k2 []byte) error { +func (m *memoryMutationCursor) DeleteExact(_, _ []byte) error { panic("DeleteExact Not implemented") } diff --git a/kv/memdb/memory_mutation_diff.go b/kv/memdb/memory_mutation_diff.go new file mode 100644 index 000000000..7f58b8a1d --- /dev/null +++ b/kv/memdb/memory_mutation_diff.go @@ -0,0 +1,58 @@ +package memdb + +import "github.com/ledgerwatch/erigon-lib/kv" + +type entry struct { + k []byte + v []byte +} + +type MemoryDiff struct { + diff map[table][]entry // god. + deletedEntries map[string][]string + clearedTableNames []string +} + +type table struct { + name string + dupsort bool +} + +func (m *MemoryDiff) Flush(tx kv.RwTx) error { + // Obliterate buckets who are to be deleted + for _, bucket := range m.clearedTableNames { + if err := tx.ClearBucket(bucket); err != nil { + return err + } + } + // Obliterate entries who are to be deleted + for bucket, keys := range m.deletedEntries { + for _, key := range keys { + if err := tx.Delete(bucket, []byte(key)); err != nil { + return err + } + } + } + // Iterate over each bucket and apply changes accordingly. + for bucketInfo, bucketDiff := range m.diff { + if bucketInfo.dupsort { + dbCursor, err := tx.RwCursorDupSort(bucketInfo.name) + if err != nil { + return err + } + defer dbCursor.Close() + for _, entry := range bucketDiff { + if err := dbCursor.Put(entry.k, entry.v); err != nil { + return err + } + } + } else { + for _, entry := range bucketDiff { + if err := tx.Put(bucketInfo.name, entry.k, entry.v); err != nil { + return err + } + } + } + } + return nil +} diff --git a/kv/tables.go b/kv/tables.go index 652950dae..19d8e1f4a 100644 --- a/kv/tables.go +++ b/kv/tables.go @@ -357,9 +357,12 @@ const ( // BOR - BorReceipts = "BorReceipt" - BorTxLookup = "BlockBorTransactionLookup" // transaction_hash -> block_num_u64 - BorSeparate = "BorSeparate" + BorReceipts = "BorReceipt" + BorTxLookup = "BlockBorTransactionLookup" // transaction_hash -> block_num_u64 + BorSeparate = "BorSeparate" // persisted snapshots of the Validator Sets, with their proposer priorities + BorEvents = "BorEvents" // event_id -> event_payload + BorEventNums = "BorEventNums" // block_num -> event_id (first event_id in that block) + BorSpans = "BorSpans" // span_id -> span (in JSON encoding) // Downloader BittorrentCompletion = "BittorrentCompletion" @@ -530,6 +533,9 @@ var ChaindataTables = []string{ BorReceipts, BorTxLookup, BorSeparate, + BorEvents, + BorEventNums, + BorSpans, TblAccountKeys, TblAccountVals, TblAccountHistoryKeys, diff --git a/kv/temporal/historyv2/changeset.go b/kv/temporal/historyv2/changeset.go index 3fb716ec7..4ca0eeade 100644 --- a/kv/temporal/historyv2/changeset.go +++ b/kv/temporal/historyv2/changeset.go @@ -187,7 +187,9 @@ func Truncate(tx kv.RwTx, from uint64) error { if err != nil { return err } - err = c.DeleteCurrentDuplicates() + if err = tx.Delete(kv.AccountChangeSet, k); err != nil { + return err + } if err != nil { return err } @@ -203,8 +205,7 @@ func Truncate(tx kv.RwTx, from uint64) error { if err != nil { return err } - err = c.DeleteCurrentDuplicates() - if err != nil { + if err = tx.Delete(kv.StorageChangeSet, k); err != nil { return err } } diff --git a/pedersen_hash/LICENSE b/pedersen_hash/LICENSE new file mode 100644 index 000000000..b037585c1 --- /dev/null +++ b/pedersen_hash/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 StarkWare Industries Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/pedersen_hash/README.md b/pedersen_hash/README.md new file mode 100644 index 000000000..e33ed8286 --- /dev/null +++ b/pedersen_hash/README.md @@ -0,0 +1,2 @@ +This code comes from StarkWare crypto-cpp library: +https://github.com/starkware-libs/crypto-cpp/blob/master/src/starkware/crypto/pedersen_hash.h diff --git a/recsplit/index.go b/recsplit/index.go index 5942fbb5d..d1765a7d3 100644 --- a/recsplit/index.go +++ b/recsplit/index.go @@ -28,6 +28,7 @@ import ( "time" "unsafe" + "github.com/ledgerwatch/erigon-lib/common/dbg" "github.com/ledgerwatch/log/v3" "github.com/ledgerwatch/erigon-lib/common" @@ -174,17 +175,19 @@ func (idx *Index) BaseDataID() uint64 { return idx.baseDataID } func (idx *Index) FilePath() string { return idx.filePath } func (idx *Index) FileName() string { return idx.fileName } -func (idx *Index) Close() error { +func (idx *Index) Close() { if idx == nil { - return nil - } - if err := mmap.Munmap(idx.mmapHandle1, idx.mmapHandle2); err != nil { - log.Trace("unmap", "err", err, "file", idx.FileName()) + return } - if err := idx.f.Close(); err != nil { - return err + if idx.f != nil { + if err := mmap.Munmap(idx.mmapHandle1, idx.mmapHandle2); err != nil { + log.Log(dbg.FileCloseLogLevel, "unmap", "err", err, "file", idx.FileName(), "stack", dbg.Stack()) + } + if err := idx.f.Close(); err != nil { + log.Log(dbg.FileCloseLogLevel, "close", "err", err, "file", idx.FileName(), "stack", dbg.Stack()) + } + idx.f = nil } - return nil } func (idx *Index) skipBits(m uint16) int { diff --git a/recsplit/index_test.go b/recsplit/index_test.go index af5695732..849cdb710 100644 --- a/recsplit/index_test.go +++ b/recsplit/index_test.go @@ -18,6 +18,7 @@ package recsplit import ( "bufio" + "context" "fmt" "os" "path/filepath" @@ -47,7 +48,7 @@ func TestReWriteIndex(t *testing.T) { t.Fatal(err) } } - if err := rs.Build(); err != nil { + if err := rs.Build(context.Background()); err != nil { t.Fatal(err) } idx := MustOpen(indexFile) diff --git a/recsplit/recsplit.go b/recsplit/recsplit.go index 0129bc633..a019ca9b3 100644 --- a/recsplit/recsplit.go +++ b/recsplit/recsplit.go @@ -18,6 +18,7 @@ package recsplit import ( "bufio" + "context" "crypto/rand" "encoding/binary" "fmt" @@ -63,14 +64,16 @@ func remix(z uint64) uint64 { // Recsplit: Minimal perfect hashing via recursive splitting. In 2020 Proceedings of the Symposium on Algorithm Engineering and Experiments (ALENEX), // pages 175−185. SIAM, 2020. type RecSplit struct { - hasher murmur3.Hash128 // Salted hash function to use for splitting into initial buckets and mapping to 64-bit fingerprints - offsetCollector *etl.Collector // Collector that sorts by offsets - indexW *bufio.Writer - indexF *os.File - offsetEf *eliasfano32.EliasFano // Elias Fano instance for encoding the offsets - bucketCollector *etl.Collector // Collector that sorts by buckets - indexFileName string - indexFile string + hasher murmur3.Hash128 // Salted hash function to use for splitting into initial buckets and mapping to 64-bit fingerprints + offsetCollector *etl.Collector // Collector that sorts by offsets + indexW *bufio.Writer + indexF *os.File + offsetEf *eliasfano32.EliasFano // Elias Fano instance for encoding the offsets + bucketCollector *etl.Collector // Collector that sorts by buckets + + indexFileName string + indexFile, tmpFilePath string + tmpDir string gr GolombRice // Helper object to encode the tree of hash function salts using Golomb-Rice code. bucketPosAcc []uint64 // Accumulator for position of every bucket in the encoding of the hash function @@ -108,6 +111,8 @@ type RecSplit struct { built bool // Flag indicating that the hash function has been built and no more keys can be added trace bool logger log.Logger + + noFsync bool // fsync is enabled by default, but tests can manually disable } type RecSplitArgs struct { @@ -150,6 +155,7 @@ func NewRecSplit(args RecSplitArgs, logger log.Logger) (*RecSplit, error) { rs.hasher = murmur3.New128WithSeed(rs.salt) rs.tmpDir = args.TmpDir rs.indexFile = args.IndexFile + rs.tmpFilePath = args.IndexFile + ".tmp" _, fname := filepath.Split(rs.indexFile) rs.indexFileName = fname rs.baseDataID = args.BaseDataID @@ -350,6 +356,16 @@ func (rs *RecSplit) AddKey(key []byte, offset uint64) error { return nil } +func (rs *RecSplit) AddOffset(offset uint64) error { + if rs.enums { + binary.BigEndian.PutUint64(rs.numBuf[:], offset) + if err := rs.offsetCollector.Collect(rs.numBuf[:], nil); err != nil { + return err + } + } + return nil +} + func (rs *RecSplit) recsplitCurrentBucket() error { // Extend rs.bucketSizeAcc to accomodate current bucket index + 1 for len(rs.bucketSizeAcc) <= int(rs.currentBucketIdx)+1 { @@ -529,9 +545,7 @@ func (rs *RecSplit) loadFuncOffset(k, _ []byte, _ etl.CurrentTableReader, _ etl. // Build has to be called after all the keys have been added, and it initiates the process // of building the perfect hash function and writing index into a file -func (rs *RecSplit) Build() error { - tmpIdxFilePath := rs.indexFile + ".tmp" - +func (rs *RecSplit) Build(ctx context.Context) error { if rs.built { return fmt.Errorf("already built") } @@ -539,13 +553,11 @@ func (rs *RecSplit) Build() error { return fmt.Errorf("expected keys %d, got %d", rs.keyExpectedCount, rs.keysAdded) } var err error - if rs.indexF, err = os.Create(tmpIdxFilePath); err != nil { + if rs.indexF, err = os.Create(rs.tmpFilePath); err != nil { return fmt.Errorf("create index file %s: %w", rs.indexFile, err) } - defer rs.indexF.Sync() defer rs.indexF.Close() rs.indexW = bufio.NewWriterSize(rs.indexF, etl.BufIOSize) - defer rs.indexW.Flush() // Write minimal app-specific dataID in this index file binary.BigEndian.PutUint64(rs.numBuf[:], rs.baseDataID) if _, err = rs.indexW.Write(rs.numBuf[:]); err != nil { @@ -568,7 +580,7 @@ func (rs *RecSplit) Build() error { if rs.lvl < log.LvlTrace { log.Log(rs.lvl, "[index] calculating", "file", rs.indexFileName) } - if err := rs.bucketCollector.Load(nil, "", rs.loadFuncBucket, etl.TransformArgs{}); err != nil { + if err := rs.bucketCollector.Load(nil, "", rs.loadFuncBucket, etl.TransformArgs{Quit: ctx.Done()}); err != nil { return err } if len(rs.currentBucket) > 0 { @@ -659,10 +671,34 @@ func (rs *RecSplit) Build() error { return fmt.Errorf("writing elias fano: %w", err) } - _ = rs.indexW.Flush() - _ = rs.indexF.Sync() - _ = rs.indexF.Close() - _ = os.Rename(tmpIdxFilePath, rs.indexFile) + if err = rs.indexW.Flush(); err != nil { + return err + } + if err = rs.fsync(); err != nil { + return err + } + if err = rs.indexF.Close(); err != nil { + return err + } + if err = os.Rename(rs.tmpFilePath, rs.indexFile); err != nil { + return err + } + return nil +} + +func (rs *RecSplit) DisableFsync() { rs.noFsync = true } + +// Fsync - other processes/goroutines must see only "fully-complete" (valid) files. No partial-writes. +// To achieve it: write to .tmp file then `rename` when file is ready. +// Machine may power-off right after `rename` - it means `fsync` must be before `rename` +func (rs *RecSplit) fsync() error { + if rs.noFsync { + return nil + } + if err := rs.indexF.Sync(); err != nil { + rs.logger.Warn("couldn't fsync", "err", err, "file", rs.tmpFilePath) + return err + } return nil } diff --git a/recsplit/recsplit_fuzz_test.go b/recsplit/recsplit_fuzz_test.go index 9073287da..ef2f58b9d 100644 --- a/recsplit/recsplit_fuzz_test.go +++ b/recsplit/recsplit_fuzz_test.go @@ -18,6 +18,7 @@ limitations under the License. package recsplit import ( + "context" "path/filepath" "testing" @@ -73,7 +74,7 @@ func FuzzRecSplit(f *testing.F) { if err := rs.AddKey(in[i:], off); err != nil { t.Fatal(err) } - if err = rs.Build(); err != nil { + if err = rs.Build(context.Background()); err != nil { t.Fatal(err) } // Check that there is a bijection diff --git a/recsplit/recsplit_test.go b/recsplit/recsplit_test.go index d4a50854d..ab4f818eb 100644 --- a/recsplit/recsplit_test.go +++ b/recsplit/recsplit_test.go @@ -17,6 +17,7 @@ package recsplit import ( + "context" "fmt" "path/filepath" "testing" @@ -41,16 +42,16 @@ func TestRecSplit2(t *testing.T) { if err = rs.AddKey([]byte("first_key"), 0); err != nil { t.Error(err) } - if err = rs.Build(); err == nil { + if err = rs.Build(context.Background()); err == nil { t.Errorf("test is expected to fail, too few keys added") } if err = rs.AddKey([]byte("second_key"), 0); err != nil { t.Error(err) } - if err = rs.Build(); err != nil { + if err = rs.Build(context.Background()); err != nil { t.Error(err) } - if err = rs.Build(); err == nil { + if err = rs.Build(context.Background()); err == nil { t.Errorf("test is expected to fail, hash gunction was built already") } if err = rs.AddKey([]byte("key_to_fail"), 0); err == nil { @@ -78,7 +79,7 @@ func TestRecSplitDuplicate(t *testing.T) { if err := rs.AddKey([]byte("first_key"), 0); err != nil { t.Error(err) } - if err := rs.Build(); err == nil { + if err := rs.Build(context.Background()); err == nil { t.Errorf("test is expected to fail, duplicate key") } } @@ -119,7 +120,7 @@ func TestIndexLookup(t *testing.T) { t.Fatal(err) } } - if err := rs.Build(); err != nil { + if err := rs.Build(context.Background()); err != nil { t.Fatal(err) } idx := MustOpen(indexFile) @@ -154,7 +155,7 @@ func TestTwoLayerIndex(t *testing.T) { t.Fatal(err) } } - if err := rs.Build(); err != nil { + if err := rs.Build(context.Background()); err != nil { t.Fatal(err) } diff --git a/sais/README.md b/sais/README.md new file mode 100644 index 000000000..60b215356 --- /dev/null +++ b/sais/README.md @@ -0,0 +1,2 @@ +sais C code is a fork of sais-lite-LCP by Johannes Fischer: +https://github.com/elventear/sais-lite-lcp diff --git a/sais/gsa/LICENSE b/sais/gsa/LICENSE new file mode 100644 index 000000000..6bce52f17 --- /dev/null +++ b/sais/gsa/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Felipe A. Louza, Simon Gog, Guilherme P. Telles + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sais/gsa/README.md b/sais/gsa/README.md new file mode 100644 index 000000000..ec6eb0b3f --- /dev/null +++ b/sais/gsa/README.md @@ -0,0 +1,2 @@ +gsacak C code is a fork of gsa-is: +https://github.com/felipelouza/gsa-is diff --git a/state/aggregator_test.go b/state/aggregator_test.go index ff510c9e6..9fc43fb3a 100644 --- a/state/aggregator_test.go +++ b/state/aggregator_test.go @@ -606,7 +606,7 @@ func generateCompressedKV(tb testing.TB, tmp string, keySize, valueSize, keyCoun keys, _ := getter.Next(key[:0]) err = iw.AddKey(keys[:], pos) - pos = getter.Skip() + pos, _ = getter.Skip() require.NoError(tb, err) } decomp.Close() @@ -620,7 +620,6 @@ func generateCompressedKV(tb testing.TB, tmp string, keySize, valueSize, keyCoun func Test_InitBtreeIndex(t *testing.T) { logger := log.New() tmp := t.TempDir() - defer os.RemoveAll(tmp) keyCount, M := 100, uint64(4) compPath := generateCompressedKV(t, tmp, 52, 300, keyCount, logger) @@ -628,7 +627,7 @@ func Test_InitBtreeIndex(t *testing.T) { require.NoError(t, err) defer decomp.Close() - err = BuildBtreeIndexWithDecompressor(tmp+".bt", decomp, &background.Progress{}, logger) + err = BuildBtreeIndexWithDecompressor(tmp+".bt", decomp, &background.Progress{}, tmp, logger) require.NoError(t, err) bt, err := OpenBtreeIndexWithDecompressor(tmp+".bt", M, decomp) diff --git a/state/aggregator_v3.go b/state/aggregator_v3.go index 373dbdad9..371f5a607 100644 --- a/state/aggregator_v3.go +++ b/state/aggregator_v3.go @@ -816,6 +816,18 @@ func (a *AggregatorV3) PruneWithTiemout(ctx context.Context, timeout time.Durati return nil } +func (a *AggregatorV3) StepsRangeInDBAsStr(tx kv.Tx) string { + return strings.Join([]string{ + a.accounts.stepsRangeInDBAsStr(tx), + a.storage.stepsRangeInDBAsStr(tx), + a.code.stepsRangeInDBAsStr(tx), + a.logAddrs.stepsRangeInDBAsStr(tx), + a.logTopics.stepsRangeInDBAsStr(tx), + a.tracesFrom.stepsRangeInDBAsStr(tx), + a.tracesTo.stepsRangeInDBAsStr(tx), + }, ", ") +} + func (a *AggregatorV3) Prune(ctx context.Context, limit uint64) error { //if limit/a.aggregationStep > StepsInBiggestFile { // ctx, cancel := context.WithCancel(ctx) diff --git a/state/btree_index.go b/state/btree_index.go index 7ddcaaee3..00d2b9e13 100644 --- a/state/btree_index.go +++ b/state/btree_index.go @@ -5,6 +5,7 @@ import ( "bytes" "context" "encoding/binary" + "errors" "fmt" "math" "math/bits" @@ -14,14 +15,16 @@ import ( "time" "github.com/c2h5oh/datasize" - "github.com/ledgerwatch/erigon-lib/common/background" + "github.com/edsrzf/mmap-go" + "github.com/ledgerwatch/erigon-lib/common/dbg" "github.com/ledgerwatch/log/v3" + "github.com/ledgerwatch/erigon-lib/common/background" + "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/common/length" "github.com/ledgerwatch/erigon-lib/compress" "github.com/ledgerwatch/erigon-lib/etl" - "github.com/ledgerwatch/erigon-lib/mmap" ) func logBase(n, base uint64) uint64 { @@ -36,17 +39,19 @@ func min64(a, b uint64) uint64 { } type markupCursor struct { - l, p, di, si uint64 - //l - level - //p - pos inside level - //si - current, actual son index - //di - data array index + l uint64 //l - level + p uint64 //p - pos inside level + di uint64 //di - data array index + si uint64 //si - current, actual son index } type node struct { - p, d, s, fc uint64 - key []byte - val []byte + p uint64 // pos inside level + d uint64 + s uint64 // sons pos inside level + fc uint64 + key []byte + val []byte } type Cursor struct { @@ -416,6 +421,9 @@ func (a *btAlloc) bsKey(x []byte, l, r uint64) (*Cursor, error) { cmp := bytes.Compare(mk, x) switch { case err != nil: + if errors.Is(err, ErrBtIndexLookupBounds) { + return nil, nil + } return nil, err case cmp == 0: return a.newCursor(context.TODO(), mk, value, di), nil @@ -430,24 +438,26 @@ func (a *btAlloc) bsKey(x []byte, l, r uint64) (*Cursor, error) { } k, v, err := a.dataLookup(l) if err != nil { - return nil, fmt.Errorf("key >= %x was not found at pos %d", x, l) + if errors.Is(err, ErrBtIndexLookupBounds) { + return nil, nil + } + return nil, fmt.Errorf("key >= %x was not found. %w", x, err) } return a.newCursor(context.TODO(), k, v, l), nil } func (a *btAlloc) bsNode(i, l, r uint64, x []byte) (n node, lm int64, rm int64) { - n, lm, rm = node{}, -1, -1 + lm, rm = -1, -1 + var m uint64 for l < r { - m := (l + r) >> 1 + m = (l + r) >> 1 - n = a.nodes[i][m] a.naccess++ - - cmp := bytes.Compare(n.key, x) + cmp := bytes.Compare(a.nodes[i][m].key, x) switch { case cmp == 0: - return n, int64(m), int64(m) + return a.nodes[i][m], int64(m), int64(m) case cmp > 0: r = m rm = int64(m) @@ -458,13 +468,13 @@ func (a *btAlloc) bsNode(i, l, r uint64, x []byte) (n node, lm int64, rm int64) panic(fmt.Errorf("compare error %d, %x ? %x", cmp, n.key, x)) } } - return n, lm, rm + return a.nodes[i][m], lm, rm } // find position of key with node.di <= d at level lvl func (a *btAlloc) seekLeast(lvl, d uint64) uint64 { - for i, node := range a.nodes[lvl] { - if node.d >= d { + for i := range a.nodes[lvl] { + if a.nodes[lvl][i].d >= d { return uint64(i) } } @@ -494,7 +504,7 @@ func (a *btAlloc) Seek(ik []byte) (*Cursor, error) { if a.trace { fmt.Printf("found nil key %x pos_range[%d-%d] naccess_ram=%d\n", l, lm, rm, a.naccess) } - panic(fmt.Errorf("bt index nil node at level %d", l)) + return nil, fmt.Errorf("bt index nil node at level %d", l) } switch bytes.Compare(ln.key, ik) { @@ -509,7 +519,7 @@ func (a *btAlloc) Seek(ik []byte) (*Cursor, error) { return a.newCursor(context.TODO(), common.Copy(ln.key), common.Copy(ln.val), ln.d), nil } - if rm-lm == 1 { + if rm-lm >= 1 { break } if lm >= 0 { @@ -631,14 +641,17 @@ type BtIndexWriter struct { indexW *bufio.Writer indexF *os.File bucketCollector *etl.Collector // Collector that sorts by buckets - indexFileName string - indexFile string - tmpDir string - numBuf [8]byte - keyCount uint64 - etlBufLimit datasize.ByteSize - bytesPerRec int - logger log.Logger + + indexFileName string + indexFile, tmpFilePath string + + tmpDir string + numBuf [8]byte + keyCount uint64 + etlBufLimit datasize.ByteSize + bytesPerRec int + logger log.Logger + noFsync bool // fsync is enabled by default, but tests can manually disable } type BtIndexWriterArgs struct { @@ -658,6 +671,7 @@ func NewBtIndexWriter(args BtIndexWriterArgs, logger log.Logger) (*BtIndexWriter btw := &BtIndexWriter{lvl: log.LvlDebug, logger: logger} btw.tmpDir = args.TmpDir btw.indexFile = args.IndexFile + btw.tmpFilePath = args.IndexFile + ".tmp" _, fname := filepath.Split(btw.indexFile) btw.indexFileName = fname @@ -697,8 +711,6 @@ func (btw *BtIndexWriter) loadFuncBucket(k, v []byte, _ etl.CurrentTableReader, // Build has to be called after all the keys have been added, and it initiates the process // of building the perfect hash function and writing index into a file func (btw *BtIndexWriter) Build() error { - tmpIdxFilePath := btw.indexFile + ".tmp" - if btw.built { return fmt.Errorf("already built") } @@ -706,13 +718,11 @@ func (btw *BtIndexWriter) Build() error { // return fmt.Errorf("expected keys %d, got %d", btw.keyCount, btw.keysAdded) //} var err error - if btw.indexF, err = os.Create(tmpIdxFilePath); err != nil { + if btw.indexF, err = os.Create(btw.tmpFilePath); err != nil { return fmt.Errorf("create index file %s: %w", btw.indexFile, err) } - defer btw.indexF.Sync() defer btw.indexF.Close() btw.indexW = bufio.NewWriterSize(btw.indexF, etl.BufIOSize) - defer btw.indexW.Flush() // Write number of keys binary.BigEndian.PutUint64(btw.numBuf[:], btw.keyCount) @@ -734,10 +744,34 @@ func (btw *BtIndexWriter) Build() error { btw.logger.Log(btw.lvl, "[index] write", "file", btw.indexFileName) btw.built = true - _ = btw.indexW.Flush() - _ = btw.indexF.Sync() - _ = btw.indexF.Close() - _ = os.Rename(tmpIdxFilePath, btw.indexFile) + if err = btw.indexW.Flush(); err != nil { + return err + } + if err = btw.fsync(); err != nil { + return err + } + if err = btw.indexF.Close(); err != nil { + return err + } + if err = os.Rename(btw.tmpFilePath, btw.indexFile); err != nil { + return err + } + return nil +} + +func (btw *BtIndexWriter) DisableFsync() { btw.noFsync = true } + +// fsync - other processes/goroutines must see only "fully-complete" (valid) files. No partial-writes. +// To achieve it: write to .tmp file then `rename` when file is ready. +// Machine may power-off right after `rename` - it means `fsync` must be before `rename` +func (btw *BtIndexWriter) fsync() error { + if btw.noFsync { + return nil + } + if err := btw.indexF.Sync(); err != nil { + btw.logger.Warn("couldn't fsync", "err", err, "file", btw.tmpFilePath) + return err + } return nil } @@ -779,8 +813,7 @@ func (btw *BtIndexWriter) AddKey(key []byte, offset uint64) error { type BtIndex struct { alloc *btAlloc - mmapWin *[mmap.MaxMapSize]byte - mmapUnix []byte + m mmap.MMap data []byte file *os.File size int64 @@ -804,18 +837,20 @@ func CreateBtreeIndex(indexPath, dataPath string, M uint64, logger log.Logger) ( var DefaultBtreeM = uint64(2048) -func CreateBtreeIndexWithDecompressor(indexPath string, M uint64, decompressor *compress.Decompressor, p *background.Progress, logger log.Logger) (*BtIndex, error) { - err := BuildBtreeIndexWithDecompressor(indexPath, decompressor, p, logger) +func CreateBtreeIndexWithDecompressor(indexPath string, M uint64, decompressor *compress.Decompressor, p *background.Progress, tmpdir string, logger log.Logger) (*BtIndex, error) { + err := BuildBtreeIndexWithDecompressor(indexPath, decompressor, p, tmpdir, logger) if err != nil { return nil, err } return OpenBtreeIndexWithDecompressor(indexPath, M, decompressor) } -func BuildBtreeIndexWithDecompressor(indexPath string, kv *compress.Decompressor, p *background.Progress, logger log.Logger) error { +func BuildBtreeIndexWithDecompressor(indexPath string, kv *compress.Decompressor, p *background.Progress, tmpdir string, logger log.Logger) error { + defer kv.EnableReadAhead().DisableReadAhead() + args := BtIndexWriterArgs{ IndexFile: indexPath, - TmpDir: filepath.Dir(indexPath), + TmpDir: tmpdir, } iw, err := NewBtIndexWriter(args, logger) @@ -829,17 +864,17 @@ func BuildBtreeIndexWithDecompressor(indexPath string, kv *compress.Decompressor key := make([]byte, 0, 64) ks := make(map[int]int) - var pos uint64 + var pos, kp uint64 emptys := 0 for getter.HasNext() { p.Processed.Add(1) - key, kp := getter.Next(key[:0]) + key, kp = getter.Next(key[:0]) err = iw.AddKey(key, pos) if err != nil { return err } - pos = getter.Skip() + pos, _ = getter.Skip() if pos-kp == 1 { ks[len(key)]++ emptys++ @@ -860,6 +895,9 @@ func BuildBtreeIndex(dataPath, indexPath string, logger log.Logger) error { if err != nil { return err } + defer decomp.Close() + + defer decomp.EnableReadAhead().DisableReadAhead() args := BtIndexWriterArgs{ IndexFile: indexPath, @@ -870,6 +908,7 @@ func BuildBtreeIndex(dataPath, indexPath string, logger log.Logger) error { if err != nil { return err } + defer iw.Close() getter := decomp.MakeGetter() getter.Reset(0) @@ -878,13 +917,13 @@ func BuildBtreeIndex(dataPath, indexPath string, logger log.Logger) error { var pos uint64 for getter.HasNext() { - key, _ := getter.Next(key[:0]) + key, _ = getter.Next(key[:0]) err = iw.AddKey(key, pos) if err != nil { return err } - pos = getter.Skip() + pos, _ = getter.Skip() } decomp.Close() @@ -913,10 +952,11 @@ func OpenBtreeIndexWithDecompressor(indexPath string, M uint64, kv *compress.Dec return nil, err } - if idx.mmapUnix, idx.mmapWin, err = mmap.Mmap(idx.file, int(idx.size)); err != nil { + idx.m, err = mmap.MapRegion(idx.file, int(idx.size), mmap.RDONLY, 0, 0) + if err != nil { return nil, err } - idx.data = idx.mmapUnix[:idx.size] + idx.data = idx.m[:idx.size] // Read number of keys and bytes per record pos := 8 @@ -932,11 +972,14 @@ func OpenBtreeIndexWithDecompressor(indexPath string, M uint64, kv *compress.Dec idx.getter = kv.MakeGetter() - idx.alloc = newBtAlloc(idx.keyCount, M, false) - idx.alloc.dataLookup = idx.dataLookup idx.dataoffset = uint64(pos) - idx.alloc.traverseDfs() - idx.alloc.fillSearchMx() + idx.alloc = newBtAlloc(idx.keyCount, M, false) + if idx.alloc != nil { + idx.alloc.dataLookup = idx.dataLookup + idx.alloc.traverseDfs() + defer idx.decompressor.EnableReadAhead().DisableReadAhead() + idx.alloc.fillSearchMx() + } return idx, nil } @@ -958,10 +1001,11 @@ func OpenBtreeIndex(indexPath, dataPath string, M uint64) (*BtIndex, error) { return nil, err } - if idx.mmapUnix, idx.mmapWin, err = mmap.Mmap(idx.file, int(idx.size)); err != nil { + idx.m, err = mmap.MapRegion(idx.file, int(idx.size), mmap.RDONLY, 0, 0) + if err != nil { return nil, err } - idx.data = idx.mmapUnix[:idx.size] + idx.data = idx.m[:idx.size] // Read number of keys and bytes per record pos := 8 @@ -984,38 +1028,44 @@ func OpenBtreeIndex(indexPath, dataPath string, M uint64) (*BtIndex, error) { } idx.getter = idx.decompressor.MakeGetter() - idx.alloc = newBtAlloc(idx.keyCount, M, false) - idx.alloc.dataLookup = idx.dataLookup idx.dataoffset = uint64(pos) - idx.alloc.traverseDfs() - idx.alloc.fillSearchMx() + idx.alloc = newBtAlloc(idx.keyCount, M, false) + if idx.alloc != nil { + idx.alloc.dataLookup = idx.dataLookup + idx.alloc.traverseDfs() + defer idx.decompressor.EnableReadAhead().DisableReadAhead() + idx.alloc.fillSearchMx() + } return idx, nil } +var ErrBtIndexLookupBounds = errors.New("BtIndex: lookup di bounds error") + +// dataLookup fetches key and value from data file by di (data index) +// di starts from 0 so di is never >= keyCount func (b *BtIndex) dataLookup(di uint64) ([]byte, []byte, error) { - if b.keyCount < di { - return nil, nil, fmt.Errorf("ki is greater than key count in index") + if di >= b.keyCount { + return nil, nil, fmt.Errorf("%w: keyCount=%d, item %d requested. file: %s", ErrBtIndexLookupBounds, b.keyCount, di+1, b.FileName()) } - - p := b.dataoffset + di*uint64(b.bytesPerRec) - if uint64(len(b.data)) < p+uint64(b.bytesPerRec) { - return nil, nil, fmt.Errorf("data lookup gone too far (%d after %d)", p+uint64(b.bytesPerRec)-uint64(len(b.data)), len(b.data)) + p := int(b.dataoffset) + int(di)*b.bytesPerRec + if len(b.data) < p+b.bytesPerRec { + return nil, nil, fmt.Errorf("data lookup gone too far (%d after %d). keyCount=%d, requesed item %d. file: %s", p+b.bytesPerRec-len(b.data), len(b.data), b.keyCount, di, b.FileName()) } - offt := b.data[p : p+uint64(b.bytesPerRec)] var aux [8]byte - copy(aux[8-len(offt):], offt) + dst := aux[8-b.bytesPerRec:] + copy(dst, b.data[p:p+b.bytesPerRec]) offset := binary.BigEndian.Uint64(aux[:]) b.getter.Reset(offset) if !b.getter.HasNext() { - return nil, nil, fmt.Errorf("pair %d not found", di) + return nil, nil, fmt.Errorf("pair %d not found. keyCount=%d. file: %s", di, b.keyCount, b.FileName()) } key, kp := b.getter.Next(nil) if !b.getter.HasNext() { - return nil, nil, fmt.Errorf("pair %d not found", di) + return nil, nil, fmt.Errorf("pair %d not found. keyCount=%d. file: %s", di, b.keyCount, b.FileName()) } val, vp := b.getter.Next(nil) _, _ = kp, vp @@ -1030,41 +1080,47 @@ func (b *BtIndex) FilePath() string { return b.filePath } func (b *BtIndex) FileName() string { return path.Base(b.filePath) } -func (b *BtIndex) Empty() bool { return b.keyCount == 0 } +func (b *BtIndex) Empty() bool { return b == nil || b.keyCount == 0 } func (b *BtIndex) KeyCount() uint64 { return b.keyCount } -func (b *BtIndex) Close() error { +func (b *BtIndex) Close() { if b == nil { - return nil - } - if err := mmap.Munmap(b.mmapUnix, b.mmapWin); err != nil { - return err + return } - if err := b.file.Close(); err != nil { - return err + if b.file != nil { + if err := b.m.Unmap(); err != nil { + log.Log(dbg.FileCloseLogLevel, "unmap", "err", err, "file", b.FileName(), "stack", dbg.Stack()) + } + b.m = nil + if err := b.file.Close(); err != nil { + log.Log(dbg.FileCloseLogLevel, "close", "err", err, "file", b.FileName(), "stack", dbg.Stack()) + } + b.file = nil } if b.decompressor != nil { - if err := b.decompressor.Close(); err != nil { - return err - } + b.decompressor.Close() + b.decompressor = nil } - return nil } func (b *BtIndex) Seek(x []byte) (*Cursor, error) { - if b.alloc != nil { - cursor, err := b.alloc.Seek(x) - if err != nil { - return nil, fmt.Errorf("seek key %x: %w", x, err) - } - return cursor, nil + if b.alloc == nil { + return nil, nil } - return nil, fmt.Errorf("seek has been failed") + cursor, err := b.alloc.Seek(x) + if err != nil { + return nil, fmt.Errorf("seek key %x: %w", x, err) + } + // cursor could be nil along with err if nothing found + return cursor, nil } // deprecated func (b *BtIndex) Lookup(key []byte) uint64 { + if b.alloc == nil { + return 0 + } cursor, err := b.alloc.Seek(key) if err != nil { panic(err) @@ -1073,6 +1129,9 @@ func (b *BtIndex) Lookup(key []byte) uint64 { } func (b *BtIndex) OrdinalLookup(i uint64) *Cursor { + if b.alloc == nil { + return nil + } if i > b.alloc.K { return nil } diff --git a/state/domain.go b/state/domain.go index 905009e07..34f856372 100644 --- a/state/domain.go +++ b/state/domain.go @@ -84,9 +84,7 @@ func filesItemLess(i, j *filesItem) bool { } func (i *filesItem) closeFilesAndRemove() { if i.decompressor != nil { - if err := i.decompressor.Close(); err != nil { - log.Trace("close", "err", err, "file", i.decompressor.FileName()) - } + i.decompressor.Close() // paranoic-mode on: don't delete frozen files if !i.frozen { if err := os.Remove(i.decompressor.FilePath()); err != nil { @@ -96,9 +94,7 @@ func (i *filesItem) closeFilesAndRemove() { i.decompressor = nil } if i.index != nil { - if err := i.index.Close(); err != nil { - log.Trace("close", "err", err, "file", i.index.FileName()) - } + i.index.Close() // paranoic-mode on: don't delete frozen files if !i.frozen { if err := os.Remove(i.index.FilePath()); err != nil { @@ -108,9 +104,7 @@ func (i *filesItem) closeFilesAndRemove() { i.index = nil } if i.bindex != nil { - if err := i.bindex.Close(); err != nil { - log.Trace("close", "err", err, "file", i.bindex.FileName()) - } + i.bindex.Close() if err := os.Remove(i.bindex.FilePath()); err != nil { log.Trace("close", "err", err, "file", i.bindex.FileName()) } @@ -147,6 +141,15 @@ func (ds *DomainStats) Accumulate(other DomainStats) { // Domain is a part of the state (examples are Accounts, Storage, Code) // Domain should not have any go routines or locks type Domain struct { + /* + not large: + keys: key -> ^step + vals: key -> ^step+value (DupSort) + large: + keys: key -> ^step + vals: key + ^step -> value + */ + *History files *btree2.BTreeG[*filesItem] // thread-safe, but maybe need 1 RWLock for all trees in AggregatorV3 // roFiles derivative from field `file`, but without garbage (canDelete=true, overlaps, etc...) @@ -182,6 +185,15 @@ func NewDomain(dir, tmpdir string, aggregationStep uint64, return d, nil } +// LastStepInDB - return the latest available step in db (at-least 1 value in such step) +func (d *Domain) LastStepInDB(tx kv.Tx) (lstInDb uint64) { + lst, _ := kv.FirstKey(tx, d.valsTable) + if len(lst) > 0 { + lstInDb = ^binary.BigEndian.Uint64(lst[len(lst)-8:]) + } + return lstInDb +} + func (d *Domain) StartWrites() { d.defaultDc = d.MakeContext() d.History.StartWrites() @@ -364,21 +376,15 @@ func (d *Domain) closeWhatNotInList(fNames []string) { }) for _, item := range toDelete { if item.decompressor != nil { - if err := item.decompressor.Close(); err != nil { - d.logger.Trace("close", "err", err, "file", item.decompressor.FileName()) - } + item.decompressor.Close() item.decompressor = nil } if item.index != nil { - if err := item.index.Close(); err != nil { - d.logger.Trace("close", "err", err, "file", item.index.FileName()) - } + item.index.Close() item.index = nil } if item.bindex != nil { - if err := item.bindex.Close(); err != nil { - d.logger.Trace("close", "err", err, "file", item.bindex.FileName()) - } + item.bindex.Close() item.bindex = nil } d.files.Delete(item) @@ -413,8 +419,7 @@ func (dc *DomainContext) get(key []byte, fromTxNum uint64, roTx kv.Tx) ([]byte, } if len(foundInvStep) == 0 { dc.d.stats.HistoryQueries.Add(1) - v, found := dc.readFromFiles(key, fromTxNum) - return v, found, nil + return dc.readFromFiles(key, fromTxNum) } //keySuffix := make([]byte, len(key)+8) copy(dc.keyBuf[:], key) @@ -998,6 +1003,9 @@ func (d *Domain) buildFiles(ctx context.Context, step uint64, collation Collatio } } }() + if d.noFsync { + valuesComp.DisableFsync() + } if err = valuesComp.Compress(); err != nil { return StaticFiles{}, fmt.Errorf("compress %s values: %w", d.filenameBase, err) } @@ -1012,7 +1020,7 @@ func (d *Domain) buildFiles(ctx context.Context, step uint64, collation Collatio { p := ps.AddNew(valuesIdxFileName, uint64(valuesDecomp.Count()*2)) defer ps.Delete(p) - if valuesIdx, err = buildIndexThenOpen(ctx, valuesDecomp, valuesIdxPath, d.tmpdir, collation.valuesCount, false, p, d.logger); err != nil { + if valuesIdx, err = buildIndexThenOpen(ctx, valuesDecomp, valuesIdxPath, d.tmpdir, collation.valuesCount, false, p, d.logger, d.noFsync); err != nil { return StaticFiles{}, fmt.Errorf("build %s values idx: %w", d.filenameBase, err) } } @@ -1023,7 +1031,7 @@ func (d *Domain) buildFiles(ctx context.Context, step uint64, collation Collatio btPath := filepath.Join(d.dir, btFileName) p := ps.AddNew(btFileName, uint64(valuesDecomp.Count()*2)) defer ps.Delete(p) - bt, err = CreateBtreeIndexWithDecompressor(btPath, DefaultBtreeM, valuesDecomp, p, d.logger) + bt, err = CreateBtreeIndexWithDecompressor(btPath, DefaultBtreeM, valuesDecomp, p, d.tmpdir, d.logger) if err != nil { return StaticFiles{}, fmt.Errorf("build %s values bt idx: %w", d.filenameBase, err) } @@ -1067,7 +1075,7 @@ func (d *Domain) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps * p := ps.AddNew("fixme", uint64(fitem.decompressor.Count())) defer ps.Delete(p) - if err := BuildBtreeIndexWithDecompressor(idxPath, fitem.decompressor, p, d.logger); err != nil { + if err := BuildBtreeIndexWithDecompressor(idxPath, fitem.decompressor, p, d.tmpdir, d.logger); err != nil { return fmt.Errorf("failed to build btree index for %s: %w", fitem.decompressor.FileName(), err) } return nil @@ -1076,14 +1084,14 @@ func (d *Domain) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps * return nil } -func buildIndexThenOpen(ctx context.Context, d *compress.Decompressor, idxPath, tmpdir string, count int, values bool, p *background.Progress, logger log.Logger) (*recsplit.Index, error) { - if err := buildIndex(ctx, d, idxPath, tmpdir, count, values, p, logger); err != nil { +func buildIndexThenOpen(ctx context.Context, d *compress.Decompressor, idxPath, tmpdir string, count int, values bool, p *background.Progress, logger log.Logger, noFsync bool) (*recsplit.Index, error) { + if err := buildIndex(ctx, d, idxPath, tmpdir, count, values, p, logger, noFsync); err != nil { return nil, err } return recsplit.OpenIndex(idxPath) } -func buildIndex(ctx context.Context, d *compress.Decompressor, idxPath, tmpdir string, count int, values bool, p *background.Progress, logger log.Logger) error { +func buildIndex(ctx context.Context, d *compress.Decompressor, idxPath, tmpdir string, count int, values bool, p *background.Progress, logger log.Logger, noFsync bool) error { var rs *recsplit.RecSplit var err error if rs, err = recsplit.NewRecSplit(recsplit.RecSplitArgs{ @@ -1098,6 +1106,9 @@ func buildIndex(ctx context.Context, d *compress.Decompressor, idxPath, tmpdir s } defer rs.Close() rs.LogLvl(log.LvlTrace) + if noFsync { + rs.DisableFsync() + } defer d.EnableMadvNormal().DisableReadAhead() word := make([]byte, 0, 256) @@ -1121,11 +1132,11 @@ func buildIndex(ctx context.Context, d *compress.Decompressor, idxPath, tmpdir s } } // Skip value - keyPos = g.Skip() + keyPos, _ = g.Skip() p.Processed.Add(1) } - if err = rs.Build(); err != nil { + if err = rs.Build(ctx); err != nil { if rs.Collision() { logger.Info("Building recsplit. Collision happened. It's ok. Restarting...") rs.ResetNextSalt() @@ -1199,11 +1210,11 @@ func (d *Domain) prune(ctx context.Context, step uint64, txFrom, txTo, limit uin } s := ^binary.BigEndian.Uint64(vl) if s > step { - kn, vn, err := keysCursor.NextDup() + _, vn, err := keysCursor.NextDup() if err != nil { break } - if bytes.Equal(kn, k) && bytes.Equal(vn, stepBytes) { + if bytes.Equal(vn, stepBytes) { if err := keysCursor.DeleteCurrent(); err != nil { return fmt.Errorf("prune key %x: %w", k, err) } @@ -1234,7 +1245,6 @@ func (d *Domain) prune(ctx context.Context, step uint64, txFrom, txTo, limit uin return fmt.Errorf("iterate of %s keys: %w", d.filenameBase, err) } - _state = "delete vals" pos.Store(0) // It is important to clean up tables in a specific order // First keysTable, because it is the first one access in the `get` function, i.e. if the record is deleted from there, other tables will not be accessed @@ -1244,11 +1254,6 @@ func (d *Domain) prune(ctx context.Context, step uint64, txFrom, txTo, limit uin } defer valsCursor.Close() - totalKeys, err = valsCursor.Count() - if err != nil { - return fmt.Errorf("count of %s keys: %w", d.filenameBase, err) - } - for k, _, err := valsCursor.First(); err == nil && k != nil; k, _, err = valsCursor.Next() { if bytes.HasSuffix(k, stepBytes) { if _, ok := keyMaxSteps[string(k)]; !ok { @@ -1266,10 +1271,8 @@ func (d *Domain) prune(ctx context.Context, step uint64, txFrom, txTo, limit uin case <-ctx.Done(): return ctx.Err() case <-logEvery.C: - d.logger.Info("[snapshots] prune domain", "name", d.filenameBase, - "stage", _state, - "range", fmt.Sprintf("%.2f-%.2f", float64(txFrom)/float64(d.aggregationStep), float64(txTo)/float64(d.aggregationStep)), - "progress", fmt.Sprintf("%.2f%%", (float64(pos.Load())/float64(totalKeys))*100)) + d.logger.Info("[snapshots] prune domain", "name", d.filenameBase, "step", step) + //"steps", fmt.Sprintf("%.2f-%.2f", float64(txFrom)/float64(d.aggregationStep), float64(txTo)/float64(d.aggregationStep))) default: } } @@ -1355,7 +1358,7 @@ func (d *Domain) warmup(ctx context.Context, txFrom, limit uint64, tx kv.Tx) err var COMPARE_INDEXES = false // if true, will compare values from Btree and INvertedIndex -func (dc *DomainContext) readFromFiles(filekey []byte, fromTxNum uint64) ([]byte, bool) { +func (dc *DomainContext) readFromFiles(filekey []byte, fromTxNum uint64) ([]byte, bool, error) { var val []byte var found bool @@ -1369,34 +1372,20 @@ func (dc *DomainContext) readFromFiles(filekey []byte, fromTxNum uint64) ([]byte } cur, err := reader.Seek(filekey) if err != nil { - dc.d.logger.Warn("failed to read from file", "file", reader.FileName(), "err", err) + //return nil, false, nil //TODO: uncomment me + return nil, false, err + } + if cur == nil { continue } if bytes.Equal(cur.Key(), filekey) { val = cur.Value() found = true - - if COMPARE_INDEXES { - rd := recsplit.NewIndexReader(dc.files[i].src.index) - oft := rd.Lookup(filekey) - gt := dc.statelessGetter(i) - gt.Reset(oft) - var k, v []byte - if gt.HasNext() { - k, _ = gt.Next(nil) - v, _ = gt.Next(nil) - } - fmt.Printf("key: %x, val: %x\n", k, v) - if !bytes.Equal(v, val) { - panic("not equal") - } - - } break } } - return val, found + return val, found, nil } // historyBeforeTxNum searches history for a value of specified key before txNum @@ -1436,9 +1425,11 @@ func (dc *DomainContext) historyBeforeTxNum(key []byte, txNum uint64, roTx kv.Tx cur, err := reader.Seek(key) if err != nil { dc.d.logger.Warn("failed to read history before from file", "key", key, "err", err) + return nil, false, err + } + if cur == nil { continue } - if bytes.Equal(cur.Key(), key) { val = cur.Value() break diff --git a/state/domain_committed.go b/state/domain_committed.go index 97f0127f9..9c046975c 100644 --- a/state/domain_committed.go +++ b/state/domain_committed.go @@ -534,12 +534,12 @@ func (d *DomainCommitted) mergeFiles(ctx context.Context, oldFiles SelectedStati p = ps.AddNew(datFileName, uint64(keyCount)) defer ps.Delete(p) - if valuesIn.index, err = buildIndexThenOpen(ctx, valuesIn.decompressor, idxPath, d.dir, keyCount, false /* values */, p, d.logger); err != nil { + if valuesIn.index, err = buildIndexThenOpen(ctx, valuesIn.decompressor, idxPath, d.dir, keyCount, false /* values */, p, d.logger, d.noFsync); err != nil { return nil, nil, nil, fmt.Errorf("merge %s buildIndex [%d-%d]: %w", d.filenameBase, r.valuesStartTxNum, r.valuesEndTxNum, err) } btPath := strings.TrimSuffix(idxPath, "kvi") + "bt" - valuesIn.bindex, err = CreateBtreeIndexWithDecompressor(btPath, 2048, valuesIn.decompressor, p, d.logger) + valuesIn.bindex, err = CreateBtreeIndexWithDecompressor(btPath, 2048, valuesIn.decompressor, p, d.tmpdir, d.logger) if err != nil { return nil, nil, nil, fmt.Errorf("create btindex %s [%d-%d]: %w", d.filenameBase, r.valuesStartTxNum, r.valuesEndTxNum, err) } diff --git a/state/domain_test.go b/state/domain_test.go index 2ef821e4f..cf1ed599d 100644 --- a/state/domain_test.go +++ b/state/domain_test.go @@ -59,6 +59,7 @@ func testDbAndDomain(t *testing.T, logger log.Logger) (string, kv.RwDB, *Domain) d, err := NewDomain(path, path, 16, "base", keysTable, valsTable, historyKeysTable, historyValsTable, indexTable, true, false, logger) require.NoError(t, err) t.Cleanup(d.Close) + d.DisableFsync() return path, db, d } @@ -500,7 +501,7 @@ func collateAndMergeOnce(t *testing.T, d *Domain, step uint64) { } } -func TestMergeFiles(t *testing.T) { +func TestDomain_MergeFiles(t *testing.T) { logger := log.New() _, db, d, txs := filledDomain(t, logger) @@ -508,7 +509,7 @@ func TestMergeFiles(t *testing.T) { checkHistory(t, db, d, txs) } -func TestScanFiles(t *testing.T) { +func TestDomain_ScanFiles(t *testing.T) { logger := log.New() path, db, d, txs := filledDomain(t, logger) _ = path @@ -523,7 +524,7 @@ func TestScanFiles(t *testing.T) { checkHistory(t, db, d, txs) } -func TestDelete(t *testing.T) { +func TestDomain_Delete(t *testing.T) { logger := log.New() _, db, d := testDbAndDomain(t, logger) ctx, require := context.Background(), require.New(t) diff --git a/state/history.go b/state/history.go index 0227c2213..23fad0251 100644 --- a/state/history.go +++ b/state/history.go @@ -65,7 +65,14 @@ type History struct { compressWorkers int compressVals bool integrityFileExtensions []string - largeValues bool // can't use DupSort optimization (aka. prefix-compression) if values size > 4kb + + // not large: + // keys: txNum -> key1+key2 + // vals: key1+key2 -> txNum + value (DupSort) + // large: + // keys: txNum -> key1+key2 + // vals: key1+key2+txNum -> value (not DupSort) + largeValues bool // can't use DupSort optimization (aka. prefix-compression) if values size > 4kb garbageFiles []*filesItem // files that exist on disk, but ignored on opening folder - because they are garbage @@ -254,15 +261,11 @@ func (h *History) closeWhatNotInList(fNames []string) { }) for _, item := range toDelete { if item.decompressor != nil { - if err := item.decompressor.Close(); err != nil { - h.logger.Trace("close", "err", err, "file", item.index.FileName()) - } + item.decompressor.Close() item.decompressor = nil } if item.index != nil { - if err := item.index.Close(); err != nil { - h.logger.Trace("close", "err", err, "file", item.index.FileName()) - } + item.index.Close() item.index = nil } h.files.Delete(item) @@ -449,15 +452,15 @@ func buildVi(ctx context.Context, historyItem, iiItem *filesItem, historyIdxPath return err } if compressVals { - valOffset = g2.Skip() + valOffset, _ = g2.Skip() } else { - valOffset = g2.SkipUncompressed() + valOffset, _ = g2.SkipUncompressed() } } p.Processed.Add(1) } - if err = rs.Build(); err != nil { + if err = rs.Build(ctx); err != nil { if rs.Collision() { logger.Info("Building recsplit. Collision happened. It's ok. Restarting...") rs.ResetNextSalt() @@ -562,7 +565,7 @@ func (h *History) newWriter(tmpdir string, buffered, discard bool) *historyWAL { } func (h *historyWAL) flush(ctx context.Context, tx kv.RwTx) error { - if h.discard { + if h.discard || !h.buffered { return nil } if err := h.historyVals.Load(tx, h.h.historyValsTable, loadFunc, etl.TransformArgs{Quit: ctx.Done()}); err != nil { @@ -788,6 +791,9 @@ func (h *History) reCalcRoFiles() { // static files and their indices func (h *History) buildFiles(ctx context.Context, step uint64, collation HistoryCollation, ps *background.ProgressSet) (HistoryFiles, error) { historyComp := collation.historyComp + if h.noFsync { + historyComp.DisableFsync() + } var historyDecomp, efHistoryDecomp *compress.Decompressor var historyIdx, efHistoryIdx *recsplit.Index var efHistoryComp *compress.Compressor @@ -856,6 +862,9 @@ func (h *History) buildFiles(ctx context.Context, step uint64, collation History if err != nil { return HistoryFiles{}, fmt.Errorf("create %s ef history compressor: %w", h.filenameBase, err) } + if h.noFsync { + efHistoryComp.DisableFsync() + } var buf []byte for _, key := range keys { if err = efHistoryComp.AddUncompressedWord([]byte(key)); err != nil { @@ -890,7 +899,7 @@ func (h *History) buildFiles(ctx context.Context, step uint64, collation History efHistoryIdxPath := filepath.Join(h.dir, efHistoryIdxFileName) p := ps.AddNew(efHistoryIdxFileName, uint64(len(keys)*2)) defer ps.Delete(p) - if efHistoryIdx, err = buildIndexThenOpen(ctx, efHistoryDecomp, efHistoryIdxPath, h.tmpdir, len(keys), false /* values */, p, h.logger); err != nil { + if efHistoryIdx, err = buildIndexThenOpen(ctx, efHistoryDecomp, efHistoryIdxPath, h.tmpdir, len(keys), false /* values */, p, h.logger, h.noFsync); err != nil { return HistoryFiles{}, fmt.Errorf("build %s ef history idx: %w", h.filenameBase, err) } if rs, err = recsplit.NewRecSplit(recsplit.RecSplitArgs{ @@ -904,6 +913,9 @@ func (h *History) buildFiles(ctx context.Context, step uint64, collation History return HistoryFiles{}, fmt.Errorf("create recsplit: %w", err) } rs.LogLvl(log.LvlTrace) + if h.noFsync { + rs.DisableFsync() + } var historyKey []byte var txKey [8]byte var valOffset uint64 @@ -921,10 +933,10 @@ func (h *History) buildFiles(ctx context.Context, step uint64, collation History if err = rs.AddKey(historyKey, valOffset); err != nil { return HistoryFiles{}, fmt.Errorf("add %s history idx [%x]: %w", h.filenameBase, historyKey, err) } - valOffset = g.Skip() + valOffset, _ = g.Skip() } } - if err = rs.Build(); err != nil { + if err = rs.Build(ctx); err != nil { if rs.Collision() { log.Info("Building recsplit. Collision happened. It's ok. Restarting...") rs.ResetNextSalt() @@ -1038,6 +1050,11 @@ func (h *History) isEmpty(tx kv.Tx) (bool, error) { } func (h *History) prune(ctx context.Context, txFrom, txTo, limit uint64, logEvery *time.Ticker) error { + historyKeysCursorForDeletes, err := h.tx.RwCursorDupSort(h.indexKeysTable) + if err != nil { + return fmt.Errorf("create %s history cursor: %w", h.filenameBase, err) + } + defer historyKeysCursorForDeletes.Close() historyKeysCursor, err := h.tx.RwCursorDupSort(h.indexKeysTable) if err != nil { return fmt.Errorf("create %s history cursor: %w", h.filenameBase, err) @@ -1073,15 +1090,9 @@ func (h *History) prune(ctx context.Context, txFrom, txTo, limit uint64, logEver if h.largeValues { seek := append(common.Copy(v), k...) - kk, _, err := valsC.SeekExact(seek) - if err != nil { + if err := valsC.Delete(seek); err != nil { return err } - if kk != nil { - if err = valsC.DeleteCurrent(); err != nil { - return err - } - } } else { vv, err := valsCDup.SeekBothRange(v, k) if err != nil { @@ -1096,131 +1107,13 @@ func (h *History) prune(ctx context.Context, txFrom, txTo, limit uint64, logEver } // This DeleteCurrent needs to the last in the loop iteration, because it invalidates k and v - if err = historyKeysCursor.DeleteCurrent(); err != nil { + if _, _, err = historyKeysCursorForDeletes.SeekBothExact(k, v); err != nil { + return err + } + if err = historyKeysCursorForDeletes.DeleteCurrent(); err != nil { return err } } - if err != nil { - return fmt.Errorf("iterate over %s history keys: %w", h.filenameBase, err) - } - - /* - historyKeysCursor, err := h.tx.RwCursorDupSort(h.indexKeysTable) - if err != nil { - return fmt.Errorf("create %s history cursor: %w", h.filenameBase, err) - } - defer historyKeysCursor.Close() - var txKey [8]byte - binary.BigEndian.PutUint64(txKey[:], txFrom) - - k, v, err := historyKeysCursor.Seek(txKey[:]) - if err != nil { - return err - } - if k == nil { - return nil - } - txFrom = binary.BigEndian.Uint64(k) - if limit != math.MaxUint64 && limit != 0 { - txTo = cmp.Min(txTo, txFrom+limit) - } - if txFrom >= txTo { - return nil - } - - collector := etl.NewCollector("snapshots", h.tmpdir, etl.NewOldestEntryBuffer(etl.BufferOptimalSize), h.logger) - defer collector.Close() - - // Invariant: if some `txNum=N` pruned - it's pruned Fully - // Means: can use DeleteCurrentDuplicates all values of given `txNum` - for ; err == nil && k != nil; k, v, err = historyKeysCursor.NextNoDup() { - txNum := binary.BigEndian.Uint64(k) - if txNum >= txTo { - break - } - for ; err == nil && k != nil; k, v, err = historyKeysCursor.NextDup() { - if err := collector.Collect(v, nil); err != nil { - return err - } - } - - // This DeleteCurrent needs to the last in the loop iteration, because it invalidates k and v - if err = historyKeysCursor.DeleteCurrentDuplicates(); err != nil { - return err - } - } - - if h.largeValues { - valsC, err := h.tx.RwCursor(h.historyValsTable) - if err != nil { - return err - } - defer valsC.Close() - - if err := collector.Load(h.tx, "", func(key, _ []byte, table etl.CurrentTableReader, next etl.LoadNextFunc) error { - for k, _, err := valsC.Seek(key); k != nil; k, _, err = valsC.Next() { - if err != nil { - return err - } - if !bytes.HasPrefix(k, key) { - break - } - txNum := binary.BigEndian.Uint64(k[len(k)-8:]) - if txNum >= txTo { - break - } - if err = valsC.DeleteCurrent(); err != nil { - return err - } - - select { - case <-logEvery.C: - log.Info("[snapshots] prune history", "name", h.filenameBase, "to_step", fmt.Sprintf("%.2f", float64(txTo)/float64(h.aggregationStep)), "prefix", fmt.Sprintf("%x", key[:8])) - default: - } - } - return nil - }, etl.TransformArgs{Quit: ctx.Done()}); err != nil { - return err - } - if err != nil { - return fmt.Errorf("iterate over %s history keys: %w", h.filenameBase, err) - } - } else { - valsC, err := h.tx.RwCursorDupSort(h.historyValsTable) - if err != nil { - return err - } - defer valsC.Close() - - if err := collector.Load(h.tx, "", func(key, _ []byte, table etl.CurrentTableReader, next etl.LoadNextFunc) error { - for k, v, err := valsC.SeekExact(key); k != nil; k, v, err = valsC.NextDup() { - if err != nil { - return err - } - txNum := binary.BigEndian.Uint64(v) - if txNum >= txTo { - break - } - if err = valsC.DeleteCurrent(); err != nil { - return err - } - - select { - case <-logEvery.C: - log.Info("[snapshots] prune history", "name", h.filenameBase, "to_step", fmt.Sprintf("%.2f", float64(txTo)/float64(h.aggregationStep)), "prefix", fmt.Sprintf("%x", key[:8])) - default: - } - } - return nil - }, etl.TransformArgs{Quit: ctx.Done()}); err != nil { - return err - } - if err != nil { - return fmt.Errorf("iterate over %s history keys: %w", h.filenameBase, err) - } - } - */ return nil } diff --git a/state/history_test.go b/state/history_test.go index e4713da41..647e14a39 100644 --- a/state/history_test.go +++ b/state/history_test.go @@ -55,6 +55,7 @@ func testDbAndHistory(tb testing.TB, largeValues bool, logger log.Logger) (strin }).MustOpen() h, err := NewHistory(path, path, 16, "hist", keysTable, indexTable, valsTable, false, nil, false, logger) require.NoError(tb, err) + h.DisableFsync() tb.Cleanup(db.Close) tb.Cleanup(h.Close) return path, db, h diff --git a/state/inverted_index.go b/state/inverted_index.go index a4f8c3873..5ef8e6ec2 100644 --- a/state/inverted_index.go +++ b/state/inverted_index.go @@ -75,6 +75,8 @@ type InvertedIndex struct { txNumBytes [8]byte wal *invertedIndexWAL logger log.Logger + + noFsync bool // fsync is enabled by default, but tests can manually disable } func NewInvertedIndex( @@ -273,7 +275,7 @@ func (ii *InvertedIndex) buildEfi(ctx context.Context, item *filesItem, p *backg p.Name.Store(&fName) p.Total.Store(uint64(item.decompressor.Count())) //ii.logger.Info("[snapshots] build idx", "file", fName) - return buildIndex(ctx, item.decompressor, idxPath, ii.tmpdir, item.decompressor.Count()/2, false, p, ii.logger) + return buildIndex(ctx, item.decompressor, idxPath, ii.tmpdir, item.decompressor.Count()/2, false, p, ii.logger, ii.noFsync) } // BuildMissedIndices - produce .efi/.vi/.kvi from .ef/.v/.kv @@ -352,15 +354,11 @@ func (ii *InvertedIndex) closeWhatNotInList(fNames []string) { }) for _, item := range toDelete { if item.decompressor != nil { - if err := item.decompressor.Close(); err != nil { - ii.logger.Trace("close", "err", err, "file", item.index.FileName()) - } + item.decompressor.Close() item.decompressor = nil } if item.index != nil { - if err := item.index.Close(); err != nil { - ii.logger.Trace("close", "err", err, "file", item.index.FileName()) - } + item.index.Close() item.index = nil } ii.files.Delete(item) @@ -373,6 +371,9 @@ func (ii *InvertedIndex) Close() { ii.reCalcRoFiles() } +// DisableFsync - just for tests +func (ii *InvertedIndex) DisableFsync() { ii.noFsync = true } + func (ii *InvertedIndex) Files() (res []string) { ii.files.Walk(func(items []*filesItem) bool { for _, item := range items { @@ -440,7 +441,7 @@ func loadFunc(k, v []byte, table etl.CurrentTableReader, next etl.LoadNextFunc) } func (ii *invertedIndexWAL) Flush(ctx context.Context, tx kv.RwTx) error { - if ii.discard { + if ii.discard || !ii.buffered { return nil } if err := ii.index.Load(tx, ii.ii.indexTable, loadFunc, etl.TransformArgs{Quit: ctx.Done()}); err != nil { @@ -1234,7 +1235,7 @@ func (ii *InvertedIndex) buildFiles(ctx context.Context, step uint64, bitmaps ma idxPath := filepath.Join(ii.dir, idxFileName) p := ps.AddNew(idxFileName, uint64(decomp.Count()*2)) defer ps.Delete(p) - if index, err = buildIndexThenOpen(ctx, decomp, idxPath, ii.tmpdir, len(keys), false /* values */, p, ii.logger); err != nil { + if index, err = buildIndexThenOpen(ctx, decomp, idxPath, ii.tmpdir, len(keys), false /* values */, p, ii.logger, ii.noFsync); err != nil { return InvertedFiles{}, fmt.Errorf("build %s efi: %w", ii.filenameBase, err) } closeComp = false @@ -1276,7 +1277,10 @@ func (ii *InvertedIndex) warmup(ctx context.Context, txFrom, limit uint64, tx kv if limit != math.MaxUint64 && limit != 0 { txTo = txFrom + limit } - for ; err == nil && k != nil; k, v, err = keysCursor.Next() { + for ; k != nil; k, v, err = keysCursor.Next() { + if err != nil { + return fmt.Errorf("iterate over %s keys: %w", ii.filenameBase, err) + } txNum := binary.BigEndian.Uint64(k) if txNum >= txTo { break @@ -1289,9 +1293,6 @@ func (ii *InvertedIndex) warmup(ctx context.Context, txFrom, limit uint64, tx kv default: } } - if err != nil { - return fmt.Errorf("iterate over %s keys: %w", ii.filenameBase, err) - } return nil } @@ -1322,6 +1323,11 @@ func (ii *InvertedIndex) prune(ctx context.Context, txFrom, txTo, limit uint64, collector := etl.NewCollector("snapshots", ii.tmpdir, etl.NewOldestEntryBuffer(etl.BufferOptimalSize), ii.logger) defer collector.Close() + idxCForDeletes, err := ii.tx.RwCursorDupSort(ii.indexTable) + if err != nil { + return err + } + defer idxCForDeletes.Close() idxC, err := ii.tx.RwCursorDupSort(ii.indexTable) if err != nil { return err @@ -1330,19 +1336,25 @@ func (ii *InvertedIndex) prune(ctx context.Context, txFrom, txTo, limit uint64, // Invariant: if some `txNum=N` pruned - it's pruned Fully // Means: can use DeleteCurrentDuplicates all values of given `txNum` - for ; err == nil && k != nil; k, v, err = keysCursor.NextNoDup() { + for ; k != nil; k, v, err = keysCursor.NextNoDup() { + if err != nil { + return err + } txNum := binary.BigEndian.Uint64(k) if txNum >= txTo { break } - for ; err == nil && k != nil; k, v, err = keysCursor.NextDup() { + for ; v != nil; _, v, err = keysCursor.NextDup() { + if err != nil { + return err + } if err := collector.Collect(v, nil); err != nil { return err } } // This DeleteCurrent needs to the last in the loop iteration, because it invalidates k and v - if err = keysCursor.DeleteCurrentDuplicates(); err != nil { + if err = ii.tx.Delete(ii.indexKeysTable, k); err != nil { return err } select { @@ -1364,7 +1376,11 @@ func (ii *InvertedIndex) prune(ctx context.Context, txFrom, txTo, limit uint64, if txNum >= txTo { break } - if err = idxC.DeleteCurrent(); err != nil { + + if _, _, err = idxCForDeletes.SeekBothExact(key, v); err != nil { + return err + } + if err = idxCForDeletes.DeleteCurrent(); err != nil { return err } @@ -1448,3 +1464,19 @@ func (ii *InvertedIndex) collectFilesStat() (filesCount, filesSize, idxSize uint }) return filesCount, filesSize, idxSize } + +func (ii *InvertedIndex) stepsRangeInDBAsStr(tx kv.Tx) string { + a1, a2 := ii.stepsRangeInDB(tx) + return fmt.Sprintf("%s: %.1f-%.1f", ii.filenameBase, a1, a2) +} +func (ii *InvertedIndex) stepsRangeInDB(tx kv.Tx) (from, to float64) { + fst, _ := kv.FirstKey(tx, ii.indexKeysTable) + if len(fst) > 0 { + from = float64(binary.BigEndian.Uint64(fst)) / float64(ii.aggregationStep) + } + lst, _ := kv.LastKey(tx, ii.indexKeysTable) + if len(lst) > 0 { + to = float64(binary.BigEndian.Uint64(lst)) / float64(ii.aggregationStep) + } + return from, to +} diff --git a/state/inverted_index_test.go b/state/inverted_index_test.go index 80d0fb2cd..c23dcb5d0 100644 --- a/state/inverted_index_test.go +++ b/state/inverted_index_test.go @@ -53,6 +53,7 @@ func testDbAndInvertedIndex(tb testing.TB, aggStep uint64, logger log.Logger) (s tb.Cleanup(db.Close) ii, err := NewInvertedIndex(path, path, aggStep, "inv" /* filenameBase */, keysTable, indexTable, false, nil, logger) require.NoError(tb, err) + ii.DisableFsync() tb.Cleanup(ii.Close) return path, db, ii } diff --git a/state/locality_index.go b/state/locality_index.go index 1f31b9dc5..8d126a087 100644 --- a/state/locality_index.go +++ b/state/locality_index.go @@ -228,9 +228,7 @@ func closeLocalityIndexFilesAndRemove(i *ctxLocalityIdx, logger log.Logger) { i.file.src = nil } if i.bm != nil { - if err := i.bm.Close(); err != nil { - logger.Trace("close", "err", err, "file", i.bm.FileName()) - } + i.bm.Close() if err := os.Remove(i.bm.FilePath()); err != nil { logger.Trace("os.Remove", "err", err, "file", i.bm.FileName()) } @@ -323,7 +321,7 @@ func (li *LocalityIndex) buildFiles(ctx context.Context, ic *InvertedIndexContex i := uint64(0) for { - dense, err := bitmapdb.NewFixedSizeBitmapsWriter(filePath, int(it.FilesAmount()), uint64(count)) + dense, err := bitmapdb.NewFixedSizeBitmapsWriter(filePath, int(it.FilesAmount()), uint64(count), li.logger) if err != nil { return nil, err } @@ -353,7 +351,7 @@ func (li *LocalityIndex) buildFiles(ctx context.Context, ic *InvertedIndexContex return nil, err } - if err = rs.Build(); err != nil { + if err = rs.Build(ctx); err != nil { if rs.Collision() { li.logger.Debug("Building recsplit. Collision happened. It's ok. Restarting...") rs.ResetNextSalt() diff --git a/state/merge.go b/state/merge.go index a33a18316..1a45bb550 100644 --- a/state/merge.go +++ b/state/merge.go @@ -521,6 +521,9 @@ func (d *Domain) mergeFiles(ctx context.Context, valuesFiles, indexFiles, histor if comp, err = compress.NewCompressor(ctx, "merge", datPath, d.tmpdir, compress.MinPatternScore, workers, log.LvlTrace, d.logger); err != nil { return nil, nil, nil, fmt.Errorf("merge %s history compressor: %w", d.filenameBase, err) } + if d.noFsync { + comp.DisableFsync() + } p := ps.AddNew("merege "+datFileName, 1) defer ps.Delete(p) @@ -629,7 +632,7 @@ func (d *Domain) mergeFiles(ctx context.Context, valuesFiles, indexFiles, histor ps.Delete(p) // if valuesIn.index, err = buildIndex(valuesIn.decompressor, idxPath, d.dir, keyCount, false /* values */); err != nil { - if valuesIn.index, err = buildIndexThenOpen(ctx, valuesIn.decompressor, idxPath, d.tmpdir, keyCount, false /* values */, p, d.logger); err != nil { + if valuesIn.index, err = buildIndexThenOpen(ctx, valuesIn.decompressor, idxPath, d.tmpdir, keyCount, false /* values */, p, d.logger, d.noFsync); err != nil { return nil, nil, nil, fmt.Errorf("merge %s buildIndex [%d-%d]: %w", d.filenameBase, r.valuesStartTxNum, r.valuesEndTxNum, err) } @@ -637,12 +640,12 @@ func (d *Domain) mergeFiles(ctx context.Context, valuesFiles, indexFiles, histor p = ps.AddNew(btFileName, uint64(keyCount*2)) defer ps.Delete(p) btPath := filepath.Join(d.dir, btFileName) - err = BuildBtreeIndexWithDecompressor(btPath, valuesIn.decompressor, p, d.logger) + err = BuildBtreeIndexWithDecompressor(btPath, valuesIn.decompressor, p, d.tmpdir, d.logger) if err != nil { return nil, nil, nil, fmt.Errorf("merge %s btindex [%d-%d]: %w", d.filenameBase, r.valuesStartTxNum, r.valuesEndTxNum, err) } - bt, err := OpenBtreeIndexWithDecompressor(btPath, 2048, valuesIn.decompressor) + bt, err := OpenBtreeIndexWithDecompressor(btPath, DefaultBtreeM, valuesIn.decompressor) if err != nil { return nil, nil, nil, fmt.Errorf("merge %s btindex2 [%d-%d]: %w", d.filenameBase, r.valuesStartTxNum, r.valuesEndTxNum, err) } @@ -691,6 +694,9 @@ func (ii *InvertedIndex) mergeFiles(ctx context.Context, files []*filesItem, sta if comp, err = compress.NewCompressor(ctx, "Snapshots merge", datPath, ii.tmpdir, compress.MinPatternScore, workers, log.LvlTrace, ii.logger); err != nil { return nil, fmt.Errorf("merge %s inverted index compressor: %w", ii.filenameBase, err) } + if ii.noFsync { + comp.DisableFsync() + } p := ps.AddNew("merge "+datFileName, 1) defer ps.Delete(p) @@ -783,7 +789,7 @@ func (ii *InvertedIndex) mergeFiles(ctx context.Context, files []*filesItem, sta idxPath := filepath.Join(ii.dir, idxFileName) p = ps.AddNew("merge "+idxFileName, uint64(outItem.decompressor.Count()*2)) defer ps.Delete(p) - if outItem.index, err = buildIndexThenOpen(ctx, outItem.decompressor, idxPath, ii.tmpdir, keyCount, false /* values */, p, ii.logger); err != nil { + if outItem.index, err = buildIndexThenOpen(ctx, outItem.decompressor, idxPath, ii.tmpdir, keyCount, false /* values */, p, ii.logger, ii.noFsync); err != nil { return nil, fmt.Errorf("merge %s buildIndex [%d-%d]: %w", ii.filenameBase, startTxNum, endTxNum, err) } closeItem = false @@ -850,6 +856,9 @@ func (h *History) mergeFiles(ctx context.Context, indexFiles, historyFiles []*fi if comp, err = compress.NewCompressor(ctx, "merge", datPath, h.tmpdir, compress.MinPatternScore, workers, log.LvlTrace, h.logger); err != nil { return nil, nil, fmt.Errorf("merge %s history compressor: %w", h.filenameBase, err) } + if h.noFsync { + comp.DisableFsync() + } p := ps.AddNew("merge "+datFileName, 1) defer ps.Delete(p) var cp CursorHeap @@ -944,6 +953,9 @@ func (h *History) mergeFiles(ctx context.Context, indexFiles, historyFiles []*fi return nil, nil, fmt.Errorf("create recsplit: %w", err) } rs.LogLvl(log.LvlTrace) + if h.noFsync { + rs.DisableFsync() + } var historyKey []byte var txKey [8]byte var valOffset uint64 @@ -967,14 +979,14 @@ func (h *History) mergeFiles(ctx context.Context, indexFiles, historyFiles []*fi return nil, nil, err } if h.compressVals { - valOffset = g2.Skip() + valOffset, _ = g2.Skip() } else { - valOffset = g2.SkipUncompressed() + valOffset, _ = g2.SkipUncompressed() } } p.Processed.Add(1) } - if err = rs.Build(); err != nil { + if err = rs.Build(ctx); err != nil { if rs.Collision() { log.Info("Building recsplit. Collision happened. It's ok. Restarting...") rs.ResetNextSalt() diff --git a/tools/licenses_check.sh b/tools/licenses_check.sh new file mode 100755 index 000000000..b56b7e3cf --- /dev/null +++ b/tools/licenses_check.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +scriptDir=$(dirname "${BASH_SOURCE[0]}") +scriptName=$(basename "${BASH_SOURCE[0]}") +projectDir="$scriptDir/.." +goLicensesVersion="v1.6.0" + +if [[ "$1" == "--install-deps" ]] +then + go install "github.com/google/go-licenses@$goLicensesVersion" + exit +fi + +if ! which go-licenses > /dev/null +then + echo "go-licenses tool is not found, install it with:" + echo " go install github.com/google/go-licenses@$goLicensesVersion" + exit +fi + +# enable build tags to cover maximum .go files +export GOFLAGS="-tags=gorules,linux,tools" + +output=$(find "$projectDir" -type 'd' -maxdepth 1 \ + -not -name ".*" \ + -not -name tools \ + | xargs go-licenses report 2>&1 \ + `# exceptions` \ + | grep -v "erigon-lib has empty version" `# self` \ + | grep -v "golang.org/x/" `# a part of Go` \ + | grep -v "crawshaw.io/sqlite" `# ISC` \ + | grep -v "erigon-lib/sais" `# MIT` \ + | grep -v "github.com/anacrolix/go-libutp" `# MIT` \ + | grep -v "github.com/anacrolix/mmsg" `# MPL-2.0` \ + | grep -v "github.com/anacrolix/multiless" `# MPL-2.0` \ + | grep -v "github.com/anacrolix/sync" `# MPL-2.0` \ + | grep -v "github.com/anacrolix/upnp" `# MPL-2.0` \ + | grep -v "github.com/consensys/gnark-crypto" `# Apache-2.0` \ + | grep -v "github.com/erigontech/mdbx-go" `# Apache-2.0` \ + | grep -v "github.com/ledgerwatch/secp256k1" `# BSD-3-Clause` \ + | grep -v "github.com/RoaringBitmap/roaring" `# Apache-2.0` \ + | grep -v "github.com/!roaring!bitmap/roaring" `# Apache-2.0` \ + | grep -v "pedersen_hash" `# Apache-2.0` \ + `# approved licenses` \ + | grep -Ev "Apache-2.0$" \ + | grep -Ev "BSD-2-Clause$" \ + | grep -Ev "BSD-3-Clause$" \ + | grep -Ev "ISC$" \ + | grep -Ev "MIT$" \ + | grep -Ev "MPL-2.0$" \ +) + +if [[ -n "$output" ]] +then + echo "ERROR: $scriptName has found issues!" 1>&2 + echo "ERROR: If it is a false positive, add it to the exceptions list in the script:" 1>&2 + echo "$output" 1>&2 + exit 1 +fi diff --git a/txpool/fetch.go b/txpool/fetch.go index 828efbb3e..b319f638b 100644 --- a/txpool/fetch.go +++ b/txpool/fetch.go @@ -18,6 +18,7 @@ package txpool import ( "context" + "errors" "fmt" "sync" "time" @@ -191,12 +192,7 @@ func (f *Fetch) receiveMessage(ctx context.Context, sentryClient sentry.SentryCl time.Sleep(3 * time.Second) continue } - - if rlp.IsRLPError(err) { - f.logger.Debug("[txpool.fetch] Handling incoming message", "msg", req.Id.String(), "err", err) - } else { - f.logger.Warn("[txpool.fetch] Handling incoming message", "msg", req.Id.String(), "err", err) - } + f.logger.Debug("[txpool.fetch] Handling incoming message", "msg", req.Id.String(), "err", err) } if f.wg != nil { f.wg.Done() @@ -473,7 +469,7 @@ func (f *Fetch) handleStateChanges(ctx context.Context, client StateChangesClien if err = f.threadSafeParseStateChangeTxn(func(parseContext *types2.TxParseContext) error { _, err := parseContext.ParseTransaction(change.Txs[i], 0, minedTxs.Txs[i], minedTxs.Senders.At(i), false /* hasEnvelope */, false /* wrappedWithBlobs */, nil) return err - }); err != nil { + }); err != nil && !errors.Is(err, context.Canceled) { f.logger.Warn("stream.Recv", "err", err) continue } @@ -486,7 +482,7 @@ func (f *Fetch) handleStateChanges(ctx context.Context, client StateChangesClien if err = f.threadSafeParseStateChangeTxn(func(parseContext *types2.TxParseContext) error { _, err = parseContext.ParseTransaction(change.Txs[i], 0, unwindTxs.Txs[i], unwindTxs.Senders.At(i), false /* hasEnvelope */, false /* wrappedWithBlobs */, nil) return err - }); err != nil { + }); err != nil && !errors.Is(err, context.Canceled) { f.logger.Warn("stream.Recv", "err", err) continue } @@ -497,7 +493,7 @@ func (f *Fetch) handleStateChanges(ctx context.Context, client StateChangesClien // unwrapped version here (we would need to re-wrap the tx with its blobs & kzg commitments). if err := f.db.View(ctx, func(tx kv.Tx) error { return f.pool.OnNewBlock(ctx, req, unwindTxs, minedTxs, tx) - }); err != nil { + }); err != nil && !errors.Is(err, context.Canceled) { f.logger.Warn("onNewBlock", "err", err) } if f.wg != nil { diff --git a/txpool/pool.go b/txpool/pool.go index 28522a072..8a1c414bd 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -36,6 +36,7 @@ import ( "github.com/ledgerwatch/erigon-lib/rlp" "github.com/VictoriaMetrics/metrics" + gokzg4844 "github.com/crate-crypto/go-kzg-4844" mapset "github.com/deckarep/golang-set/v2" "github.com/go-stack/stack" "github.com/google/btree" @@ -50,6 +51,7 @@ import ( "github.com/ledgerwatch/erigon-lib/common/dbg" "github.com/ledgerwatch/erigon-lib/common/fixedgas" "github.com/ledgerwatch/erigon-lib/common/u256" + libkzg "github.com/ledgerwatch/erigon-lib/crypto/kzg" "github.com/ledgerwatch/erigon-lib/gointerfaces" "github.com/ledgerwatch/erigon-lib/gointerfaces/grpcutil" "github.com/ledgerwatch/erigon-lib/gointerfaces/remote" @@ -382,7 +384,7 @@ func (p *TxPool) OnNewBlock(ctx context.Context, stateChanges *remote.StateChang p.lastSeenBlock.Store(stateChanges.ChangeBatch[len(stateChanges.ChangeBatch)-1].BlockHeight) if !p.started.Load() { if err := p.fromDB(ctx, tx, coreTx); err != nil { - return fmt.Errorf("loading txs from DB: %w", err) + return fmt.Errorf("OnNewBlock: loading txs from DB: %w", err) } } @@ -619,7 +621,7 @@ func (p *TxPool) IsLocal(idHash []byte) bool { func (p *TxPool) AddNewGoodPeer(peerID types.PeerID) { p.recentlyConnectedPeers.AddPeer(peerID) } func (p *TxPool) Started() bool { return p.started.Load() } -func (p *TxPool) best(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableDataGas uint64, toSkip mapset.Set[[32]byte]) (bool, int, error) { +func (p *TxPool) best(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableBlobGas uint64, toSkip mapset.Set[[32]byte]) (bool, int, error) { p.lock.Lock() defer p.lock.Unlock() @@ -660,11 +662,12 @@ func (p *TxPool) best(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableG continue } - // Skip transactions that require more data gas than is available - if mt.Tx.BlobCount*chain.DataGasPerBlob > availableDataGas { + // Skip transactions that require more blob gas than is available + blobCount := uint64(len(mt.Tx.BlobHashes)) + if blobCount*fixedgas.BlobGasPerBlob > availableBlobGas { continue } - availableDataGas -= mt.Tx.BlobCount * chain.DataGasPerBlob + availableBlobGas -= blobCount * fixedgas.BlobGasPerBlob // make sure we have enough gas in the caller to add this transaction. // not an exact science using intrinsic gas but as close as we could hope for at @@ -701,13 +704,13 @@ func (p *TxPool) ResetYieldedStatus() { } } -func (p *TxPool) YieldBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableDataGas uint64, toSkip mapset.Set[[32]byte]) (bool, int, error) { - return p.best(n, txs, tx, onTopOf, availableGas, availableDataGas, toSkip) +func (p *TxPool) YieldBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableBlobGas uint64, toSkip mapset.Set[[32]byte]) (bool, int, error) { + return p.best(n, txs, tx, onTopOf, availableGas, availableBlobGas, toSkip) } -func (p *TxPool) PeekBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableDataGas uint64) (bool, error) { +func (p *TxPool) PeekBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableBlobGas uint64) (bool, error) { set := mapset.NewThreadUnsafeSet[[32]byte]() - onTime, _, err := p.best(n, txs, tx, onTopOf, availableGas, availableDataGas, set) + onTime, _, err := p.best(n, txs, tx, onTopOf, availableGas, availableBlobGas, set) return onTime, err } @@ -730,6 +733,16 @@ func (p *TxPool) AddRemoteTxs(_ context.Context, newTxs types.TxSlots) { } } +func toBlobs(_blobs [][]byte) []gokzg4844.Blob { + blobs := make([]gokzg4844.Blob, len(_blobs)) + for i, _blob := range _blobs { + var b gokzg4844.Blob + copy(b[:], _blob) + blobs[i] = b + } + return blobs +} + func (p *TxPool) validateTx(txn *types.TxSlot, isLocal bool, stateCache kvcache.CacheView) txpoolcfg.DiscardReason { // No unauthenticated deposits allowed in the transaction pool. // This is for spam protection, not consensus, @@ -751,9 +764,33 @@ func (p *TxPool) validateTx(txn *types.TxSlot, isLocal bool, stateCache kvcache. if txn.Creation { return txpoolcfg.CreateBlobTxn } - if txn.BlobCount == 0 { + blobCount := uint64(len(txn.BlobHashes)) + if blobCount == 0 { return txpoolcfg.NoBlobs } + if blobCount > fixedgas.MaxBlobsPerBlock { + return txpoolcfg.TooManyBlobs + } + equalNumber := len(txn.BlobHashes) == len(txn.Blobs) && + len(txn.Blobs) == len(txn.Commitments) && + len(txn.Commitments) == len(txn.Proofs) + + if !equalNumber { + return txpoolcfg.UnequalBlobTxExt + } + + for i := 0; i < len(txn.Commitments); i++ { + if libkzg.KZGToVersionedHash(txn.Commitments[i]) != libkzg.VersionedHash(txn.BlobHashes[i]) { + return txpoolcfg.BlobHashCheckFail + } + } + + // https://github.com/ethereum/consensus-specs/blob/017a8495f7671f5fff2075a9bfc9238c1a0982f8/specs/deneb/polynomial-commitments.md#verify_blob_kzg_proof_batch + kzgCtx := libkzg.Ctx() + err := kzgCtx.VerifyBlobKZGProofBatch(toBlobs(txn.Blobs), txn.Commitments, txn.Proofs) + if err != nil { + return txpoolcfg.UnmatchedBlobTxExt + } } // Drop non-local transactions under our own minimal accepted gas price or tip @@ -807,7 +844,7 @@ func (p *TxPool) validateTx(txn *types.TxSlot, isLocal bool, stateCache kvcache. var maxUint256 = new(uint256.Int).SetAllOne() -// Sender should have enough balance for: gasLimit x feeCap + dataGas x dataFeeCap + transferred_value +// Sender should have enough balance for: gasLimit x feeCap + blobGas x blobFeeCap + transferred_value // See YP, Eq (61) in Section 6.2 "Execution" func requiredBalance(txn *types.TxSlot) *uint256.Int { // See https://github.com/ethereum/EIPs/pull/3594 @@ -817,14 +854,15 @@ func requiredBalance(txn *types.TxSlot) *uint256.Int { return maxUint256 } // and https://eips.ethereum.org/EIPS/eip-4844#gas-accounting - if txn.BlobCount != 0 { - maxDataGasCost := uint256.NewInt(chain.DataGasPerBlob) - maxDataGasCost.Mul(maxDataGasCost, uint256.NewInt(txn.BlobCount)) - _, overflow = maxDataGasCost.MulOverflow(maxDataGasCost, &txn.DataFeeCap) + blobCount := uint64(len(txn.BlobHashes)) + if blobCount != 0 { + maxBlobGasCost := uint256.NewInt(fixedgas.BlobGasPerBlob) + maxBlobGasCost.Mul(maxBlobGasCost, uint256.NewInt(blobCount)) + _, overflow = maxBlobGasCost.MulOverflow(maxBlobGasCost, &txn.BlobFeeCap) if overflow { return maxUint256 } - _, overflow = total.AddOverflow(total, maxDataGasCost) + _, overflow = total.AddOverflow(total, maxBlobGasCost) if overflow { return maxUint256 } @@ -900,12 +938,24 @@ func (p *TxPool) ValidateSerializedTxn(serializedTxn []byte) error { // more expensive to propagate; larger transactions also take more resources // to validate whether they fit into the pool or not. txMaxSize = 4 * txSlotSize // 128KB + + // Should be enough for a transaction with 6 blobs + blobTxMaxSize = 800_000 ) - if len(serializedTxn) > txMaxSize { + txType, err := types.PeekTransactionType(serializedTxn) + if err != nil { + return err + } + maxSize := txMaxSize + if txType == types.BlobTxType { + maxSize = blobTxMaxSize + } + if len(serializedTxn) > maxSize { return types.ErrRlpTooBig } return nil } + func (p *TxPool) validateTxs(txs *types.TxSlots, stateCache kvcache.CacheView) (reasons []txpoolcfg.DiscardReason, goodTxs types.TxSlots, err error) { // reasons is pre-sized for direct indexing, with the default zero // value DiscardReason of NotSet @@ -991,7 +1041,7 @@ func (p *TxPool) AddLocalTxs(ctx context.Context, newTransactions types.TxSlots, if !p.Started() { if err := p.fromDB(ctx, tx, coreTx); err != nil { - return nil, fmt.Errorf("loading txs from DB: %w", err) + return nil, fmt.Errorf("AddLocalTxs: loading txs from DB: %w", err) } if p.started.CompareAndSwap(false, true) { p.logger.Info("[txpool] Started") @@ -1188,8 +1238,8 @@ func (p *TxPool) setBaseFee(baseFee uint64) (uint64, bool) { return p.pendingBaseFee.Load(), changed } -// TODO(eip-4844) logic similar to base fee for data gasprice -// DataFeeCap must be >= data gasprice +// TODO(eip-4844) logic similar to base fee for blob gasprice +// BlobFeeCap must be >= blob gasprice func (p *TxPool) addLocked(mt *metaTx, announcements *types.Announcements) txpoolcfg.DiscardReason { // Insert to pending pool, if pool doesn't have txn with same Nonce and bigger Tip @@ -1585,6 +1635,7 @@ func MainLoop(ctx context.Context, db kv.RwDB, coreDB kv.RoDB, p *TxPool, newTxs var remoteTxSizes []uint32 var remoteTxHashes types.Hashes var remoteTxRlps [][]byte + var broadCastedHashes types.Hashes slotsRlp := make([][]byte, 0, announcements.Len()) if err := db.View(ctx, func(tx kv.Tx) error { @@ -1604,8 +1655,10 @@ func MainLoop(ctx context.Context, db kv.RwDB, coreDB kv.RoDB, p *TxPool, newTxs localTxTypes = append(localTxTypes, t) localTxSizes = append(localTxSizes, size) localTxHashes = append(localTxHashes, hash...) + if t != types.BlobTxType { // "Nodes MUST NOT automatically broadcast blob transactions to their peers" - EIP-4844 localTxRlps = append(localTxRlps, slotRlp) + broadCastedHashes = append(broadCastedHashes, hash...) } } else { remoteTxTypes = append(remoteTxTypes, t) @@ -1628,10 +1681,13 @@ func MainLoop(ctx context.Context, db kv.RwDB, coreDB kv.RoDB, p *TxPool, newTxs // first broadcast all local txs to all peers, then non-local to random sqrt(peersAmount) peers txSentTo := send.BroadcastPooledTxs(localTxRlps) + for i, peer := range txSentTo { + p.logger.Info("Local tx broadcasted", "txHash", hex.EncodeToString(broadCastedHashes.At(i)), "to peer", peer) + } hashSentTo := send.AnnouncePooledTxs(localTxTypes, localTxSizes, localTxHashes) for i := 0; i < localTxHashes.Len(); i++ { hash := localTxHashes.At(i) - p.logger.Info("local tx propagated", "tx_hash", hex.EncodeToString(hash), "announced to peers", hashSentTo[i], "broadcast to peers", txSentTo[i], "baseFee", p.pendingBaseFee.Load()) + p.logger.Info("local tx announced", "tx_hash", hex.EncodeToString(hash), "to peer", hashSentTo[i], "baseFee", p.pendingBaseFee.Load()) } send.BroadcastPooledTxs(remoteTxRlps) send.AnnouncePooledTxs(remoteTxTypes, remoteTxSizes, remoteTxHashes) diff --git a/txpool/txpool_grpc_server.go b/txpool/txpool_grpc_server.go index dd003bb0c..178eecceb 100644 --- a/txpool/txpool_grpc_server.go +++ b/txpool/txpool_grpc_server.go @@ -1,5 +1,5 @@ /* - Copyright 2021 Erigon contributors + Copyright 2021 The Erigon contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ var TxPoolAPIVersion = &types2.VersionReply{Major: 1, Minor: 0, Patch: 0} type txPool interface { ValidateSerializedTxn(serializedTxn []byte) error - PeekBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableDataGas uint64) (bool, error) + PeekBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas, availableBlobGas uint64) (bool, error) GetRlp(tx kv.Tx, hash []byte) ([]byte, error) AddLocalTxs(ctx context.Context, newTxs types.TxSlots, tx kv.Tx) ([]txpoolcfg.DiscardReason, error) deprecatedForEach(_ context.Context, f func(rlp []byte, sender common.Address, t SubPoolType), tx kv.Tx) @@ -155,7 +155,7 @@ func (s *GrpcServer) Pending(ctx context.Context, _ *emptypb.Empty) (*txpool_pro reply := &txpool_proto.PendingReply{} reply.Txs = make([]*txpool_proto.PendingReply_Tx, 0, 32) txSlots := types.TxsRlp{} - if _, err := s.txPool.PeekBest(math.MaxInt16, &txSlots, tx, 0 /* onTopOf */, math.MaxUint64 /* availableGas */, math.MaxUint64 /* availableDataGas */); err != nil { + if _, err := s.txPool.PeekBest(math.MaxInt16, &txSlots, tx, 0 /* onTopOf */, math.MaxUint64 /* availableGas */, math.MaxUint64 /* availableBlobGas */); err != nil { return nil, err } var senderArr [20]byte @@ -240,7 +240,7 @@ func mapDiscardReasonToProto(reason txpoolcfg.DiscardReason) txpool_proto.Import return txpool_proto.ImportResult_ALREADY_EXISTS case txpoolcfg.UnderPriced, txpoolcfg.ReplaceUnderpriced, txpoolcfg.FeeTooLow: return txpool_proto.ImportResult_FEE_TOO_LOW - case txpoolcfg.InvalidSender, txpoolcfg.NegativeValue, txpoolcfg.OversizedData, txpoolcfg.InitCodeTooLarge, txpoolcfg.RLPTooLong, txpoolcfg.TxTypeNotSupported, txpoolcfg.CreateBlobTxn, txpoolcfg.NoBlobs, txpoolcfg.TypeNotActivated: + case txpoolcfg.InvalidSender, txpoolcfg.NegativeValue, txpoolcfg.OversizedData, txpoolcfg.InitCodeTooLarge, txpoolcfg.RLPTooLong, txpoolcfg.TxTypeNotSupported, txpoolcfg.CreateBlobTxn, txpoolcfg.NoBlobs, txpoolcfg.TooManyBlobs, txpoolcfg.TypeNotActivated, txpoolcfg.UnequalBlobTxExt, txpoolcfg.BlobHashCheckFail, txpoolcfg.UnmatchedBlobTxExt: // TODO(eip-4844) TypeNotActivated may be transient (e.g. a blob transaction is submitted 1 sec prior to Cancun activation) return txpool_proto.ImportResult_INVALID default: diff --git a/txpool/txpoolcfg/txpoolcfg.go b/txpool/txpoolcfg/txpoolcfg.go index cac39da24..6b0605462 100644 --- a/txpool/txpoolcfg/txpoolcfg.go +++ b/txpool/txpoolcfg/txpoolcfg.go @@ -1,3 +1,19 @@ +/* + Copyright 2022 The Erigon contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package txpoolcfg import ( @@ -6,6 +22,7 @@ import ( "math/big" "time" + "github.com/c2h5oh/datasize" "github.com/ledgerwatch/erigon-lib/common/fixedgas" emath "github.com/ledgerwatch/erigon-lib/common/math" "github.com/ledgerwatch/erigon-lib/types" @@ -24,7 +41,10 @@ type Config struct { MinFeeCap uint64 AccountSlots uint64 // Number of executable transaction slots guaranteed per account PriceBump uint64 // Price bump percentage to replace an already existing transaction - OverrideShanghaiTime *big.Int + OverrideCancunTime *big.Int + MdbxPageSize datasize.ByteSize + MdbxDBSizeLimit datasize.ByteSize + MdbxGrowthStep datasize.ByteSize Optimism bool NoTxGossip bool @@ -40,10 +60,9 @@ var DefaultConfig = Config{ BaseFeeSubPoolLimit: 10_000, QueuedSubPoolLimit: 10_000, - MinFeeCap: 1, - AccountSlots: 16, //TODO: to choose right value (16 to be compatible with Geth) - PriceBump: 10, // Price bump percentage to replace an already existing transaction - OverrideShanghaiTime: nil, + MinFeeCap: 1, + AccountSlots: 16, //TODO: to choose right value (16 to be compatible with Geth) + PriceBump: 10, // Price bump percentage to replace an already existing transaction Optimism: false, NoTxGossip: false, @@ -78,7 +97,11 @@ const ( TypeNotActivated DiscardReason = 23 // For example, an EIP-4844 transaction is submitted before Cancun activation CreateBlobTxn DiscardReason = 24 // Blob transactions cannot have the form of a create transaction NoBlobs DiscardReason = 25 // Blob transactions must have at least one blob - TxTypeNotSupported DiscardReason = 26 + TooManyBlobs DiscardReason = 26 // There's a limit on how many blobs a block (and thus any transaction) may have + UnequalBlobTxExt DiscardReason = 27 // blob_versioned_hashes, blobs, commitments and proofs must have equal number + BlobHashCheckFail DiscardReason = 28 // KZGcommitment's versioned hash has to be equal to blob_versioned_hash at the same index + UnmatchedBlobTxExt DiscardReason = 29 // KZGcommitments must match the corresponding blobs and proofs + TxTypeNotSupported DiscardReason = 30 ) func (r DiscardReason) String() string { @@ -137,6 +160,8 @@ func (r DiscardReason) String() string { return "blob transactions cannot have the form of a create transaction" case NoBlobs: return "blob transactions must have at least one blob" + case TooManyBlobs: + return "max number of blobs exceeded" default: panic(fmt.Sprintf("discard reason: %d", r)) } diff --git a/txpool/txpooluitl/all_components.go b/txpool/txpooluitl/all_components.go index 420c1f439..70db12a28 100644 --- a/txpool/txpooluitl/all_components.go +++ b/txpool/txpooluitl/all_components.go @@ -22,9 +22,9 @@ import ( "time" "github.com/c2h5oh/datasize" + mdbx2 "github.com/erigontech/mdbx-go/mdbx" "github.com/holiman/uint256" "github.com/ledgerwatch/log/v3" - mdbx2 "github.com/torquem-ch/mdbx-go/mdbx" "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/direct" @@ -102,12 +102,29 @@ func SaveChainConfigIfNeed(ctx context.Context, coreDB kv.RoDB, txPoolDB kv.RwDB func AllComponents(ctx context.Context, cfg txpoolcfg.Config, cache kvcache.Cache, newTxs chan types.Announcements, chainDB kv.RoDB, sentryClients []direct.SentryClient, stateChangesClient txpool.StateChangesClient, logger log.Logger) (kv.RwDB, *txpool.TxPool, *txpool.Fetch, *txpool.Send, *txpool.GrpcServer, error) { - txPoolDB, err := mdbx.NewMDBX(log.New()).Label(kv.TxPoolDB).Path(cfg.DBDir). + opts := mdbx.NewMDBX(log.New()).Label(kv.TxPoolDB).Path(cfg.DBDir). WithTableCfg(func(defaultBuckets kv.TableCfg) kv.TableCfg { return kv.TxpoolTablesCfg }). Flags(func(f uint) uint { return f ^ mdbx2.Durable | mdbx2.SafeNoSync }). - GrowthStep(16 * datasize.MB). - SyncPeriod(30 * time.Second). - Open() + SyncPeriod(30 * time.Second) + + if cfg.MdbxPageSize.Bytes() > 0 { + opts = opts.PageSize(cfg.MdbxPageSize.Bytes()) + } + + if cfg.MdbxDBSizeLimit > 0 { + opts = opts.MapSize(cfg.MdbxDBSizeLimit) + } else { + opts = opts.MapSize(1 * datasize.GB) + + } + if cfg.MdbxGrowthStep > 0 { + opts = opts.GrowthStep(cfg.MdbxGrowthStep) + } else { + opts = opts.GrowthStep(16 * datasize.MB) + } + + txPoolDB, err := opts.Open() + if err != nil { return nil, nil, nil, nil, nil, err } @@ -120,10 +137,10 @@ func AllComponents(ctx context.Context, cfg txpoolcfg.Config, cache kvcache.Cach chainID, _ := uint256.FromBig(chainConfig.ChainID) shanghaiTime := chainConfig.ShanghaiTime - if cfg.OverrideShanghaiTime != nil { - shanghaiTime = cfg.OverrideShanghaiTime - } cancunTime := chainConfig.CancunTime + if cfg.OverrideCancunTime != nil { + cancunTime = cfg.OverrideCancunTime + } var pool txpool.Pool txPool, err := txpool.New(newTxs, chainDB, cfg, cache, *chainID, shanghaiTime, cancunTime, logger) diff --git a/types/txn.go b/types/txn.go index ea63358c9..5f4454588 100644 --- a/types/txn.go +++ b/types/txn.go @@ -26,11 +26,13 @@ import ( "math/bits" "sort" + gokzg4844 "github.com/crate-crypto/go-kzg-4844" "github.com/holiman/uint256" "github.com/ledgerwatch/secp256k1" "golang.org/x/crypto/sha3" "github.com/ledgerwatch/erigon-lib/common" + "github.com/ledgerwatch/erigon-lib/common/fixedgas" "github.com/ledgerwatch/erigon-lib/common/length" "github.com/ledgerwatch/erigon-lib/common/u256" "github.com/ledgerwatch/erigon-lib/crypto" @@ -91,16 +93,21 @@ type TxSlot struct { Nonce uint64 // Nonce of the transaction DataLen int // Length of transaction's data (for calculation of intrinsic gas) DataNonZeroLen int - AlAddrCount int // Number of addresses in the access list - AlStorCount int // Number of storage keys in the access list - BlobCount uint64 // Number of blobs contained by the transaction - DataFeeCap uint256.Int // max_fee_per_data_gas in EIP-4844 - Gas uint64 // Gas limit of the transaction - IDHash [32]byte // Transaction hash for the purposes of using it as a transaction Id - Traced bool // Whether transaction needs to be traced throughout transaction pool code and generate debug printing - Creation bool // Set to true if "To" field of the transaction is not set - Type byte // Transaction type - Size uint32 // Size of the payload + AlAddrCount int // Number of addresses in the access list + AlStorCount int // Number of storage keys in the access list + Gas uint64 // Gas limit of the transaction + IDHash [32]byte // Transaction hash for the purposes of using it as a transaction Id + Traced bool // Whether transaction needs to be traced throughout transaction pool code and generate debug printing + Creation bool // Set to true if "To" field of the transaction is not set + Type byte // Transaction type + Size uint32 // Size of the payload + + // EIP-4844: Shard Blob Transactions + BlobFeeCap uint256.Int // max_fee_per_blob_gas + BlobHashes []common.Hash + Blobs [][]byte + Commitments []gokzg4844.KZGCommitment + Proofs []gokzg4844.KZGProof RollupDataGas uint64 // Translates into a L1 cost based on fee parameters } @@ -128,22 +135,29 @@ func (ctx *TxParseContext) ChainIDRequired() *TxParseContext { return ctx } +func PeekTransactionType(serialized []byte) (byte, error) { + dataPos, _, legacy, err := rlp.Prefix(serialized, 0) + if err != nil { + return LegacyTxType, fmt.Errorf("%w: size Prefix: %s", ErrParseTxn, err) //nolint + } + if legacy { + return LegacyTxType, nil + } + return serialized[dataPos], nil +} + // ParseTransaction extracts all the information from the transactions's payload (RLP) necessary to build TxSlot. // It also performs syntactic validation of the transactions. // wrappedWithBlobs means that for blob (type 3) transactions the full version with blobs/commitments/proofs is expected // (see https://eips.ethereum.org/EIPS/eip-4844#networking). func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlot, sender []byte, hasEnvelope, wrappedWithBlobs bool, validateHash func([]byte) error) (p int, err error) { - // TODO(eip-4844) implement blob txn parsing when wrappedWithBlobs is true - if len(payload) == 0 { return 0, fmt.Errorf("%w: empty rlp", ErrParseTxn) } if ctx.withSender && len(sender) != 20 { return 0, fmt.Errorf("%w: expect sender buffer of len 20", ErrParseTxn) } - // Compute transaction hash - ctx.Keccak1.Reset() - ctx.Keccak2.Reset() + // Legacy transactions have list Prefix, whereas EIP-2718 transactions have string Prefix // therefore we assign the first returned value of Prefix function (list) to legacy variable dataPos, dataLen, legacy, err := rlp.Prefix(payload, pos) @@ -162,18 +176,14 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo p = dataPos + var wrapperDataPos, wrapperDataLen int + // If it is non-legacy transaction, the transaction type follows, and then the the list if !legacy { slot.Type = payload[p] if slot.Type > BlobTxType && slot.Type != DepositTxType { return 0, fmt.Errorf("%w: unknown transaction type: %d", ErrParseTxn, slot.Type) } - if _, err = ctx.Keccak1.Write(payload[p : p+1]); err != nil { - return 0, fmt.Errorf("%w: computing IdHash (hashing type Prefix): %s", ErrParseTxn, err) //nolint - } - if _, err = ctx.Keccak2.Write(payload[p : p+1]); err != nil { - return 0, fmt.Errorf("%w: computing signHash (hashing type Prefix): %s", ErrParseTxn, err) //nolint - } p++ if p >= len(payload) { return 0, fmt.Errorf("%w: unexpected end of payload after txType", ErrParseTxn) @@ -182,19 +192,127 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo if err != nil { return 0, fmt.Errorf("%w: envelope Prefix: %s", ErrParseTxn, err) //nolint } - // Hash the envelope, not the full payload - if _, err = ctx.Keccak1.Write(payload[p : dataPos+dataLen]); err != nil { - return 0, fmt.Errorf("%w: computing IdHash (hashing the envelope): %s", ErrParseTxn, err) //nolint - } // For legacy transaction, the entire payload in expected to be in "rlp" field // whereas for non-legacy, only the content of the envelope (start with position p) slot.Rlp = payload[p-1 : dataPos+dataLen] - p = dataPos + + if slot.Type == BlobTxType && wrappedWithBlobs { + p = dataPos + wrapperDataPos = dataPos + wrapperDataLen = dataLen + dataPos, dataLen, err = rlp.List(payload, dataPos) + if err != nil { + return 0, fmt.Errorf("%w: wrapped blob tx: %s", ErrParseTxn, err) //nolint + } + } } else { slot.Type = LegacyTxType slot.Rlp = payload[pos : dataPos+dataLen] } + p, err = ctx.parseTransactionBody(payload, pos, p, slot, sender, validateHash) + if err != nil { + return p, err + } + + if slot.Type == BlobTxType && wrappedWithBlobs { + if p != dataPos+dataLen { + return 0, fmt.Errorf("%w: unexpected leftover after blob tx body", ErrParseTxn) + } + + dataPos, dataLen, err = rlp.List(payload, p) + if err != nil { + return 0, fmt.Errorf("%w: blobs len: %s", ErrParseTxn, err) //nolint + } + blobPos := dataPos + for blobPos < dataPos+dataLen { + blobPos, err = rlp.StringOfLen(payload, blobPos, fixedgas.BlobSize) + if err != nil { + return 0, fmt.Errorf("%w: blob: %s", ErrParseTxn, err) //nolint + } + slot.Blobs = append(slot.Blobs, payload[blobPos:blobPos+fixedgas.BlobSize]) + blobPos += fixedgas.BlobSize + } + if blobPos != dataPos+dataLen { + return 0, fmt.Errorf("%w: extraneous space in blobs", ErrParseTxn) + } + p = blobPos + + dataPos, dataLen, err = rlp.List(payload, p) + if err != nil { + return 0, fmt.Errorf("%w: commitments len: %s", ErrParseTxn, err) //nolint + } + commitmentPos := dataPos + for commitmentPos < dataPos+dataLen { + commitmentPos, err = rlp.StringOfLen(payload, commitmentPos, 48) + if err != nil { + return 0, fmt.Errorf("%w: commitment: %s", ErrParseTxn, err) //nolint + } + var commitment gokzg4844.KZGCommitment + copy(commitment[:], payload[commitmentPos:commitmentPos+48]) + slot.Commitments = append(slot.Commitments, commitment) + commitmentPos += 48 + } + if commitmentPos != dataPos+dataLen { + return 0, fmt.Errorf("%w: extraneous space in commitments", ErrParseTxn) + } + p = commitmentPos + + dataPos, dataLen, err = rlp.List(payload, p) + if err != nil { + return 0, fmt.Errorf("%w: proofs len: %s", ErrParseTxn, err) //nolint + } + proofPos := dataPos + for proofPos < dataPos+dataLen { + proofPos, err = rlp.StringOfLen(payload, proofPos, 48) + if err != nil { + return 0, fmt.Errorf("%w: proof: %s", ErrParseTxn, err) //nolint + } + var proof gokzg4844.KZGProof + copy(proof[:], payload[proofPos:proofPos+48]) + slot.Proofs = append(slot.Proofs, proof) + proofPos += 48 + } + if proofPos != dataPos+dataLen { + return 0, fmt.Errorf("%w: extraneous space in proofs", ErrParseTxn) + } + p = proofPos + + if p != wrapperDataPos+wrapperDataLen { + return 0, fmt.Errorf("%w: extraneous elements in blobs wrapper", ErrParseTxn) + } + } + + slot.Size = uint32(p - pos) + return p, err +} + +func (ctx *TxParseContext) parseTransactionBody(payload []byte, pos, p0 int, slot *TxSlot, sender []byte, validateHash func([]byte) error) (p int, err error) { + p = p0 + legacy := slot.Type == LegacyTxType + + // Compute transaction hash + ctx.Keccak1.Reset() + ctx.Keccak2.Reset() + if !legacy { + typeByte := []byte{slot.Type} + if _, err = ctx.Keccak1.Write(typeByte); err != nil { + return 0, fmt.Errorf("%w: computing IdHash (hashing type Prefix): %s", ErrParseTxn, err) //nolint + } + if _, err = ctx.Keccak2.Write(typeByte); err != nil { + return 0, fmt.Errorf("%w: computing signHash (hashing type Prefix): %s", ErrParseTxn, err) //nolint + } + dataPos, dataLen, err := rlp.List(payload, p) + if err != nil { + return 0, fmt.Errorf("%w: envelope Prefix: %s", ErrParseTxn, err) //nolint + } + // Hash the content of envelope, not the full payload + if _, err = ctx.Keccak1.Write(payload[p : dataPos+dataLen]); err != nil { + return 0, fmt.Errorf("%w: computing IdHash (hashing the envelope): %s", ErrParseTxn, err) //nolint + } + p = dataPos + } + if ctx.validateRlp != nil { if err := ctx.validateRlp(slot.Rlp); err != nil { return p, err @@ -208,7 +326,7 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo return 0, fmt.Errorf("%w: depostTx sourchHash: %s", ErrParseTxn, err) } // From - dataPos, dataLen, err = rlp.String(payload, p) + dataPos, dataLen, err := rlp.String(payload, p) if err != nil { return 0, fmt.Errorf("%w: depostTx from: %s", ErrParseTxn, err) } @@ -320,7 +438,7 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo return 0, fmt.Errorf("%w: gas: %s", ErrParseTxn, err) //nolint } // Next follows the destination address (if present) - dataPos, dataLen, err = rlp.String(payload, p) + dataPos, dataLen, err := rlp.String(payload, p) if err != nil { return 0, fmt.Errorf("%w: to len: %s", ErrParseTxn, err) //nolint } @@ -411,9 +529,9 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo p = dataPos + dataLen } if slot.Type == BlobTxType { - p, err = rlp.U256(payload, p, &slot.DataFeeCap) + p, err = rlp.U256(payload, p, &slot.BlobFeeCap) if err != nil { - return 0, fmt.Errorf("%w: data fee cap: %s", ErrParseTxn, err) //nolint + return 0, fmt.Errorf("%w: blob fee cap: %s", ErrParseTxn, err) //nolint } dataPos, dataLen, err = rlp.List(payload, p) if err != nil { @@ -421,12 +539,12 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo } hashPos := dataPos for hashPos < dataPos+dataLen { - hashPos, err = rlp.StringOfLen(payload, hashPos, 32) + var hash common.Hash + hashPos, err = rlp.ParseHash(payload, hashPos, hash[:]) if err != nil { return 0, fmt.Errorf("%w: blob hash: %s", ErrParseTxn, err) //nolint } - slot.BlobCount++ - hashPos += 32 + slot.BlobHashes = append(slot.BlobHashes, hash) } if hashPos != dataPos+dataLen { return 0, fmt.Errorf("%w: extraneous space in the blob versioned hashes", ErrParseTxn) @@ -586,7 +704,6 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo //take last 20 bytes as address copy(sender, ctx.buf[12:32]) - slot.Size = uint32(p - pos) return p, nil } diff --git a/types/txn_test.go b/types/txn_test.go index c8f88b779..b5e992d49 100644 --- a/types/txn_test.go +++ b/types/txn_test.go @@ -18,13 +18,16 @@ package types import ( "bytes" + "crypto/rand" "strconv" "testing" + gokzg4844 "github.com/crate-crypto/go-kzg-4844" "github.com/holiman/uint256" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/ledgerwatch/erigon-lib/common/fixedgas" "github.com/ledgerwatch/erigon-lib/common/hexutility" ) @@ -175,3 +178,114 @@ func toHashes(h ...byte) (out Hashes) { } return out } + +func TestBlobTxParsing(t *testing.T) { + // First parse a blob transaction body (no blobs/commitments/proofs) + wrappedWithBlobs := false + // Some arbitrary hardcoded example + bodyRlpHex := "f9012705078502540be4008506fc23ac008357b58494811a752c8cd697e3cb27" + + "279c330ed1ada745a8d7808204f7f872f85994de0b295669a9fd93d5f28d9ec85e40f4cb697b" + + "aef842a00000000000000000000000000000000000000000000000000000000000000003a000" + + "00000000000000000000000000000000000000000000000000000000000007d694bb9bc244d7" + + "98123fde783fcc1c72d3bb8c189413c07bf842a0c6bdd1de713471bd6cfa62dd8b5a5b42969e" + + "d09e26212d3377f3f8426d8ec210a08aaeccaf3873d07cef005aca28c39f8a9f8bdb1ec8d79f" + + "fc25afc0a4fa2ab73601a036b241b061a36a32ab7fe86c7aa9eb592dd59018cd0443adc09035" + + "90c16b02b0a05edcc541b4741c5cc6dd347c5ed9577ef293a62787b4510465fadbfe39ee4094" + bodyRlp := hexutility.MustDecodeHex(bodyRlpHex) + + hasEnvelope := true + bodyEnvelope := hexutility.MustDecodeHex("b9012b03") + bodyEnvelope = append(bodyEnvelope, bodyRlp...) + + ctx := NewTxParseContext(*uint256.NewInt(5)) + ctx.withSender = false + + var thinTx TxSlot // only tx body, no blobs + txType, err := PeekTransactionType(bodyEnvelope) + require.NoError(t, err) + assert.Equal(t, BlobTxType, txType) + + p, err := ctx.ParseTransaction(bodyEnvelope, 0, &thinTx, nil, hasEnvelope, wrappedWithBlobs, nil) + require.NoError(t, err) + assert.Equal(t, len(bodyEnvelope), p) + assert.Equal(t, len(bodyEnvelope), int(thinTx.Size)) + assert.Equal(t, bodyEnvelope[3:], thinTx.Rlp) + assert.Equal(t, BlobTxType, thinTx.Type) + assert.Equal(t, 2, len(thinTx.BlobHashes)) + assert.Equal(t, 0, len(thinTx.Blobs)) + assert.Equal(t, 0, len(thinTx.Commitments)) + assert.Equal(t, 0, len(thinTx.Proofs)) + + // Now parse the same tx body, but wrapped with blobs/commitments/proofs + wrappedWithBlobs = true + hasEnvelope = false + + blobsRlpPrefix := hexutility.MustDecodeHex("fa040008") + blobRlpPrefix := hexutility.MustDecodeHex("ba020000") + blob0 := make([]byte, fixedgas.BlobSize) + rand.Read(blob0) + blob1 := make([]byte, fixedgas.BlobSize) + rand.Read(blob1) + + proofsRlpPrefix := hexutility.MustDecodeHex("f862") + var commitment0, commitment1 gokzg4844.KZGCommitment + rand.Read(commitment0[:]) + rand.Read(commitment1[:]) + var proof0, proof1 gokzg4844.KZGProof + rand.Read(proof0[:]) + rand.Read(proof1[:]) + + wrapperRlp := hexutility.MustDecodeHex("03fa0401fe") + wrapperRlp = append(wrapperRlp, bodyRlp...) + wrapperRlp = append(wrapperRlp, blobsRlpPrefix...) + wrapperRlp = append(wrapperRlp, blobRlpPrefix...) + wrapperRlp = append(wrapperRlp, blob0...) + wrapperRlp = append(wrapperRlp, blobRlpPrefix...) + wrapperRlp = append(wrapperRlp, blob1...) + wrapperRlp = append(wrapperRlp, proofsRlpPrefix...) + wrapperRlp = append(wrapperRlp, 0xb0) + wrapperRlp = append(wrapperRlp, commitment0[:]...) + wrapperRlp = append(wrapperRlp, 0xb0) + wrapperRlp = append(wrapperRlp, commitment1[:]...) + wrapperRlp = append(wrapperRlp, proofsRlpPrefix...) + wrapperRlp = append(wrapperRlp, 0xb0) + wrapperRlp = append(wrapperRlp, proof0[:]...) + wrapperRlp = append(wrapperRlp, 0xb0) + wrapperRlp = append(wrapperRlp, proof1[:]...) + + var fatTx TxSlot // with blobs/commitments/proofs + txType, err = PeekTransactionType(wrapperRlp) + require.NoError(t, err) + assert.Equal(t, BlobTxType, txType) + + p, err = ctx.ParseTransaction(wrapperRlp, 0, &fatTx, nil, hasEnvelope, wrappedWithBlobs, nil) + require.NoError(t, err) + assert.Equal(t, len(wrapperRlp), p) + assert.Equal(t, len(wrapperRlp), int(fatTx.Size)) + assert.Equal(t, wrapperRlp, fatTx.Rlp) + assert.Equal(t, BlobTxType, fatTx.Type) + + assert.Equal(t, thinTx.Value, fatTx.Value) + assert.Equal(t, thinTx.Tip, fatTx.Tip) + assert.Equal(t, thinTx.FeeCap, fatTx.FeeCap) + assert.Equal(t, thinTx.Nonce, fatTx.Nonce) + assert.Equal(t, thinTx.DataLen, fatTx.DataLen) + assert.Equal(t, thinTx.DataNonZeroLen, fatTx.DataNonZeroLen) + assert.Equal(t, thinTx.AlAddrCount, fatTx.AlAddrCount) + assert.Equal(t, thinTx.AlStorCount, fatTx.AlStorCount) + assert.Equal(t, thinTx.Gas, fatTx.Gas) + assert.Equal(t, thinTx.IDHash, fatTx.IDHash) + assert.Equal(t, thinTx.Creation, fatTx.Creation) + assert.Equal(t, thinTx.BlobFeeCap, fatTx.BlobFeeCap) + assert.Equal(t, thinTx.BlobHashes, fatTx.BlobHashes) + + require.Equal(t, 2, len(fatTx.Blobs)) + require.Equal(t, 2, len(fatTx.Commitments)) + require.Equal(t, 2, len(fatTx.Proofs)) + assert.Equal(t, blob0, fatTx.Blobs[0]) + assert.Equal(t, blob1, fatTx.Blobs[1]) + assert.Equal(t, commitment0, fatTx.Commitments[0]) + assert.Equal(t, commitment1, fatTx.Commitments[1]) + assert.Equal(t, proof0, fatTx.Proofs[0]) + assert.Equal(t, proof1, fatTx.Proofs[1]) +}