diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a18454ce..63c72b97 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,11 +5,12 @@ name: Go on: push: - branches: [ "main" ] + branches: + - "main" + - "dev" pull_request: jobs: - build: runs-on: ubuntu-latest steps: @@ -35,8 +36,13 @@ jobs: - name: Run staticcheck run: staticcheck ./... - - name: Install golint - run: go install golang.org/x/lint/golint@latest + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.60 + + - name: Run golangci-lint + run: golangci-lint run ./... - name: Test run: go test -race -vet=off -v ./... diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..5a06b6b5 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,367 @@ +# This code is licensed under the terms of the MIT license https://opensource.org/license/mit +# Copyright (c) 2021 Marat Reymers + +## Golden config for golangci-lint v1.59.1 +# +# This is the best config for golangci-lint based on my experience and opinion. +# It is very strict, but not extremely strict. +# Feel free to adapt and change it for your needs. + +run: + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 3m + + +# This file contains only configs which differ from defaults. +# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml +linters-settings: + gosec: + excludes: + - G115 # integer overflow conversion int -> uint8 (gosec) + revive: + ignore-generated-header: true + severity: warning + rules: + - name: indent-error-flow + severity: warning + - name: exported + severity: warning + - name: duplicated-imports + severity: warning + - name: empty-block + severity: warning + + cyclop: + # The maximal code complexity to report. + # Default: 10 + max-complexity: 30 + # The maximal average package complexity. + # If it's higher than 0.0 (float) the check is enabled + # Default: 0.0 + package-average: 10.0 + + errcheck: + # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. + # Such cases aren't reported by default. + # Default: false + check-type-assertions: true + + exhaustive: + # Program elements to check for exhaustiveness. + # Default: [ switch ] + check: + - switch + - map + + exhaustruct: + # List of regular expressions to exclude struct packages and their names from checks. + # Regular expressions must match complete canonical struct package/name/structname. + # Default: [] + exclude: + # std libs + - "^net/http.Client$" + - "^net/http.Cookie$" + - "^net/http.Request$" + - "^net/http.Response$" + - "^net/http.Server$" + - "^net/http.Transport$" + - "^net/url.URL$" + - "^os/exec.Cmd$" + - "^reflect.StructField$" + # public libs + - "^github.com/Shopify/sarama.Config$" + - "^github.com/Shopify/sarama.ProducerMessage$" + - "^github.com/mitchellh/mapstructure.DecoderConfig$" + - "^github.com/prometheus/client_golang/.+Opts$" + - "^github.com/spf13/cobra.Command$" + - "^github.com/spf13/cobra.CompletionOptions$" + - "^github.com/stretchr/testify/mock.Mock$" + - "^github.com/testcontainers/testcontainers-go.+Request$" + - "^github.com/testcontainers/testcontainers-go.FromDockerfile$" + - "^golang.org/x/tools/go/analysis.Analyzer$" + - "^google.golang.org/protobuf/.+Options$" + - "^gopkg.in/yaml.v3.Node$" + + funlen: + # Checks the number of lines in a function. + # If lower than 0, disable the check. + # Default: 60 + lines: 100 + # Checks the number of statements in a function. + # If lower than 0, disable the check. + # Default: 40 + statements: 50 + # Ignore comments when counting lines. + # Default false + ignore-comments: true + + gocognit: + # Minimal code complexity to report. + # Default: 30 (but we recommend 10-20) + min-complexity: 20 + + gocritic: + # Settings passed to gocritic. + # The settings key is the name of a supported gocritic checker. + # The list of supported checkers can be find in https://go-critic.github.io/overview. + settings: + captLocal: + # Whether to restrict checker to params only. + # Default: true + paramsOnly: false + underef: + # Whether to skip (*x).method() calls where x is a pointer receiver. + # Default: true + skipRecvDeref: false + + gomodguard: + blocked: + # List of blocked modules. + # Default: [] + modules: + - github.com/golang/protobuf: + recommendations: + - google.golang.org/protobuf + reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules" + - github.com/satori/go.uuid: + recommendations: + - github.com/google/uuid + reason: "satori's package is not maintained" + - github.com/gofrs/uuid: + recommendations: + - github.com/gofrs/uuid/v5 + reason: "gofrs' package was not go module before v5" + + govet: + # Enable all analyzers. + # Default: false + enable-all: true + # Disable analyzers by name. + # Run `go tool vet help` to see all analyzers. + # Default: [] + disable: + - fieldalignment # too strict + # Settings per analyzer. + settings: + shadow: + # Whether to be strict about shadowing; can be noisy. + # Default: false + strict: true + + inamedparam: + # Skips check for interface methods with only a single parameter. + # Default: false + skip-single-param: true + + mnd: + # List of function patterns to exclude from analysis. + # Values always ignored: `time.Date`, + # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`, + # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`. + # Default: [] + ignored-functions: + - args.Error + - flag.Arg + - flag.Duration.* + - flag.Float.* + - flag.Int.* + - flag.Uint.* + - os.Chmod + - os.Mkdir.* + - os.OpenFile + - os.WriteFile + - prometheus.ExponentialBuckets.* + - prometheus.LinearBuckets + + nakedret: + # Make an issue if func has more lines of code than this setting, and it has naked returns. + # Default: 30 + max-func-lines: 0 + + nolintlint: + # Exclude following linters from requiring an explanation. + # Default: [] + allow-no-explanation: [ funlen, gocognit, lll ] + # Enable to require an explanation of nonzero length after each nolint directive. + # Default: false + require-explanation: true + # Enable to require nolint directives to mention the specific linter being suppressed. + # Default: false + require-specific: true + + perfsprint: + # Optimizes into strings concatenation. + # Default: true + strconcat: false + + rowserrcheck: + # database/sql is always checked + # Default: [] + packages: + - github.com/jmoiron/sqlx + + sloglint: + # Enforce not using global loggers. + # Values: + # - "": disabled + # - "all": report all global loggers + # - "default": report only the default slog logger + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global + # Default: "" + no-global: "all" + # Enforce using methods that accept a context. + # Values: + # - "": disabled + # - "all": report all contextless calls + # - "scope": report only if a context exists in the scope of the outermost function + # https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only + # Default: "" + context: "scope" + + tenv: + # The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures. + # Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked. + # Default: false + all: true + + +linters: + disable-all: true + enable: + ## enabled by default +# - errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases + - gosimple # specializes in simplifying a code +# - govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string + - ineffassign # detects when assignments to existing variables are not used + - staticcheck # is a go vet on steroids, applying a ton of static analysis checks + - typecheck # like the front-end of a Go compiler, parses and type-checks Go code + - unused # checks for unused constants, variables, functions and types + ## disabled by default + - asasalint # checks for pass []any as any in variadic func(...any) + - asciicheck # checks that your code does not contain non-ASCII identifiers + - bidichk # checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + - canonicalheader # checks whether net/http.Header uses canonical header +# - copyloopvar # detects places where loop variables are copied +# - cyclop # checks function and package cyclomatic complexity + - dupl # tool for code clone detection + - durationcheck # checks for two durations multiplied together +# - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error +# - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13 +# - exhaustive # checks exhaustiveness of enum switch statements +# - exportloopref # checks for pointers to enclosing loop variables + - fatcontext # detects nested contexts in loops +# - forbidigo # forbids identifiers +# - funlen # tool for detection of long functions + - gocheckcompilerdirectives # validates go compiler directive comments (//go:) +# - gochecknoglobals # checks that no global variables exist +# - gochecknoinits # checks that no init functions are present in Go code) + - gochecksumtype # checks exhaustiveness on Go "sum types" +# - gocognit # computes and checks the cognitive complexity of functions + - goconst # finds repeated strings that could be replaced by a constant + - gocritic # provides diagnostics that check for bugs, performance and style issues +# - gocyclo # computes and checks the cyclomatic complexity of functions +# - godot # checks if comments end in a period + - goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt +# - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod + - gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations + - goprintffuncname # checks that printf-like functions are named with f at the end + - gosec # inspects source code for security problems +# - intrange # finds places where for loops could make use of an integer range +# - lll # reports long lines + - loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap) + - makezero # finds slice declarations with non-zero initial length + - mirror # reports wrong mirror patterns of bytes/strings usage +# - mnd # detects magic numbers +# - musttag # enforces field tags in (un)marshaled structs + - nakedret # finds naked returns in functions greater than a specified function length +# - nestif # reports deeply nested if statements + - nilerr # finds the code that returns nil even if it checks that the error is not nil +# - nilnil # checks that there is no simultaneous return of nil error and an invalid value + - noctx # finds sending http request without context.Context + - nolintlint # reports ill-formed or insufficient nolint directives +# - nonamedreturns # reports all named returns + - nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL +# - perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative +# - predeclared # finds code that shadows one of Go's predeclared identifiers +# - promlinter # checks Prometheus metrics naming via promlint +# - protogetter # reports direct reads from proto message fields when getters should be used +# - reassign # checks that package variables are not reassigned + - revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint +# - rowserrcheck # checks whether Err of rows is checked successfully +# - sloglint # ensure consistent code style when using log/slog +# - spancheck # checks for mistakes with OpenTelemetry/Census spans +# - sqlclosecheck # checks that sql.Rows and sql.Stmt are closed +# - stylecheck # is a replacement for golint +# - tenv # detects using os.Setenv instead of t.Setenv since Go1.17 + - testableexamples # checks if examples are testable (have an expected output) +# - testifylint # checks usage of github.com/stretchr/testify +# - testpackage # makes you use a separate _test package +# - tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes +# - unconvert # removes unnecessary type conversions +# - unparam # reports unused function parameters +# - usestdlibvars # detects the possibility to use variables/constants from the Go standard library +# - wastedassign # finds wasted assignment statements +# - whitespace # detects leading and trailing whitespace + + ## you may want to enable + #- decorder # checks declaration order and count of types, constants, variables and functions + #- exhaustruct # [highly recommend to enable] checks if all structure fields are initialized + #- gci # controls golang package import order and makes it always deterministic + #- ginkgolinter # [if you use ginkgo/gomega] enforces standards of using ginkgo and gomega + #- godox # detects FIXME, TODO and other comment keywords + #- goheader # checks is file header matches to pattern + #- inamedparam # [great idea, but too strict, need to ignore a lot of cases by default] reports interfaces with unnamed method parameters + #- interfacebloat # checks the number of methods inside an interface + #- ireturn # accept interfaces, return concrete types + #- prealloc # [premature optimization, but can be used in some cases] finds slice declarations that could potentially be preallocated + #- tagalign # checks that struct tags are well aligned + #- varnamelen # [great idea, but too many false positives] checks that the length of a variable's name matches its scope + #- wrapcheck # checks that errors returned from external packages are wrapped + #- zerologlint # detects the wrong usage of zerolog that a user forgets to dispatch zerolog.Event + + ## disabled + #- containedctx # detects struct contained context.Context field + #- contextcheck # [too many false positives] checks the function whether use a non-inherited context + #- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages + #- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) + #- dupword # [useless without config] checks for duplicate words in the source code + #- err113 # [too strict] checks the errors handling expressions + #- errchkjson # [don't see profit + I'm against of omitting errors like in the first example https://github.com/breml/errchkjson] checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted + #- execinquery # [deprecated] checks query string in Query function which reads your Go src files and warning it finds + #- forcetypeassert # [replaced by errcheck] finds forced type assertions + #- gofmt # [replaced by goimports] checks whether code was gofmt-ed + #- gofumpt # [replaced by goimports, gofumports is not available yet] checks whether code was gofumpt-ed + #- gosmopolitan # reports certain i18n/l10n anti-patterns in your Go codebase + #- grouper # analyzes expression groups + #- importas # enforces consistent import aliases + #- maintidx # measures the maintainability index of each function + #- misspell # [useless] finds commonly misspelled English words in comments + #- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity + #- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test + #- tagliatelle # checks the struct tags + #- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers + #- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines + + +issues: + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 50 + + exclude-rules: + - source: "(noinspection|TODO)" + linters: [ godot ] + - source: "//noinspection" + linters: [ gocritic ] + - path: "_test\\.go" + linters: + - bodyclose + - dupl + - funlen + - goconst + - gosec + - noctx + - wrapcheck diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..67fe8cee --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,132 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..b70594e0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,81 @@ +# Contributing to SLIDE SDK + +First off, thank you for considering contributing to SLIDE SDK! It's people like you that make SLIDE SDK such a great tool. + +## Code of Conduct + +By participating in this project, you are expected to uphold our [Code of Conduct](CODE_OF_CONDUCT.md). Please note that this project is released with a Contributor Code of Conduct. By participating, you agree to abide by its terms. + +## Important Note + +SLIDE SDK is licensed under the Business Source License 1.1 (BUSL-1.1). Please make sure you understand the implications of this license before contributing. + +## How Can I Contribute? + +### Reporting Bugs + +- Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/LandslideNetwork/landslidevm/issues). +- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/LandslideNetwork/landslidevm/issues/new). Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. + +### Suggesting Enhancements + +- Open a new issue with a clear title and detailed description of the suggested enhancement. +- Provide any relevant examples or use cases that support your suggestion. + +### Pull Requests + +1. Fork the repository. +2. Create a new branch for your feature or bug fix. +3. Ensure your code adheres to our coding standards. +4. If you've added code that should be tested, add tests. +5. Ensure the test suite passes. +6. Make sure your code lints. +7. Open a pull request with a clear description of your changes. +8. Reference any related issues in your pull request. + +## Development Setup and Testing + +For development setup and testing instructions, please follow our docs at: +https://docs.landslide.network/ + +## Styleguides + +### Git Commit Messages + +- Use the present tense ("Add feature" not "Added feature") +- Use the imperative mood ("Move cursor to..." not "Moves cursor to...") +- Limit the first line to 72 characters or less +- Reference issues and pull requests liberally after the first line + +### Go Styleguide + +We follow the [Effective Go](https://golang.org/doc/effective_go) guidelines and [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) for our Go code. Please ensure your contributions adhere to these standards. + +### Documentation Styleguide + +- Use [Markdown](https://www.markdownguide.org/) for documentation. +- Write clear, concise, and grammatically correct content. +- Use headers to organize content hierarchically. +- Include code examples where appropriate, using proper syntax highlighting. +- Keep documentation up-to-date with code changes. + +## Issue and Pull Request Labels + +We use the following labels to categorize issues and pull requests: + +- `bug`: Indicates an unexpected problem or unintended behavior +- `enhancement`: Indicates new feature requests or improvements to existing features +- `documentation`: Relates to improvements or additions to documentation +- `good first issue`: Good for newcomers to the project +- `help wanted`: Extra attention is needed +- `question`: Further information is requested +- `security`: Relates to security issues +- `performance`: Addresses performance-related aspects +- `refactor`: Code refactoring without changing functionality +- `test`: Relates to testing infrastructure or test cases + +## Questions? + +If you have any questions, please feel free to contact the project maintainers. + +Thank you for contributing to SLIDE SDK! diff --git a/LICENSE b/LICENSE index 7f4c2aec..e28d4963 100644 --- a/LICENSE +++ b/LICENSE @@ -9,7 +9,7 @@ Parameters Licensor: Gaia Labs LTD -Licensed Work: CosmosAVAX V1 / LandslideVM +Licensed Work: Slide SDK V1.0.0 / LandslideVM The Licensed Work is (c) 2024 Gaia Labs LTD Additional Use Grant: Any uses listed and defined at diff --git a/README.md b/README.md index 1f31537d..ac9a91ed 100644 --- a/README.md +++ b/README.md @@ -1 +1,57 @@ -# landslidevm \ No newline at end of file +# Slide SDK +![Slide SDK](https://media.publit.io/file/Landslide/Github/Slide-SDK.png) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) + +LandslideVM is a custom virtual machine designed for AvalancheGo. It enables the execution of Cosmos SDK chains on the Avalanche network by emulating the CometBFT consensus mechanism. This innovative VM allows for the execution of Cosmos SDK chains and interaction with Cosmos modules while being secured by the Avalanche consensus protocol. + +## Important Disclaimer + +**Landslide is currently in testnet with the release of SlideSDK. Please expect bumps in the road as we continue to develop and refine the system. Use at your own risk and do not use for production environments at this stage.** + +## Security Audit +The SLIDE SDK has been audited by Oak Security. You can view the full audit report [here](https://github.com/oak-security/audit-reports/blob/main/Slide%20SDK/2024-09-20%20Audit%20Report%20-%20Slide%20SDK%20v1.1.pdf). + +## Features + +- Execute Cosmos SDK chains on Avalanche +- Emulate CometBFT consensus +- Interact with Cosmos modules +- Secured by Avalanche consensus + +## Dependencies + +LandslideVM relies on the following major dependencies: + +- Go v 1.22.7 +- Cosmos SDK 0.50.9 (https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.9) +- AvalancheGo v1.11.11 (https://github.com/ava-labs/avalanchego/releases/tag/v1.11.11) + +Please ensure you have the latest versions of these dependencies installed to avoid any known vulnerabilities. + +## Installation + +Please follow our docs for installation: (https://docs.landslide.network/) + +## Security + +LandslideVM has undergone a security audit by Oak Security GmbH. While efforts have been made to address identified issues, users should exercise caution and understand the following: + +- The VM facilitates complex communications with AvalancheGo and implements emulation of CometBFT functionalities. +- Some Cosmos SDK modules that rely on validator information may have limited functionality due to the emulation of the consensus mechanism. +- Node operators should be careful about which gRPC endpoints are exposed publicly. + +For a full understanding of the security considerations, please refer to the complete audit report. + +## Contributing + +We welcome contributions to the Slide SDK! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) file for details on how to contribute. + +## License + +Slide SDK v0.1 is licensed under the [Business Source License 1.1](./LICENSE). Please see the [LICENSE](./LICENSE) file for details. + +## Disclaimer + +THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USE AT YOUR OWN RISK. AS MENTIONED ABOVE, LANDSLIDE IS CURRENTLY IN TESTNET AND MAY EXPERIENCE INSTABILITY OR UNEXPECTED BEHAVIOR. + +For more information about LandslideVM, please [contact us/visit our website]. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..e086cfac --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,66 @@ +# 🌊 Riding the Wave of Security + +Welcome to the Slide SDK security policy, where we turn haters into heroes! We're all about catching those gnarly bugs before they wipe us out. Remember, we're still shredding on the testnet, so your help in spotting issues is totally tubular! + +## Security Audit +The SLIDE SDK has been audited by Oak Security. You can view the full audit report [here](https://github.com/oak-security/audit-reports/blob/main/Slide%20SDK/2024-09-20%20Audit%20Report%20-%20Slide%20SDK%20v1.1.pdf). + +## 🎯 Scope + +| Version | Supported | +|---------|---------------------| +| Latest Release | 🛝 [v1.0.0](https://github.com/LandslideNetwork/slide-sdk/releases/tag/v1.0.0) | +| Main Branch | 🏄‍♀️ 🛝 [v1.0.0](https://github.com/LandslideNetwork/slide-sdk/releases/tag/v1.0.0) | + +Security vulnerabilities should be reported if they can be reproduced on either the latest release or the main branch. + +## 🕵️‍♂️ Calling All Haters with Benefits! + +Found a bug? Don't just hate, participate! Here's how you can help us hang ten and keep Slide SDK secure: + +1. **Public Reporting**: Since we're riding the testnet waves, we're open to public vulnerability reports. Feel free to open an issue on our GitHub repo with the tag [SECURITY]. This helps us build a transparent and collaborative security culture. +2. **Sensitive Issues**: For vulnerabilities that might have severe implications even on testnet (like potential economic exploits or privacy breaches), please email us at security@landslidelabs.org with the subject "Confidential Hater's Bug Report: [Brief Description]". +3. **Details, dude**: Whether public or private, give us the 411 on the bug. Include reproduction steps and all the juicy details. +4. **Collaboration**: Let's ride this wave together. We might need more info, so stay tuned and be ready to dive deeper into the issue with us. +5. **Responsible Disclosure**: For email reports, keep it on the down-low until we give the all-clear. For public issues, we'll work together in the open, but avoid sharing exploit details that could be misused. + +Remember, while we're stoked about open collaboration, we reserve the right to remove or edit any reports that we feel could pose an immediate risk to our gnarly community. + +## 🏆 Rewards for Rad Haters + +For verified, radical bug finds, we're dishing out SLIDE tokens faster than a surfer catches a wave! The bigger the wipeout you help us avoid, the more tokens you'll slide into. + +| Bug Severity | Reward | +|--------------|----------------------------| +| Critical | $10,000 in SLIDE + 🏆 | +| High | $5,000 in SLIDE + 🥈 | +| Medium | $2,500 in SLIDE + 🥉 | +| Low | $1,000 in SLIDE + 🤙 | + +## 🤙 Surfer's Code of Conduct + +We require all our rad researchers to: + +- Abide by this policy and be mindful about sharing vulnerability info responsibly. +- Make every effort to avoid privacy violations, disruption to our gnarly systems, and destruction of data. +- Keep vulnerability info confidential if reported via email, until we've caught and surfed that bug. +- Avoid posting personally identifiable information, privately or publicly. + +If you follow these guidelines when reporting an issue to us, we commit to: + +- Not pursue or support any legal action related to your research on this vulnerability. +- Work with you to understand, resolve, and ultimately disclose the issue in a timely fashion. + +## 🚫 No Bad Vibes Zone + +While we love our Haters (with Benefits), we keep it cool here. Hate speech or any form of discrimination won't be tolerated and will be wiped out faster than a kook on a big wave. Let's keep our community respectful and inclusive dudes! + +## 🌴 More Info + +As we continue to ride the testnet waves, we're constantly improving our security processes. Stay tuned for more detailed information on our disclosure timeline, process, and examples of vulnerabilities we're particularly interested in. + +## 🏄‍♂️ Transition to Mainnet + +Heads up, beach bums! This open policy is specific to our testnet phase. As we paddle towards mainnet, we'll be updating our security policy to ensure we're ready for the big leagues. Stay tuned for updates! + +Stay groovy, stay secure! Slide on board, dudes! 🏄‍♂️🌊🛹 diff --git a/database/batch.go b/database/batch.go index 11aa4d6b..cda212d9 100644 --- a/database/batch.go +++ b/database/batch.go @@ -5,7 +5,7 @@ import ( "slices" dbm "github.com/cometbft/cometbft-db" - "github.com/consideritdone/landslidevm/proto/rpcdb" + "github.com/landslidenetwork/slide-sdk/proto/rpcdb" ) var ( diff --git a/database/database.go b/database/database.go index a4b61b75..8fcd14ab 100644 --- a/database/database.go +++ b/database/database.go @@ -5,7 +5,8 @@ import ( "sync/atomic" dbm "github.com/cometbft/cometbft-db" - "github.com/consideritdone/landslidevm/proto/rpcdb" + + "github.com/landslidenetwork/slide-sdk/proto/rpcdb" ) var ( @@ -115,11 +116,11 @@ func (db *Database) NewBatch() dbm.Batch { } func (db *Database) Print() error { - //TODO implement me + // TODO implement me return nil } func (db *Database) Stats() map[string]string { - //TODO implement me + // TODO implement me return nil } diff --git a/database/error.go b/database/error.go index 45e59367..e2f3f0ae 100644 --- a/database/error.go +++ b/database/error.go @@ -3,7 +3,7 @@ package database import ( "errors" - "github.com/consideritdone/landslidevm/proto/rpcdb" + "github.com/landslidenetwork/slide-sdk/proto/rpcdb" ) var ( diff --git a/database/iterator.go b/database/iterator.go index fd8cda4d..2397cbe0 100644 --- a/database/iterator.go +++ b/database/iterator.go @@ -5,7 +5,7 @@ import ( "sync" dbm "github.com/cometbft/cometbft-db" - "github.com/consideritdone/landslidevm/proto/rpcdb" + "github.com/landslidenetwork/slide-sdk/proto/rpcdb" ) var ( diff --git a/example/kvstore/kvstore.go b/example/kvstore/kvstore.go index aced4de9..4d6df052 100644 --- a/example/kvstore/kvstore.go +++ b/example/kvstore/kvstore.go @@ -6,12 +6,19 @@ import ( "github.com/cometbft/cometbft/abci/example/kvstore" - "github.com/consideritdone/landslidevm" + "github.com/landslidenetwork/slide-sdk/server" + "github.com/landslidenetwork/slide-sdk/vm" ) func main() { - appCreator := landslidevm.NewLocalAppCreator(kvstore.NewInMemoryApplication()) - if err := landslidevm.Serve(context.Background(), appCreator); err != nil { + appCreator := KvStoreCreator() + if err := server.Serve(context.Background(), appCreator); err != nil { panic(fmt.Sprintf("can't serve application: %s", err)) } } + +func KvStoreCreator() vm.AppCreator { + return func(config *vm.AppCreatorOpts) (vm.Application, error) { + return kvstore.NewPersistentApplication(config.ChainDataDir), nil + } +} diff --git a/example/wasm/main.go b/example/wasm/main.go index b892087d..e65e2720 100644 --- a/example/wasm/main.go +++ b/example/wasm/main.go @@ -2,39 +2,248 @@ package main import ( "context" + "encoding/json" "fmt" + "net" "os" + "os/signal" + "strconv" + "syscall" "cosmossdk.io/log" "github.com/CosmWasm/wasmd/app" "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + rpchttp "github.com/cometbft/cometbft/rpc/client/http" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/server/api" + srvconfig "github.com/cosmos/cosmos-sdk/server/config" + servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" - "github.com/consideritdone/landslidevm" + sdkserver "github.com/landslidenetwork/slide-sdk/server" + "github.com/landslidenetwork/slide-sdk/utils/ids" + "github.com/landslidenetwork/slide-sdk/vm" + vmtypes "github.com/landslidenetwork/slide-sdk/vm/types" ) +// AppConfig is a Wasm App Config +type AppConfig struct { + RPCPort uint16 `json:"rpc_port"` + GRPCPort uint16 `json:"grpc_port"` + APIPort uint16 `json:"api_port"` + APIHost string `json:"api_host"` +} + func main() { - db, err := dbm.NewDB("dbName", dbm.MemDBBackend, "") - if err != nil { - panic(err) - } - logger := log.NewNopLogger() - - cfg := sdk.GetConfig() - cfg.SetBech32PrefixForAccount(app.Bech32PrefixAccAddr, app.Bech32PrefixAccPub) - cfg.SetBech32PrefixForValidator(app.Bech32PrefixValAddr, app.Bech32PrefixValPub) - cfg.SetBech32PrefixForConsensusNode(app.Bech32PrefixConsAddr, app.Bech32PrefixConsPub) - cfg.SetAddressVerifier(wasmtypes.VerifyAddressLen()) - cfg.Seal() - wasmApp := app.NewWasmApp(logger, db, nil, true, sims.NewAppOptionsWithFlagHome(os.TempDir()), []keeper.Option{}, baseapp.SetChainID("landslide-test")) - - appCreator := landslidevm.NewLocalAppCreator(server.NewCometABCIWrapper(wasmApp)) - if err := landslidevm.Serve(context.Background(), appCreator); err != nil { + appCreator := WasmCreator() + if err := sdkserver.Serve(context.Background(), appCreator); err != nil { panic(fmt.Sprintf("can't serve application: %s", err)) } } + +func WasmCreator() vm.AppCreator { + return func(config *vm.AppCreatorOpts) (vm.Application, error) { + db, err := dbm.NewDB("wasm", dbm.GoLevelDBBackend, config.ChainDataDir) + if err != nil { + panic(err) + } + logger := log.NewNopLogger() + + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(app.Bech32PrefixAccAddr, app.Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(app.Bech32PrefixValAddr, app.Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(app.Bech32PrefixConsAddr, app.Bech32PrefixConsPub) + cfg.SetAddressVerifier(wasmtypes.VerifyAddressLen()) + cfg.Seal() + + srvCfg := *srvconfig.DefaultConfig() + grpcCfg := srvCfg.GRPC + var ( + vmCfg vmtypes.Config + appCfg AppConfig + ) + vmCfg.VMConfig.SetDefaults() + if len(config.ConfigBytes) > 0 { + if err := json.Unmarshal(config.ConfigBytes, &vmCfg); err != nil { + return nil, fmt.Errorf("failed to unmarshal config %s: %w", string(config.ConfigBytes), err) + } + + if err := vmCfg.VMConfig.Validate(); err != nil { + return nil, err + } + + // Unmarshal wasm app config + if err := json.Unmarshal(vmCfg.AppConfig, &appCfg); err != nil { + // set the grpc port, if it is set to 0, disable gRPC + if appCfg.GRPCPort > 0 { + grpcCfg.Address = fmt.Sprintf("127.0.0.1:%d", appCfg.GRPCPort) + } else { + grpcCfg.Enable = false + } + } + } + + chainID := vmCfg.VMConfig.NetworkName + var wasmApp = app.NewWasmApp( + logger, + db, + nil, + true, + sims.NewAppOptionsWithFlagHome(os.TempDir()), + []keeper.Option{}, + baseapp.SetChainID(chainID), + ) + + // early return if gRPC is disabled + if !grpcCfg.Enable { + return server.NewCometABCIWrapper(wasmApp), nil + } + + interfaceRegistry := wasmApp.InterfaceRegistry() + marshaller := codec.NewProtoCodec(interfaceRegistry) + clientCtx := client.Context{}. + WithCodec(marshaller). + WithLegacyAmino(makeCodec()). + WithTxConfig(tx.NewTxConfig(marshaller, tx.DefaultSignModes)). + WithInterfaceRegistry(interfaceRegistry). + WithChainID(chainID) + + avaChainID, err := ids.ToID(config.ChainID) + if err != nil { + return nil, err + } + + rpcURI := fmt.Sprintf( + "http://127.0.0.1:%d/ext/bc/%s/rpc", + appCfg.RPCPort, + avaChainID, + ) + + clientCtx = clientCtx.WithNodeURI(rpcURI) + rpcclient, err := rpchttp.New(rpcURI, "/websocket") + if err != nil { + return nil, err + } + clientCtx = clientCtx.WithClient(rpcclient) + + // use the provided clientCtx to register the services + wasmApp.RegisterTxService(clientCtx) + wasmApp.RegisterTendermintService(clientCtx) + wasmApp.RegisterNodeService(clientCtx, srvconfig.Config{}) + + maxSendMsgSize := grpcCfg.MaxSendMsgSize + if maxSendMsgSize == 0 { + maxSendMsgSize = srvconfig.DefaultGRPCMaxSendMsgSize + } + + maxRecvMsgSize := grpcCfg.MaxRecvMsgSize + if maxRecvMsgSize == 0 { + maxRecvMsgSize = srvconfig.DefaultGRPCMaxRecvMsgSize + } + + // if gRPC is enabled, configure gRPC client for gRPC gateway + grpcClient, err := grpc.NewClient( + grpcCfg.Address, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions( + grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), + grpc.MaxCallRecvMsgSize(maxRecvMsgSize), + grpc.MaxCallSendMsgSize(maxSendMsgSize), + ), + ) + if err != nil { + return nil, err + } + + clientCtx = clientCtx.WithGRPCClient(grpcClient) + logger.Debug("gRPC client assigned to client context", "target", grpcCfg.Address) + + g, ctx := getCtx(logger, false) + + grpcSrv, err := servergrpc.NewGRPCServer(clientCtx, wasmApp, grpcCfg) + if err != nil { + return nil, err + } + + // Start the gRPC server in a goroutine. Note, the provided ctx will ensure + // that the server is gracefully shut down. + g.Go(func() error { + return servergrpc.StartGRPCServer(ctx, logger.With("module", "grpc-server"), grpcCfg, grpcSrv) + }) + + if appCfg.APIPort == 0 { + appCfg.APIPort = 1317 + } + if appCfg.APIHost == "" { + appCfg.APIHost = "localhost" + } + apiURI := fmt.Sprintf("tcp://%s", net.JoinHostPort(appCfg.APIHost, strconv.Itoa(int(appCfg.APIPort)))) + + srvCfg.API.Enable = true + srvCfg.API.Swagger = false + srvCfg.API.EnableUnsafeCORS = true + srvCfg.API.Address = apiURI + + apiSrv := api.New(clientCtx, logger.With(log.ModuleKey, "api-server"), grpcSrv) + wasmApp.RegisterAPIRoutes(apiSrv, srvCfg.API) + g.Go(func() error { + return apiSrv.Start(ctx, srvCfg) + }) + + return server.NewCometABCIWrapper(wasmApp), nil + } +} + +// custom tx codec +func makeCodec() *codec.LegacyAmino { + cdc := codec.NewLegacyAmino() + sdk.RegisterLegacyAminoCodec(cdc) + cryptocodec.RegisterCrypto(cdc) + return cdc +} + +func getCtx(logger log.Logger, block bool) (*errgroup.Group, context.Context) { + ctx, cancelFn := context.WithCancel(context.Background()) + g, ctx := errgroup.WithContext(ctx) + // listen for quit signals so the calling parent process can gracefully exit + listenForQuitSignals(g, block, cancelFn, logger) + return g, ctx +} + +// listenForQuitSignals listens for SIGINT and SIGTERM. When a signal is received, +// the cleanup function is called, indicating the caller can gracefully exit or +// return. +// +// Note, the blocking behavior of this depends on the block argument. +// The caller must ensure the corresponding context derived from the cancelFn is used correctly. +func listenForQuitSignals(g *errgroup.Group, block bool, cancelFn context.CancelFunc, logger log.Logger) { + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) + + f := func() { + sig := <-sigCh + cancelFn() + + logger.Info("caught signal", "signal", sig.String()) + } + + if block { + g.Go(func() error { + f() + return nil + }) + } else { + go f() + } +} diff --git a/go.mod b/go.mod index 544c9b9c..4df39a6b 100644 --- a/go.mod +++ b/go.mod @@ -1,49 +1,51 @@ -module github.com/consideritdone/landslidevm +module github.com/landslidenetwork/slide-sdk -go 1.22.0 +go 1.22.7 require ( cosmossdk.io/log v1.3.1 github.com/CosmWasm/wasmd v0.50.0 - github.com/cometbft/cometbft v0.38.6 - github.com/cometbft/cometbft-db v0.8.0 + github.com/cometbft/cometbft v0.38.10 + github.com/cometbft/cometbft-db v0.9.1 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-sdk v0.50.1 + github.com/cosmos/cosmos-sdk v0.50.9 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/mr-tron/base58 v1.2.0 - github.com/prometheus/client_golang v1.17.0 - github.com/prometheus/client_model v0.5.0 - github.com/stretchr/testify v1.8.4 + github.com/prometheus/client_golang v1.19.0 + github.com/prometheus/client_model v0.6.1 + github.com/stretchr/testify v1.9.0 go.uber.org/mock v0.4.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 - google.golang.org/grpc v1.62.0 - google.golang.org/protobuf v1.33.0 + golang.org/x/sync v0.7.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 + google.golang.org/grpc v1.64.1 + google.golang.org/protobuf v1.34.2 ) require ( - cloud.google.com/go v0.112.0 // indirect - cloud.google.com/go/compute v1.23.3 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute v1.25.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/storage v1.36.0 // indirect - cosmossdk.io/api v0.7.2 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/client/v2 v2.0.0-beta.1 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.11.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/math v1.2.0 // indirect - cosmossdk.io/store v1.0.0 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.0.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.3.0 // indirect + cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/circuit v0.1.0 // indirect cosmossdk.io/x/evidence v0.1.0 // indirect cosmossdk.io/x/feegrant v0.1.0 // indirect cosmossdk.io/x/nft v0.1.0 // indirect - cosmossdk.io/x/tx v0.12.0 // indirect + cosmossdk.io/x/tx v0.13.4 // indirect cosmossdk.io/x/upgrade v0.1.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/CosmWasm/wasmvm v1.5.0 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -53,7 +55,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect @@ -62,11 +64,11 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.0 // indirect + github.com/cosmos/gogoproto v1.5.0 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect github.com/cosmos/ibc-go/v8 v8.0.0 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect @@ -80,16 +82,16 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.6.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/getsentry/sentry-go v0.25.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect @@ -106,7 +108,7 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect @@ -117,11 +119,12 @@ require ( github.com/hashicorp/go-getter v1.7.1 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect @@ -131,17 +134,15 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -152,13 +153,13 @@ require ( github.com/onsi/gomega v1.29.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.32.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -169,7 +170,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.18.1 // indirect + github.com/spf13/viper v1.18.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -177,27 +178,26 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/api v0.155.0 // indirect + google.golang.org/api v0.169.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -206,3 +206,6 @@ require ( pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) + +// pin version! 126854af5e6d has issues with the store so that queries fail +replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index cc9aabfd..f67378b7 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -68,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -109,8 +109,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -171,8 +171,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= -cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -184,24 +184,24 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= -cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= -cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= -cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= -cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= @@ -210,8 +210,8 @@ cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= -cosmossdk.io/x/tx v0.12.0 h1:Ry2btjQdrfrje9qZ3iZeZSmDArjgxUJMMcLMrX4wj5U= -cosmossdk.io/x/tx v0.12.0/go.mod h1:qTth2coAGkwCwOCjqQ8EAQg+9udXNRzcnSbMgGKGEI0= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= cosmossdk.io/x/upgrade v0.1.0 h1:z1ZZG4UL9ICTNbJDYZ6jOnF9GdEK9wyoEFi4BUScHXE= cosmossdk.io/x/upgrade v0.1.0/go.mod h1:/6jjNGbiPCNtmA1N+rBtP601sr0g4ZXuj3yC6ClPCGY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -229,6 +229,7 @@ github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -295,8 +296,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -320,8 +321,6 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= -github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -338,10 +337,10 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= -github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= -github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= +github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -354,19 +353,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= -github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOhg= @@ -411,14 +410,14 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/emicklei/dot v1.6.0 h1:vUzuoVE8ipzS7QkES4UfxdpCwdU2U97m2Pb2tQCoYRY= -github.com/emicklei/dot v1.6.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -430,8 +429,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -446,11 +443,10 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= -github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -476,8 +472,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -492,7 +488,6 @@ github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJ github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -553,8 +548,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -607,7 +600,6 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -633,8 +625,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -673,8 +665,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -697,6 +689,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -754,8 +748,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -771,12 +765,10 @@ github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -799,8 +791,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= @@ -853,15 +843,12 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -891,8 +878,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -913,32 +900,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -946,8 +933,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -998,16 +985,17 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.18.1 h1:rmuU42rScKWlhhJDyXZRKJQHXFX02chSVW1IvkPGiVM= -github.com/spf13/viper v1.18.1/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1018,12 +1006,13 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= @@ -1054,8 +1043,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1068,18 +1057,18 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1108,8 +1097,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1121,8 +1110,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No= -golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1149,8 +1138,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= @@ -1186,6 +1175,7 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1195,7 +1185,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1210,8 +1199,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1237,8 +1226,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1253,8 +1242,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1298,16 +1287,17 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1351,13 +1341,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1369,8 +1359,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1430,7 +1420,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -1440,8 +1429,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1449,8 +1438,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1500,8 +1490,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= -google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= +google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= +google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1618,12 +1608,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= -google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= 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.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1665,8 +1655,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1683,8 +1673,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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/grpcutils/client.go b/grpcutils/client.go index c35fcf48..17266120 100644 --- a/grpcutils/client.go +++ b/grpcutils/client.go @@ -51,14 +51,14 @@ var DefaultDialOptions = []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), } -// gRPC clients created from this ClientConn will wait forever for the Server to +// Dial gRPC clients created from this ClientConn will wait forever for the Server to // become Ready. If you desire a dial timeout ensure context is properly plumbed // to the client and use context.WithTimeout. // // Dial returns a gRPC ClientConn with the dial options as defined by // DefaultDialOptions. DialOption can also optionally be passed. func Dial(addr string, opts ...DialOption) (*grpc.ClientConn, error) { - return grpc.Dial("passthrough:///"+addr, newDialOpts(opts...)...) + return grpc.NewClient("passthrough:///"+addr, newDialOpts(opts...)...) } // DialOptions are options which can be applied to a gRPC client in addition to @@ -67,7 +67,7 @@ type DialOptions struct { opts []grpc.DialOption } -// append(DefaultDialOptions, ...) will always allocate a new slice and will +// newDialOpts append(DefaultDialOptions, ...) will always allocate a new slice and will // not overwrite any potential data that may have previously been appended to // DefaultServerOptions https://go.dev/ref/spec#Composite_literals func newDialOpts(opts ...DialOption) []grpc.DialOption { diff --git a/grpcutils/util.go b/grpcutils/util.go index 476a82c9..2980ff14 100644 --- a/grpcutils/util.go +++ b/grpcutils/util.go @@ -12,7 +12,7 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" - httppb "github.com/consideritdone/landslidevm/proto/http" + httppb "github.com/landslidenetwork/slide-sdk/proto/http" spb "google.golang.org/genproto/googleapis/rpc/status" tspb "google.golang.org/protobuf/types/known/timestamppb" ) @@ -24,7 +24,7 @@ func Errorf(code int, tmpl string, args ...interface{}) error { }) } -// GetGRPCErrorFromHTTPRespone takes an HandleSimpleHTTPResponse as input and returns a gRPC error. +// GetGRPCErrorFromHTTPResponse takes an HandleSimpleHTTPResponse as input and returns a gRPC error. func GetGRPCErrorFromHTTPResponse(resp *httppb.HandleSimpleHTTPResponse) error { a, err := anypb.New(resp) if err != nil { diff --git a/http/conn/conn_client.go b/http/conn/conn_client.go index 642ab40c..92083f20 100644 --- a/http/conn/conn_client.go +++ b/http/conn/conn_client.go @@ -9,7 +9,7 @@ import ( "google.golang.org/protobuf/types/known/emptypb" - connpb "github.com/consideritdone/landslidevm/proto/net/conn" + connpb "github.com/landslidenetwork/slide-sdk/proto/net/conn" ) var _ net.Conn = (*Client)(nil) diff --git a/http/conn/conn_server.go b/http/conn/conn_server.go index a4a4a2e3..33599743 100644 --- a/http/conn/conn_server.go +++ b/http/conn/conn_server.go @@ -7,9 +7,9 @@ import ( "google.golang.org/protobuf/types/known/emptypb" - "github.com/consideritdone/landslidevm/grpcutils" + "github.com/landslidenetwork/slide-sdk/grpcutils" - connpb "github.com/consideritdone/landslidevm/proto/net/conn" + connpb "github.com/landslidenetwork/slide-sdk/proto/net/conn" ) var _ connpb.ConnServer = (*Server)(nil) diff --git a/http/http_client.go b/http/http_client.go index 175569a4..f0d72f9c 100644 --- a/http/http_client.go +++ b/http/http_client.go @@ -4,11 +4,11 @@ import ( "io" "net/http" - "github.com/consideritdone/landslidevm/grpcutils" - "github.com/consideritdone/landslidevm/http/responsewriter" + "github.com/landslidenetwork/slide-sdk/grpcutils" + "github.com/landslidenetwork/slide-sdk/http/responsewriter" - httppb "github.com/consideritdone/landslidevm/proto/http" - responsewriterpb "github.com/consideritdone/landslidevm/proto/http/responsewriter" + httppb "github.com/landslidenetwork/slide-sdk/proto/http" + responsewriterpb "github.com/landslidenetwork/slide-sdk/proto/http/responsewriter" ) var _ http.Handler = (*Client)(nil) diff --git a/http/http_server.go b/http/http_server.go index 47b12132..b90a5c02 100644 --- a/http/http_server.go +++ b/http/http_server.go @@ -10,11 +10,11 @@ import ( "google.golang.org/protobuf/types/known/emptypb" - "github.com/consideritdone/landslidevm/grpcutils" - "github.com/consideritdone/landslidevm/http/responsewriter" + "github.com/landslidenetwork/slide-sdk/grpcutils" + "github.com/landslidenetwork/slide-sdk/http/responsewriter" - httppb "github.com/consideritdone/landslidevm/proto/http" - responsewriterpb "github.com/consideritdone/landslidevm/proto/http/responsewriter" + httppb "github.com/landslidenetwork/slide-sdk/proto/http" + responsewriterpb "github.com/landslidenetwork/slide-sdk/proto/http/responsewriter" ) var ( diff --git a/http/reader/reader_client.go b/http/reader/reader_client.go index d3feca39..91ef6878 100644 --- a/http/reader/reader_client.go +++ b/http/reader/reader_client.go @@ -5,7 +5,7 @@ import ( "errors" "io" - readerpb "github.com/consideritdone/landslidevm/proto/io/reader" + readerpb "github.com/landslidenetwork/slide-sdk/proto/io/reader" ) var _ io.Reader = (*Client)(nil) diff --git a/http/reader/reader_server.go b/http/reader/reader_server.go index a587350c..99931b5b 100644 --- a/http/reader/reader_server.go +++ b/http/reader/reader_server.go @@ -2,9 +2,10 @@ package reader import ( "context" + "fmt" "io" - readerpb "github.com/consideritdone/landslidevm/proto/io/reader" + readerpb "github.com/landslidenetwork/slide-sdk/proto/io/reader" ) var _ readerpb.ReaderServer = (*Server)(nil) @@ -21,7 +22,11 @@ func NewServer(reader io.Reader) *Server { } func (s *Server) Read(_ context.Context, req *readerpb.ReadRequest) (*readerpb.ReadResponse, error) { - buf := make([]byte, int(req.Length)) + if req.Length <= 0 { + return nil, fmt.Errorf("invalid read length: %d", req.Length) + } + + buf := make([]byte, req.Length) n, err := s.reader.Read(buf) resp := &readerpb.ReadResponse{ Read: buf[:n], diff --git a/http/responsewriter/writer_client.go b/http/responsewriter/writer_client.go index 161e620f..4eb3542e 100644 --- a/http/responsewriter/writer_client.go +++ b/http/responsewriter/writer_client.go @@ -8,15 +8,15 @@ import ( "google.golang.org/protobuf/types/known/emptypb" - "github.com/consideritdone/landslidevm/grpcutils" - "github.com/consideritdone/landslidevm/http/conn" - "github.com/consideritdone/landslidevm/http/reader" - "github.com/consideritdone/landslidevm/http/writer" - - responsewriterpb "github.com/consideritdone/landslidevm/proto/http/responsewriter" - readerpb "github.com/consideritdone/landslidevm/proto/io/reader" - writerpb "github.com/consideritdone/landslidevm/proto/io/writer" - connpb "github.com/consideritdone/landslidevm/proto/net/conn" + "github.com/landslidenetwork/slide-sdk/grpcutils" + "github.com/landslidenetwork/slide-sdk/http/conn" + "github.com/landslidenetwork/slide-sdk/http/reader" + "github.com/landslidenetwork/slide-sdk/http/writer" + + responsewriterpb "github.com/landslidenetwork/slide-sdk/proto/http/responsewriter" + readerpb "github.com/landslidenetwork/slide-sdk/proto/io/reader" + writerpb "github.com/landslidenetwork/slide-sdk/proto/io/writer" + connpb "github.com/landslidenetwork/slide-sdk/proto/net/conn" ) var ( diff --git a/http/responsewriter/writer_server.go b/http/responsewriter/writer_server.go index b84e5466..72b8b170 100644 --- a/http/responsewriter/writer_server.go +++ b/http/responsewriter/writer_server.go @@ -7,15 +7,15 @@ import ( "google.golang.org/protobuf/types/known/emptypb" - "github.com/consideritdone/landslidevm/grpcutils" - "github.com/consideritdone/landslidevm/http/conn" - "github.com/consideritdone/landslidevm/http/reader" - "github.com/consideritdone/landslidevm/http/writer" - - responsewriterpb "github.com/consideritdone/landslidevm/proto/http/responsewriter" - readerpb "github.com/consideritdone/landslidevm/proto/io/reader" - writerpb "github.com/consideritdone/landslidevm/proto/io/writer" - connpb "github.com/consideritdone/landslidevm/proto/net/conn" + "github.com/landslidenetwork/slide-sdk/grpcutils" + "github.com/landslidenetwork/slide-sdk/http/conn" + "github.com/landslidenetwork/slide-sdk/http/reader" + "github.com/landslidenetwork/slide-sdk/http/writer" + + responsewriterpb "github.com/landslidenetwork/slide-sdk/proto/http/responsewriter" + readerpb "github.com/landslidenetwork/slide-sdk/proto/io/reader" + writerpb "github.com/landslidenetwork/slide-sdk/proto/io/writer" + connpb "github.com/landslidenetwork/slide-sdk/proto/net/conn" ) var ( diff --git a/http/writer/writer_client.go b/http/writer/writer_client.go index 77967d27..b5cbc440 100644 --- a/http/writer/writer_client.go +++ b/http/writer/writer_client.go @@ -5,7 +5,7 @@ import ( "errors" "io" - writerpb "github.com/consideritdone/landslidevm/proto/io/writer" + writerpb "github.com/landslidenetwork/slide-sdk/proto/io/writer" ) var _ io.Writer = (*Client)(nil) diff --git a/http/writer/writer_server.go b/http/writer/writer_server.go index 97eb7d71..623bd221 100644 --- a/http/writer/writer_server.go +++ b/http/writer/writer_server.go @@ -4,7 +4,7 @@ import ( "context" "io" - writerpb "github.com/consideritdone/landslidevm/proto/io/writer" + writerpb "github.com/landslidenetwork/slide-sdk/proto/io/writer" ) var _ writerpb.WriterServer = (*Server)(nil) diff --git a/jsonrpc/http_json_handler.go b/jsonrpc/http_json_handler.go index 51c8259e..598b3ef6 100644 --- a/jsonrpc/http_json_handler.go +++ b/jsonrpc/http_json_handler.go @@ -12,7 +12,7 @@ import ( cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" "github.com/cometbft/cometbft/rpc/jsonrpc/server" - types "github.com/cometbft/cometbft/rpc/jsonrpc/types" + "github.com/cometbft/cometbft/rpc/jsonrpc/types" ) // HTTP + JSON handler @@ -78,14 +78,14 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han ) continue } - //if len(r.URL.Path) > 1 { + // if len(r.URL.Path) > 1 { // responses = append( // responses, // types.RPCInvalidRequestError(request.ID, fmt.Errorf("path %s is invalid", r.URL.Path)), // ) // cache = false // continue - //} + // } rpcFunc, ok := funcMap[request.Method] if !ok || (rpcFunc.ws) { responses = append(responses, types.RPCMethodNotFoundError(request.ID)) @@ -262,5 +262,5 @@ func writeListOfEndpoints(w http.ResponseWriter, r *http.Request, funcMap map[st buf.WriteString("") w.Header().Set("Content-Type", "text/html") w.WriteHeader(200) - w.Write(buf.Bytes()) //nolint: errcheck + _, _ = w.Write(buf.Bytes()) } diff --git a/jsonrpc/http_json_handler_test.go b/jsonrpc/http_json_handler_test.go index 6d28ffea..c1386852 100644 --- a/jsonrpc/http_json_handler_test.go +++ b/jsonrpc/http_json_handler_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cometbft/cometbft/libs/log" - types "github.com/cometbft/cometbft/rpc/jsonrpc/types" + "github.com/cometbft/cometbft/rpc/jsonrpc/types" ) func testMux() *http.ServeMux { @@ -218,7 +218,7 @@ func TestRPCNotificationInBatch(t *testing.T) { } } -//func TestUnknownRPCPath(t *testing.T) { +// func TestUnknownRPCPath(t *testing.T) { // mux := testMux() // req, err := http.NewRequest("GET", "http://localhost/unknownrpcpath", nil) // require.NoError(t, err) @@ -229,7 +229,7 @@ func TestRPCNotificationInBatch(t *testing.T) { // // Always expecting back a 404 error // require.Equal(t, http.StatusNotFound, res.StatusCode, "should always return 404") // res.Body.Close() -//} +// } func TestRPCResponseCache(t *testing.T) { mux := testMux() @@ -241,7 +241,7 @@ func TestRPCResponseCache(t *testing.T) { // Always expecting back a JSONRPCResponse require.True(t, statusOK(res.StatusCode), "should always return 2XX") - require.Equal(t, "public, max-age=86400", res.Header.Get("Cache-control")) + require.Equal(t, "public, max-age=86400", res.Header.Get("Cache-Control")) _, err := io.ReadAll(res.Body) res.Body.Close() @@ -256,7 +256,7 @@ func TestRPCResponseCache(t *testing.T) { // Always expecting back a JSONRPCResponse require.True(t, statusOK(res.StatusCode), "should always return 2XX") - require.Equal(t, "", res.Header.Get("Cache-control")) + require.Equal(t, "", res.Header.Get("Cache-Control")) _, err = io.ReadAll(res.Body) @@ -272,7 +272,7 @@ func TestRPCResponseCache(t *testing.T) { // Always expecting back a JSONRPCResponse require.True(t, statusOK(res.StatusCode), "should always return 2XX") - require.Equal(t, "", res.Header.Get("Cache-control")) + require.Equal(t, "", res.Header.Get("Cache-Control")) _, err = io.ReadAll(res.Body) diff --git a/jsonrpc/rpc_func.go b/jsonrpc/rpc_func.go index 9bfa51cd..8a5a2665 100644 --- a/jsonrpc/rpc_func.go +++ b/jsonrpc/rpc_func.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" "reflect" + "runtime/debug" "strings" "github.com/cometbft/cometbft/libs/log" @@ -66,6 +67,23 @@ func NewWSRPCFunc(f interface{}, args string, options ...Option) *RPCFunc { return newRPCFunc(f, args, options...) } +// panicRecoveryMiddleware wraps RPCFunc to handle panics. +func panicRecoveryMiddleware(rpcFunc *RPCFunc) *RPCFunc { + originalFunc := rpcFunc.f + rpcFunc.f = reflect.MakeFunc(rpcFunc.f.Type(), func(args []reflect.Value) (results []reflect.Value) { + defer func() { + if r := recover(); r != nil { + fmt.Printf("Recovered in RPC call: %v\n", r) + debug.PrintStack() + err := fmt.Errorf("internal server error") + results = []reflect.Value{reflect.Zero(rpcFunc.returns[0]), reflect.ValueOf(&err).Elem()} + } + }() + return originalFunc.Call(args) + }) + return rpcFunc +} + // cacheableWithArgs returns whether or not a call to this function is cacheable, // given the specified arguments. func (f *RPCFunc) cacheableWithArgs(args []reflect.Value) bool { @@ -107,7 +125,8 @@ func newRPCFunc(f interface{}, args string, options ...Option) *RPCFunc { opt(r) } - return r + // using middleware to handle panics + return panicRecoveryMiddleware(r) } // return a function's argument types @@ -132,7 +151,7 @@ func funcReturnTypes(f interface{}) []reflect.Type { return typez } -//------------------------------------------------------------- +// ------------------------------------------------------------- // NOTE: assume returns is result struct and error. If error is not nil, return it func unreflectResult(returns []reflect.Value) (interface{}, error) { diff --git a/proto/buf.yaml b/proto/buf.yaml index 02b71cc2..8312f7ae 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,5 +1,5 @@ version: v1 -name: buf.build/consideritdone/landslidevm +name: buf.build/landslidenetwork/slide-sdk build: excludes: # for golang we handle prometheus as a buf dep so we exclude it from generate, this proto diff --git a/proto/http/http.pb.go b/proto/http/http.pb.go index 1ec49bad..7ac03fde 100644 --- a/proto/http/http.pb.go +++ b/proto/http/http.pb.go @@ -1033,9 +1033,9 @@ var file_http_http_proto_rawDesc = []byte{ 0x65, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x32, 0x5a, 0x30, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, - 0x64, 0x65, 0x72, 0x69, 0x74, 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, - 0x69, 0x64, 0x65, 0x76, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, 0x74, 0x74, 0x70, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, + 0x6c, 0x69, 0x64, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, + 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/http/http.proto b/proto/http/http.proto index 163bfb2c..68f18467 100644 --- a/proto/http/http.proto +++ b/proto/http/http.proto @@ -4,7 +4,7 @@ package http; import "google/protobuf/empty.proto"; -option go_package = "github.com/consideritdone/landslidevm/proto/http"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/http"; service HTTP { // Handle wraps http1 over http2 and provides support for websockets by implementing diff --git a/proto/http/responsewriter/responsewriter.pb.go b/proto/http/responsewriter/responsewriter.pb.go index 8e1e7087..ed9c705e 100644 --- a/proto/http/responsewriter/responsewriter.pb.go +++ b/proto/http/responsewriter/responsewriter.pb.go @@ -384,9 +384,9 @@ var file_http_responsewriter_responsewriter_proto_rawDesc = []byte{ 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x23, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2e, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x41, 0x5a, - 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x69, 0x64, 0x65, 0x72, 0x69, 0x74, 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, - 0x6c, 0x69, 0x64, 0x65, 0x76, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, 0x74, 0x74, + 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, + 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, + 0x64, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/http/responsewriter/responsewriter.proto b/proto/http/responsewriter/responsewriter.proto index ea7f21dc..9a8d69c8 100644 --- a/proto/http/responsewriter/responsewriter.proto +++ b/proto/http/responsewriter/responsewriter.proto @@ -4,7 +4,7 @@ package http.responsewriter; import "google/protobuf/empty.proto"; -option go_package = "github.com/consideritdone/landslidevm/proto/http/responsewriter"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/http/responsewriter"; // Writer is an http.ResponseWriter see: https://pkg.go.dev/net/http#ResponseWriter service Writer { diff --git a/proto/io/reader/reader.pb.go b/proto/io/reader/reader.pb.go index 0fd3051e..6661f5a5 100644 --- a/proto/io/reader/reader.pb.go +++ b/proto/io/reader/reader.pb.go @@ -142,8 +142,8 @@ var file_io_reader_reader_proto_rawDesc = []byte{ 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x69, 0x6f, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x69, 0x74, 0x64, - 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x76, 0x6d, 0x2f, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6f, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/io/reader/reader.proto b/proto/io/reader/reader.proto index 34c56eda..2ad2ecee 100644 --- a/proto/io/reader/reader.proto +++ b/proto/io/reader/reader.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package io.reader; -option go_package = "github.com/consideritdone/landslidevm/proto/io/reader"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/io/reader"; // Reader is an io.Reader see: https://pkg.go.dev/io#Reader service Reader { diff --git a/proto/io/writer/writer.pb.go b/proto/io/writer/writer.pb.go index d71482ab..18256a56 100644 --- a/proto/io/writer/writer.pb.go +++ b/proto/io/writer/writer.pb.go @@ -143,8 +143,8 @@ var file_io_writer_writer_proto_rawDesc = []byte{ 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x69, 0x6f, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x69, 0x74, 0x64, 0x6f, 0x6e, 0x65, - 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x76, 0x6d, 0x2f, 0x70, 0x72, 0x6f, + 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6f, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/io/writer/writer.proto b/proto/io/writer/writer.proto index db7a6bf9..d7ae14d0 100644 --- a/proto/io/writer/writer.proto +++ b/proto/io/writer/writer.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package io.writer; -option go_package = "github.com/consideritdone/landslidevm/proto/io/writer"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/io/writer"; // Writer see: io.Writer https://pkg.go.dev/io#Writer service Writer { diff --git a/proto/messenger/messenger.pb.go b/proto/messenger/messenger.pb.go index 2f740f92..8c0b9b87 100644 --- a/proto/messenger/messenger.pb.go +++ b/proto/messenger/messenger.pb.go @@ -176,8 +176,8 @@ var file_messenger_messenger_proto_rawDesc = []byte{ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x69, 0x74, 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, - 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x76, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/messenger/messenger.proto b/proto/messenger/messenger.proto index fe3ec8f3..f59f74e2 100644 --- a/proto/messenger/messenger.proto +++ b/proto/messenger/messenger.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package messenger; -option go_package = "github.com/consideritdone/landslidevm/proto/messenger"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/messenger"; service Messenger { rpc Notify(NotifyRequest) returns (NotifyResponse); diff --git a/proto/net/conn/conn.pb.go b/proto/net/conn/conn.pb.go index 78502ed8..3344b25c 100644 --- a/proto/net/conn/conn.pb.go +++ b/proto/net/conn/conn.pb.go @@ -328,9 +328,9 @@ var file_net_conn_conn_proto_rawDesc = []byte{ 0x65, 0x74, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, - 0x69, 0x74, 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, - 0x76, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6e, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, + 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/net/conn/conn.proto b/proto/net/conn/conn.proto index 3609473c..4d549dfd 100644 --- a/proto/net/conn/conn.proto +++ b/proto/net/conn/conn.proto @@ -4,7 +4,7 @@ package net.conn; import "google/protobuf/empty.proto"; -option go_package = "github.com/consideritdone/landslidevm/proto/net/conn"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/net/conn"; // Conn is a net.Conn see: https://pkg.go.dev/net#Conn service Conn { diff --git a/proto/rpcdb/rpcdb.pb.go b/proto/rpcdb/rpcdb.pb.go index 01109ecf..d3dfbf37 100644 --- a/proto/rpcdb/rpcdb.pb.go +++ b/proto/rpcdb/rpcdb.pb.go @@ -1368,9 +1368,9 @@ var file_rpcdb_rpcdb_proto_rawDesc = []byte{ 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x72, 0x70, 0x63, 0x64, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, - 0x69, 0x74, 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, - 0x76, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x64, 0x62, 0x62, 0x06, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, + 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x64, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/rpcdb/rpcdb.proto b/proto/rpcdb/rpcdb.proto index bd4619f0..f7092e53 100644 --- a/proto/rpcdb/rpcdb.proto +++ b/proto/rpcdb/rpcdb.proto @@ -4,7 +4,7 @@ package rpcdb; import "google/protobuf/empty.proto"; -option go_package = "github.com/consideritdone/landslidevm/proto/rpcdb"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/rpcdb"; service Database { rpc Has(HasRequest) returns (HasResponse); diff --git a/proto/vm/landslidevm.pb.go b/proto/vm/landslidevm.pb.go index adf0db74..56b29f85 100644 --- a/proto/vm/landslidevm.pb.go +++ b/proto/vm/landslidevm.pb.go @@ -3481,8 +3481,8 @@ var file_vm_landslidevm_proto_rawDesc = []byte{ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x69, 0x74, - 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x76, 0x6d, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/vm/landslidevm.proto b/proto/vm/landslidevm.proto index 59e83441..8afb8849 100644 --- a/proto/vm/landslidevm.proto +++ b/proto/vm/landslidevm.proto @@ -6,7 +6,7 @@ import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "io/prometheus/client/metrics.proto"; -option go_package = "github.com/consideritdone/landslidevm/proto/vm"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/vm"; // ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/engine/snowman/block // ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/consensus/snowman#Block diff --git a/proto/vm/runtime/runtime.pb.go b/proto/vm/runtime/runtime.pb.go index 4d4de6bb..a405b9d4 100644 --- a/proto/vm/runtime/runtime.pb.go +++ b/proto/vm/runtime/runtime.pb.go @@ -97,8 +97,8 @@ var file_vm_runtime_runtime_proto_rawDesc = []byte{ 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x69, 0x74, - 0x64, 0x6f, 0x6e, 0x65, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x76, 0x6d, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x6d, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/proto/vm/runtime/runtime.proto b/proto/vm/runtime/runtime.proto index 892817ce..4b27a4fb 100644 --- a/proto/vm/runtime/runtime.proto +++ b/proto/vm/runtime/runtime.proto @@ -4,7 +4,7 @@ package vm.runtime; import "google/protobuf/empty.proto"; -option go_package = "github.com/consideritdone/landslidevm/proto/vm/runtime"; +option go_package = "github.com/landslidenetwork/slide-sdk/proto/vm/runtime"; // Manages the lifecycle of a subnet VM process. service Runtime { diff --git a/scripts/versions.sh b/scripts/versions.sh index b80a1a24..7d18e732 100644 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Don't export them as they're used in the context of other calls -AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.11.7'} +AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.11.8'} diff --git a/landslidevm.go b/server/sdk_server.go similarity index 80% rename from landslidevm.go rename to server/sdk_server.go index 48406f4e..7c10eb1d 100644 --- a/landslidevm.go +++ b/server/sdk_server.go @@ -1,4 +1,4 @@ -package landslidevm +package server import ( "context" @@ -16,9 +16,9 @@ import ( "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/keepalive" - vmpb "github.com/consideritdone/landslidevm/proto/vm" - runtimepb "github.com/consideritdone/landslidevm/proto/vm/runtime" - "github.com/consideritdone/landslidevm/vm" + vmpb "github.com/landslidenetwork/slide-sdk/proto/vm" + runtimepb "github.com/landslidenetwork/slide-sdk/proto/vm/runtime" + "github.com/landslidenetwork/slide-sdk/vm" ) const ( @@ -45,14 +45,16 @@ const ( // rpcChainVMProtocol should be bumped anytime changes are made which // require the plugin vm to upgrade to latest avalanchego release to be // compatible. - rpcChainVMProtocol uint = 35 + rpcChainVMProtocol uint = 35 + defaultMaxRecvMsgSize = 50 * 1024 * 1024 // 50 MB + defaultMaxConcurrentStreams = 1000 ) var ( DefaultServerOptions = []grpc.ServerOption{ - grpc.MaxRecvMsgSize(math.MaxInt), + grpc.MaxRecvMsgSize(defaultMaxRecvMsgSize), grpc.MaxSendMsgSize(math.MaxInt), - grpc.MaxConcurrentStreams(math.MaxUint32), + grpc.MaxConcurrentStreams(defaultMaxConcurrentStreams), grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ MinTime: defaultServerKeepAliveMinTime, PermitWithoutStream: defaultPermitWithoutStream, @@ -98,7 +100,7 @@ func Serve[T interface { go func(ctx context.Context) { defer func() { server.GracefulStop() - fmt.Println("vm server: graceful termination success") + fmt.Println("landslide vm server: graceful termination success") }() for { @@ -108,19 +110,19 @@ func Serve[T interface { // that we are shutting down. Once we are in the shutdown // workflow, we will gracefully exit upon receiving a SIGTERM. if !lvm.CanShutdown() { - fmt.Printf("runtime engine: ignoring signal: %s\n", s) + fmt.Printf("landslide runtime engine: ignoring signal: %s\n", s) continue } switch s { case syscall.SIGINT: - fmt.Printf("runtime engine: ignoring signal: %s\n", s) + fmt.Printf("landslide runtime engine: ignoring signal: %s\n", s) case syscall.SIGTERM: - fmt.Printf("runtime engine: received shutdown signal: %s\n", s) + fmt.Printf("landslide runtime engine: received shutdown signal: %s\n", s) return } case <-ctx.Done(): - fmt.Println("runtime engine: context has been cancelled") + fmt.Println("landslide runtime engine: context has been cancelled") return } } @@ -131,12 +133,14 @@ func Serve[T interface { return fmt.Errorf("required env var missing: %q", EngineAddressKey) } - clientConn, err := grpc.Dial("passthrough:///"+runtimeAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.NewClient("passthrough:///"+runtimeAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return fmt.Errorf("failed to create client conn: %w", err) } client := runtimepb.NewRuntimeClient(clientConn) + + // the gRPC server should be exposed only to the local IP address 127.0.0.1 listener, err := net.Listen("tcp", "127.0.0.1:") if err != nil { return fmt.Errorf("failed to create new listener: %w", err) diff --git a/utils/cache/empty_cache.go b/utils/cache/empty_cache.go index 18b2a7fe..60c2a52e 100644 --- a/utils/cache/empty_cache.go +++ b/utils/cache/empty_cache.go @@ -1,6 +1,6 @@ package cache -import "github.com/consideritdone/landslidevm/utils" +import "github.com/landslidenetwork/slide-sdk/utils" var _ Cacher[struct{}, struct{}] = (*Empty[struct{}, struct{}])(nil) diff --git a/utils/cache/lru_cache.go b/utils/cache/lru_cache.go index eba32fad..7c0e679e 100644 --- a/utils/cache/lru_cache.go +++ b/utils/cache/lru_cache.go @@ -3,8 +3,8 @@ package cache import ( "sync" - "github.com/consideritdone/landslidevm/utils" - "github.com/consideritdone/landslidevm/utils/linkedhashmap" + "github.com/landslidenetwork/slide-sdk/utils" + "github.com/landslidenetwork/slide-sdk/utils/linkedhashmap" ) var _ Cacher[struct{}, struct{}] = (*LRU[struct{}, struct{}])(nil) diff --git a/utils/cache/lru_cache_benchmark_test.go b/utils/cache/lru_cache_benchmark_test.go index 379e4a8b..32036a9b 100644 --- a/utils/cache/lru_cache_benchmark_test.go +++ b/utils/cache/lru_cache_benchmark_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) func BenchmarkLRUCachePutSmall(b *testing.B) { diff --git a/utils/cache/lru_cache_test.go b/utils/cache/lru_cache_test.go index 8dc1319f..1f27f0fc 100644 --- a/utils/cache/lru_cache_test.go +++ b/utils/cache/lru_cache_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) func TestLRU(t *testing.T) { diff --git a/utils/cache/lru_sized_cache.go b/utils/cache/lru_sized_cache.go index 9bf31ecf..bc8bac5f 100644 --- a/utils/cache/lru_sized_cache.go +++ b/utils/cache/lru_sized_cache.go @@ -3,8 +3,8 @@ package cache import ( "sync" - "github.com/consideritdone/landslidevm/utils" - "github.com/consideritdone/landslidevm/utils/linkedhashmap" + "github.com/landslidenetwork/slide-sdk/utils" + "github.com/landslidenetwork/slide-sdk/utils/linkedhashmap" ) var _ Cacher[struct{}, any] = (*sizedLRU[struct{}, any])(nil) diff --git a/utils/cache/lru_sized_cache_test.go b/utils/cache/lru_sized_cache_test.go index bcf2e0a5..a7f0c458 100644 --- a/utils/cache/lru_sized_cache_test.go +++ b/utils/cache/lru_sized_cache_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) func TestSizedLRU(t *testing.T) { diff --git a/utils/cache/test_cacher.go b/utils/cache/test_cacher.go index d1f8ecce..b2329f3e 100644 --- a/utils/cache/test_cacher.go +++ b/utils/cache/test_cacher.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) const TestIntSize = ids.IDLen + 8 diff --git a/utils/cache/unique_cache_test.go b/utils/cache/unique_cache_test.go index 76a11359..c8610efb 100644 --- a/utils/cache/unique_cache_test.go +++ b/utils/cache/unique_cache_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) type evictable[K comparable] struct { diff --git a/utils/cb58/cb58.go b/utils/cb58/cb58.go index ef9f954c..d94ec6d2 100644 --- a/utils/cb58/cb58.go +++ b/utils/cb58/cb58.go @@ -8,7 +8,7 @@ import ( "github.com/mr-tron/base58/base58" - "github.com/consideritdone/landslidevm/utils/hashing" + "github.com/landslidenetwork/slide-sdk/utils/hashing" ) const checksumLen = 4 diff --git a/utils/ids/id.go b/utils/ids/id.go index 457e15af..3d1fd8e8 100644 --- a/utils/ids/id.go +++ b/utils/ids/id.go @@ -6,10 +6,10 @@ import ( "errors" "fmt" - "github.com/consideritdone/landslidevm/utils" - "github.com/consideritdone/landslidevm/utils/cb58" - "github.com/consideritdone/landslidevm/utils/hashing" - "github.com/consideritdone/landslidevm/utils/wrappers" + "github.com/landslidenetwork/slide-sdk/utils" + "github.com/landslidenetwork/slide-sdk/utils/cb58" + "github.com/landslidenetwork/slide-sdk/utils/hashing" + "github.com/landslidenetwork/slide-sdk/utils/wrappers" ) const ( diff --git a/utils/ids/id_test.go b/utils/ids/id_test.go index e7ea8445..de524f6c 100644 --- a/utils/ids/id_test.go +++ b/utils/ids/id_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils" - "github.com/consideritdone/landslidevm/utils/cb58" + "github.com/landslidenetwork/slide-sdk/utils" + "github.com/landslidenetwork/slide-sdk/utils/cb58" ) func TestID(t *testing.T) { diff --git a/utils/linkedhashmap/iterator.go b/utils/linkedhashmap/iterator.go index 2c9247cb..80681b0b 100644 --- a/utils/linkedhashmap/iterator.go +++ b/utils/linkedhashmap/iterator.go @@ -3,12 +3,12 @@ package linkedhashmap import ( "container/list" - "github.com/consideritdone/landslidevm/utils" + "github.com/landslidenetwork/slide-sdk/utils" ) var _ Iter[int, struct{}] = (*iterator[int, struct{}])(nil) -// Iterates over the keys and values in a LinkedHashmap +// Iter Iterates over the keys and values in a LinkedHashmap // from oldest to newest elements. // Assumes the underlying LinkedHashmap is not modified while // the iterator is in use, except to delete elements that diff --git a/utils/linkedhashmap/linkedhashmap.go b/utils/linkedhashmap/linkedhashmap.go index 005f829f..c11a84b3 100644 --- a/utils/linkedhashmap/linkedhashmap.go +++ b/utils/linkedhashmap/linkedhashmap.go @@ -4,7 +4,7 @@ import ( "container/list" "sync" - "github.com/consideritdone/landslidevm/utils" + "github.com/landslidenetwork/slide-sdk/utils" ) var _ LinkedHashmap[int, struct{}] = (*linkedHashmap[int, struct{}])(nil) diff --git a/utils/linkedhashmap/linkedhashmap_test.go b/utils/linkedhashmap/linkedhashmap_test.go index 7f619e9a..d194a0a2 100644 --- a/utils/linkedhashmap/linkedhashmap_test.go +++ b/utils/linkedhashmap/linkedhashmap_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) func TestLinkedHashmap(t *testing.T) { diff --git a/utils/sorting.go b/utils/sorting.go index c33a9e76..ff955fda 100644 --- a/utils/sorting.go +++ b/utils/sorting.go @@ -5,7 +5,7 @@ import ( "cmp" "slices" - "github.com/consideritdone/landslidevm/utils/hashing" + "github.com/landslidenetwork/slide-sdk/utils/hashing" ) // TODO can we handle sorting where the Compare function relies on a codec? @@ -14,12 +14,12 @@ type Sortable[T any] interface { Compare(T) int } -// Sorts the elements of [s]. +// Sort sorts the elements of [s]. func Sort[T Sortable[T]](s []T) { slices.SortFunc(s, T.Compare) } -// Sorts the elements of [s] based on their hashes. +// SortByHash sorts the elements of [s] based on their hashes. func SortByHash[T ~[]byte](s []T) { slices.SortFunc(s, func(i, j T) int { iHash := hashing.ComputeHash256(i) @@ -28,7 +28,7 @@ func SortByHash[T ~[]byte](s []T) { }) } -// Returns true iff the elements in [s] are sorted. +// IsSortedBytes returns true iff the elements in [s] are sorted. func IsSortedBytes[T ~[]byte](s []T) bool { for i := 0; i < len(s)-1; i++ { if bytes.Compare(s[i], s[i+1]) == 1 { @@ -38,7 +38,7 @@ func IsSortedBytes[T ~[]byte](s []T) bool { return true } -// Returns true iff the elements in [s] are unique and sorted. +// IsSortedAndUnique returns true iff the elements in [s] are unique and sorted. func IsSortedAndUnique[T Sortable[T]](s []T) bool { for i := 0; i < len(s)-1; i++ { if s[i].Compare(s[i+1]) >= 0 { @@ -48,7 +48,7 @@ func IsSortedAndUnique[T Sortable[T]](s []T) bool { return true } -// Returns true iff the elements in [s] are unique and sorted. +// IsSortedAndUniqueOrdered returns true iff the elements in [s] are unique and sorted. func IsSortedAndUniqueOrdered[T cmp.Ordered](s []T) bool { for i := 0; i < len(s)-1; i++ { if s[i] >= s[i+1] { @@ -58,7 +58,7 @@ func IsSortedAndUniqueOrdered[T cmp.Ordered](s []T) bool { return true } -// Returns true iff the elements in [s] are unique and sorted +// IsSortedAndUniqueByHash returns true iff the elements in [s] are unique and sorted // based by their hashes. func IsSortedAndUniqueByHash[T ~[]byte](s []T) bool { if len(s) <= 1 { diff --git a/vm/rpc.go b/vm/rpc.go index 8f7d07b6..563f0cf8 100644 --- a/vm/rpc.go +++ b/vm/rpc.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "math" "sort" "time" @@ -21,7 +22,8 @@ import ( "github.com/cometbft/cometbft/types" "github.com/cometbft/cometbft/version" - "github.com/consideritdone/landslidevm/jsonrpc" + "github.com/landslidenetwork/slide-sdk/jsonrpc" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) type RPC struct { @@ -103,21 +105,23 @@ func (rpc *RPC) NumUnconfirmedTxs(*rpctypes.Context) (*ctypes.ResultUnconfirmedT // CheckTx checks the transaction without executing it. The transaction won't // be added to the mempool either. func (rpc *RPC) CheckTx(_ *rpctypes.Context, tx types.Tx) (*ctypes.ResultCheckTx, error) { - res, err := rpc.vm.app.Mempool().CheckTx(context.TODO(), &abci.RequestCheckTx{Tx: tx}) + res, err := rpc.vm.app.Mempool().CheckTx(context.Background(), &abci.RequestCheckTx{Tx: tx}) if err != nil { return nil, err } return &ctypes.ResultCheckTx{ResponseCheckTx: *res}, nil } +// ABCIInfo returns the latest information about the application. func (rpc *RPC) ABCIInfo(_ *rpctypes.Context) (*ctypes.ResultABCIInfo, error) { - resInfo, err := rpc.vm.app.Query().Info(context.TODO(), proxy.RequestInfo) + resInfo, err := rpc.vm.app.Query().Info(context.Background(), proxy.RequestInfo) if err != nil { return nil, err } return &ctypes.ResultABCIInfo{Response: *resInfo}, nil } +// ABCIQuery queries the application for some information. func (rpc *RPC) ABCIQuery( _ *rpctypes.Context, path string, @@ -125,7 +129,7 @@ func (rpc *RPC) ABCIQuery( height int64, prove bool, ) (*ctypes.ResultABCIQuery, error) { - resQuery, err := rpc.vm.app.Query().Query(context.TODO(), &abci.RequestQuery{ + resQuery, err := rpc.vm.app.Query().Query(context.Background(), &abci.RequestQuery{ Path: path, Data: data, Height: height, @@ -138,9 +142,17 @@ func (rpc *RPC) ABCIQuery( return &ctypes.ResultABCIQuery{Response: *resQuery}, nil } +// BroadcastTxCommit returns with the responses from CheckTx and ExecTxResult. func (rpc *RPC) BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) { + rpc.vm.logger.Info("BroadcastTxCommit called") subscriber := ctx.RemoteAddr() + if rpc.vm.eventBus.NumClients() >= rpc.vm.config.MaxSubscriptionClients { + return nil, fmt.Errorf("max_subscription_clients %d reached", rpc.vm.config.MaxSubscriptionClients) + } else if rpc.vm.eventBus.NumClientSubscriptions(subscriber) >= rpc.vm.config.MaxSubscriptionsPerClient { + return nil, fmt.Errorf("max_subscriptions_per_client %d reached", rpc.vm.config.MaxSubscriptionsPerClient) + } + // Subscribe to tx being committed in block. subCtx, cancel := context.WithTimeout(context.Background(), core.SubscribeTimeout) defer cancel() @@ -186,7 +198,12 @@ func (rpc *RPC) BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.R // Wait for the tx to be included in a block or timeout. select { case msg := <-deliverTxSub.Out(): // The tx was included in a block. - eventDataTx := msg.Data().(types.EventDataTx) + eventDataTx, ok := msg.Data().(types.EventDataTx) + if !ok { + err = fmt.Errorf("expected types.EventDataTx, got %T", msg.Data()) + rpc.vm.logger.Error("Error on broadcastTxCommit", "err", err) + return nil, err + } return &ctypes.ResultBroadcastTxCommit{ CheckTx: *checkTxRes, TxResult: eventDataTx.Result, @@ -207,8 +224,7 @@ func (rpc *RPC) BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.R TxResult: abci.ExecTxResult{}, Hash: tx.Hash(), }, err - // TODO: use rpc.config.TimeoutBroadcastTxCommit for timeout - case <-time.After(10 * time.Second): + case <-time.After(time.Duration(rpc.vm.config.TimeoutBroadcastTxCommit) * time.Second): err = errors.New("timed out waiting for tx to be included in a block") rpc.vm.logger.Error("Error on broadcastTxCommit", "err", err) return &ctypes.ResultBroadcastTxCommit{ @@ -220,30 +236,46 @@ func (rpc *RPC) BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.R } } +// BroadcastTxAsync returns right away, with no response. Does not wait for +// CheckTx nor transaction results. func (rpc *RPC) BroadcastTxAsync(_ *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { + rpc.vm.logger.Info("BroadcastTxAsync called") err := rpc.vm.mempool.CheckTx(tx, nil, mempl.TxInfo{}) if err != nil { + rpc.vm.logger.Error("Error on broadcastTxAsync", "err", err) return nil, err } return &ctypes.ResultBroadcastTx{Hash: tx.Hash()}, nil } -func (rpc *RPC) BroadcastTxSync(_ *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { +// BroadcastTxSync returns with the response from CheckTx. Does not wait for +// the transaction result. +// More: https://docs.cometbft.com/v0.38.x/rpc/#/Tx/broadcast_tx_sync +func (rpc *RPC) BroadcastTxSync(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) { + rpc.vm.logger.Info("BroadcastTxSync called") resCh := make(chan *abci.ResponseCheckTx, 1) err := rpc.vm.mempool.CheckTx(tx, func(res *abci.ResponseCheckTx) { - resCh <- res + select { + case <-ctx.Context().Done(): + case resCh <- res: + } }, mempl.TxInfo{}) if err != nil { + rpc.vm.logger.Error("Error on BroadcastTxSync", "err", err) return nil, err } - res := <-resCh - return &ctypes.ResultBroadcastTx{ - Code: res.GetCode(), - Data: res.GetData(), - Log: res.GetLog(), - Codespace: res.GetCodespace(), - Hash: tx.Hash(), - }, nil + select { + case <-ctx.Context().Done(): + return nil, fmt.Errorf("broadcast confirmation not received: %w", ctx.Context().Err()) + case res := <-resCh: + return &ctypes.ResultBroadcastTx{ + Code: res.Code, + Data: res.Data, + Log: res.Log, + Codespace: res.Codespace, + Hash: tx.Hash(), + }, nil + } } // filterMinMax returns error if either min or max are negative or min > max @@ -279,6 +311,14 @@ func filterMinMax(base, height, min, max, limit int64) (int64, int64, error) { return min, max, nil } +// BlockchainInfo gets block headers for minHeight <= height <= maxHeight. +// +// If maxHeight does not yet exist, blocks up to the current height will be +// returned. If minHeight does not exist (due to pruning), earliest existing +// height will be used. +// +// At most 20 items will be returned. Block headers are returned in descending +// order (highest first). func (rpc *RPC) BlockchainInfo( _ *rpctypes.Context, minHeight, maxHeight int64, @@ -300,7 +340,9 @@ func (rpc *RPC) BlockchainInfo( var blockMetas []*types.BlockMeta for height := maxHeight; height >= minHeight; height-- { blockMeta := rpc.vm.blockStore.LoadBlockMeta(height) - blockMetas = append(blockMetas, blockMeta) + if blockMeta != nil { + blockMetas = append(blockMetas, blockMeta) + } } return &ctypes.ResultBlockchainInfo{ @@ -309,6 +351,7 @@ func (rpc *RPC) BlockchainInfo( }, nil } +// Genesis returns genesis file. func (rpc *RPC) Genesis(_ *rpctypes.Context) (*ctypes.ResultGenesis, error) { if len(rpc.vm.genChunks) > 1 { return nil, errors.New("genesis response is large, please use the genesis_chunked API instead") @@ -317,6 +360,7 @@ func (rpc *RPC) Genesis(_ *rpctypes.Context) (*ctypes.ResultGenesis, error) { return &ctypes.ResultGenesis{Genesis: rpc.vm.genesis}, nil } +// GenesisChunked returns requested chunk of genesis file func (rpc *RPC) GenesisChunked(_ *rpctypes.Context, chunk uint) (*ctypes.ResultGenesisChunk, error) { if rpc.vm.genChunks == nil { return nil, fmt.Errorf("service configuration error, genesis chunks are not initialized") @@ -328,7 +372,7 @@ func (rpc *RPC) GenesisChunked(_ *rpctypes.Context, chunk uint) (*ctypes.ResultG id := int(chunk) - if id > len(rpc.vm.genChunks)-1 { + if id < 0 || id > len(rpc.vm.genChunks)-1 { return nil, fmt.Errorf("there are %d chunks, %d is invalid", len(rpc.vm.genChunks)-1, id) } @@ -339,24 +383,25 @@ func (rpc *RPC) GenesisChunked(_ *rpctypes.Context, chunk uint) (*ctypes.ResultG }, nil } -// ToDo: no peers, because it's vm +// NetInfo - no peers, because it's vm func (rpc *RPC) NetInfo(_ *rpctypes.Context) (*ctypes.ResultNetInfo, error) { return nil, nil } -// ToDo: we doesn't have consensusState +// DumpConsensusState - we doesn't have consensusState func (rpc *RPC) DumpConsensusState(_ *rpctypes.Context) (*ctypes.ResultDumpConsensusState, error) { return nil, nil } -// ToDo: we doesn't have consensusState +// GetConsensusState - we doesn't have consensusState func (rpc *RPC) GetConsensusState(_ *rpctypes.Context) (*ctypes.ResultConsensusState, error) { return nil, nil } +// ConsensusParams returns requested chunk of genesis file func (rpc *RPC) ConsensusParams( _ *rpctypes.Context, - heightPtr *int64, + _ *int64, ) (*ctypes.ResultConsensusParams, error) { return &ctypes.ResultConsensusParams{ BlockHeight: rpc.vm.blockStore.Height(), @@ -364,30 +409,39 @@ func (rpc *RPC) ConsensusParams( }, nil } +// Health gets node health. Returns empty result (200 OK) on success, no +// response - in case of an error. func (rpc *RPC) Health(*rpctypes.Context) (*ctypes.ResultHealth, error) { return &ctypes.ResultHealth{}, nil } -// bsHeight can be either latest committed or uncommitted (+1) height. +// getHeight bsHeight can be either latest committed or uncommitted (+1) height. func getHeight(bs *store.BlockStore, heightPtr *int64) (int64, error) { - bsHeight := bs.Height() - if heightPtr != nil { - height := *heightPtr - if height <= 0 { - return 0, fmt.Errorf("height must be greater than 0, but got %d", height) - } - if height > bsHeight { - return 0, fmt.Errorf("height %d must be less than or equal to the current blockchain height %d", height, bsHeight) - } - bsBase := bs.Base() - if height < bsBase { - return 0, fmt.Errorf("height %d is not available, lowest height is %d", height, bsBase) - } - return height, nil + if heightPtr == nil { + return bs.Height(), nil + } + + height := *heightPtr + if height <= 0 { + return 0, fmt.Errorf("height must be greater than 0, but got %d", height) + } + if height > bs.Height() { + return 0, fmt.Errorf( + "height %d must be less than or equal to the current blockchain height %d", + height, + bs.Height(), + ) } - return bsHeight, nil + bsBase := bs.Base() + if height < bsBase { + return 0, fmt.Errorf("height %d is not available, lowest height is %d", height, bsBase) + } + + return height, nil } +// Block gets block at a given height. +// If no height is provided, it will fetch the latest block. func (rpc *RPC) Block(_ *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlock, error) { height, err := getHeight(rpc.vm.blockStore, heightPtr) if err != nil { @@ -397,11 +451,15 @@ func (rpc *RPC) Block(_ *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBloc blockMeta := rpc.vm.blockStore.LoadBlockMeta(height) if blockMeta == nil { + rpc.vm.logger.Info("Block not found", "height", height) return &ctypes.ResultBlock{BlockID: types.BlockID{}, Block: block}, nil } + + rpc.vm.logger.Info("Block response", "height", height, "block", block, "blockMeta", blockMeta) return &ctypes.ResultBlock{BlockID: blockMeta.BlockID, Block: block}, nil } +// BlockByHash gets block by hash. func (rpc *RPC) BlockByHash(_ *rpctypes.Context, hash []byte) (*ctypes.ResultBlock, error) { block := rpc.vm.blockStore.LoadBlockByHash(hash) if block == nil { @@ -411,7 +469,13 @@ func (rpc *RPC) BlockByHash(_ *rpctypes.Context, hash []byte) (*ctypes.ResultBlo return &ctypes.ResultBlock{BlockID: blockMeta.BlockID, Block: block}, nil } -func (rpc *RPC) BlockResults(_ *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlockResults, error) { +// BlockResults gets ABCIResults at a given height. +// If no height is provided, it will fetch results for the latest block. +// +// Results are for the height of the block containing the txs. +// Thus response.results.deliver_tx[5] is the results of executing +// getBlock(h).Txs[5] +func (rpc *RPC) BlockResults(_ *rpctypes.Context, _ *int64) (*ctypes.ResultBlockResults, error) { // height, err := getHeight(rpc.vm.blockStore, args.Height) // if err != nil { // return err @@ -432,6 +496,8 @@ func (rpc *RPC) BlockResults(_ *rpctypes.Context, heightPtr *int64) (*ctypes.Res return nil, nil } +// Commit gets block commit at a given height. +// If no height is provided, it will fetch the commit for the latest block. func (rpc *RPC) Commit(_ *rpctypes.Context, heightPtr *int64) (*ctypes.ResultCommit, error) { height, err := getHeight(rpc.vm.blockStore, heightPtr) if err != nil { @@ -477,7 +543,7 @@ func validatePerPage(perPagePtr *int) int { func validatePage(pagePtr *int, perPage, totalCount int) (int, error) { if perPage < 1 { - panic(fmt.Sprintf("zero or negative perPage: %d", perPage)) + return 1, fmt.Errorf("zero or negative perPage: %d", perPage) } if pagePtr == nil { // no page parameter @@ -504,6 +570,11 @@ func validateSkipCount(page, perPage int) int { return skipCount } +// Validators gets the validator set at the given block height. +// +// If no height is provided, it will fetch the latest validator set. Note the +// validators are sorted by their voting power - this is the canonical order +// for the validators in the set as used in computing their Merkle root. func (rpc *RPC) Validators( _ *rpctypes.Context, heightPtr *int64, @@ -538,13 +609,19 @@ func (rpc *RPC) Validators( }, nil } +// Tx allows you to query the transaction results. `nil` could mean the +// transaction is in the mempool, invalidated, or was not sent in the first +// place. func (rpc *RPC) Tx(_ *rpctypes.Context, hash []byte, prove bool) (*ctypes.ResultTx, error) { + rpc.vm.logger.Info("Tx called", "hash", hash) r, err := rpc.vm.txIndexer.Get(hash) if err != nil { + rpc.vm.logger.Error("Error on Tx", "err", err) return nil, err } if r == nil { + rpc.vm.logger.Error("Error on Tx", "tx not found", hash) return nil, fmt.Errorf("tx (%X) not found", hash) } @@ -554,7 +631,11 @@ func (rpc *RPC) Tx(_ *rpctypes.Context, hash []byte, prove bool) (*ctypes.Result var proof types.TxProof if prove { block := rpc.vm.blockStore.LoadBlock(height) - proof = block.Data.Txs.Proof(int(index)) // XXX: overflow on 32-bit machines + + if r.Index > math.MaxInt32 { + return nil, errors.New("index value overflows int on 32-bit systems") + } + proof = block.Data.Txs.Proof(int(index)) } return &ctypes.ResultTx{ @@ -567,6 +648,8 @@ func (rpc *RPC) Tx(_ *rpctypes.Context, hash []byte, prove bool) (*ctypes.Result }, nil } +// TxSearch allows you to query for multiple transactions results. It returns a +// list of transactions (maximum ?per_page entries) and the total count. func (rpc *RPC) TxSearch( ctx *rpctypes.Context, query string, @@ -623,7 +706,11 @@ func (rpc *RPC) TxSearch( var proof types.TxProof if prove { block := rpc.vm.blockStore.LoadBlock(r.Height) - proof = block.Data.Txs.Proof(int(r.Index)) // XXX: overflow on 32-bit machines + + if r.Index > math.MaxInt32 { + return nil, errors.New("index value overflows int on 32-bit systems") + } + proof = block.Data.Txs.Proof(int(r.Index)) } apiResults = append(apiResults, &ctypes.ResultTx{ @@ -639,6 +726,8 @@ func (rpc *RPC) TxSearch( return &ctypes.ResultTxSearch{Txs: apiResults, TotalCount: totalCount}, nil } +// BlockSearch searches for a paginated set of blocks matching +// FinalizeBlock event search criteria. func (rpc *RPC) BlockSearch( ctx *rpctypes.Context, query string, @@ -696,6 +785,8 @@ func (rpc *RPC) BlockSearch( return &ctypes.ResultBlockSearch{Blocks: apiResults, TotalCount: totalCount}, nil } +// Status returns CometBFT status including node info, pubkey, latest block +// hash, app hash, block height and time. func (rpc *RPC) Status(_ *rpctypes.Context) (*ctypes.ResultStatus, error) { var ( earliestBlockHeight int64 @@ -712,6 +803,7 @@ func (rpc *RPC) Status(_ *rpctypes.Context) (*ctypes.ResultStatus, error) { } var ( + err error latestBlockHash tmbytes.HexBytes latestAppHash tmbytes.HexBytes latestBlockTimeNano int64 @@ -727,6 +819,14 @@ func (rpc *RPC) Status(_ *rpctypes.Context) (*ctypes.ResultStatus, error) { } } + chainID := ids.Empty + if rpc.vm.appOpts.ChainID != nil { + chainID, err = ids.ToID(rpc.vm.appOpts.ChainID) + if err != nil { + return nil, err + } + } + result := &ctypes.ResultStatus{ NodeInfo: p2p.DefaultNodeInfo{ ProtocolVersion: p2p.NewProtocolVersion( @@ -734,12 +834,12 @@ func (rpc *RPC) Status(_ *rpctypes.Context) (*ctypes.ResultStatus, error) { version.BlockProtocol, 0, ), - DefaultNodeID: p2p.ID(rpc.vm.appOpts.NodeId), - ListenAddr: "", - Network: fmt.Sprintf("%d", rpc.vm.appOpts.NetworkId), + DefaultNodeID: p2p.ID(fmt.Sprintf("%x", rpc.vm.appOpts.NodeID)), + ListenAddr: fmt.Sprintf("/ext/bc/%s/rpc", chainID), + Network: rpc.vm.config.NetworkName, Version: version.TMCoreSemVer, Channels: nil, - Moniker: "", + Moniker: fmt.Sprintf("%x", rpc.vm.appOpts.NodeID), Other: p2p.DefaultNodeInfoOther{}, }, SyncInfo: ctypes.SyncInfo{ diff --git a/vm/rpc_test.go b/vm/rpc_test.go index 77456c07..64640f70 100644 --- a/vm/rpc_test.go +++ b/vm/rpc_test.go @@ -8,9 +8,10 @@ import ( ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/rpc/jsonrpc/client" + rpctypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/jsonrpc" + "github.com/landslidenetwork/slide-sdk/jsonrpc" ) func setupRPC(t *testing.T) (*http.Server, *LandslideVM, *client.Client) { @@ -23,8 +24,8 @@ func setupRPC(t *testing.T) (*http.Server, *LandslideVM, *client.Client) { server := &http.Server{Addr: address, Handler: mux} go func() { server.ListenAndServe() - //panic(err) - //require.NoError(t, err) + // panic(err) + // require.NoError(t, err) }() // wait for servers to start @@ -57,3 +58,59 @@ func TestStatus(t *testing.T) { t.Logf("Status result %+v", result) } + +// TestRPC is a test RPC server for the LandslideVM. +type TestRPC struct { + vm *LandslideVM +} + +// NewTestRPC creates a new TestRPC. +func NewTestRPC(vm *LandslideVM) *TestRPC { + return &TestRPC{vm} +} + +// Routes returns the available RPC routes. +func (rpc *TestRPC) Routes() map[string]*jsonrpc.RPCFunc { + return map[string]*jsonrpc.RPCFunc{ + "test_panic": jsonrpc.NewRPCFunc(rpc.TestPanic, ""), + } +} + +// NumUnconfirmedTxs gets number of unconfirmed transactions. +func (rpc *TestRPC) TestPanic(_ *rpctypes.Context) (*ctypes.ResultUnconfirmedTxs, error) { + panic("test panic") +} + +// setupTestRPC sets up a test server and client for the LandslideVM. +func setupTestRPC(t *testing.T) (*http.Server, *LandslideVM, *client.Client) { + vm := newFreshKvApp(t) + vmLnd := vm.(*LandslideVM) + mux := http.NewServeMux() + jsonrpc.RegisterRPCFuncs(mux, NewTestRPC(vmLnd).Routes(), vmLnd.logger) + + address := "127.0.0.1:44444" + server := &http.Server{Addr: address, Handler: mux, ReadHeaderTimeout: time.Second * 5, WriteTimeout: time.Second * 5} + go func() { + _ = server.ListenAndServe() + }() + + // wait for servers to start + time.Sleep(time.Second * 2) + + rpcClient, err := client.New("tcp://" + address) + require.NoError(t, err) + + return server, vmLnd, rpcClient +} + +// TestPanic tests that the server recovers from a panic. +func TestPanic(t *testing.T) { + server, _, rpcClient := setupTestRPC(t) + defer server.Close() + + result := new(ctypes.ResultStatus) + _, err := rpcClient.Call(context.Background(), "test_panic", map[string]interface{}{}, result) + require.Error(t, err) + + t.Logf("Panic result %+v", err) +} diff --git a/vm/types/block/block.go b/vm/types/block/block.go index 8d9d0ae2..80e95f13 100644 --- a/vm/types/block/block.go +++ b/vm/types/block/block.go @@ -4,7 +4,7 @@ import ( "github.com/cometbft/cometbft/types" ) -func BlockParentHash(block *types.Block) [32]byte { +func ParentHash(block *types.Block) [32]byte { var parentHash [32]byte if block.LastBlockID.Hash != nil { parentHash = [32]byte(block.LastBlockID.Hash) diff --git a/vm/types/config.go b/vm/types/config.go new file mode 100644 index 00000000..5c078b93 --- /dev/null +++ b/vm/types/config.go @@ -0,0 +1,118 @@ +package types + +import ( + "encoding/json" + "fmt" + + "github.com/cometbft/cometbft/types" +) + +const ( + defaultTimeoutBroadcastTxCommit uint16 = 10 // seconds + defaultNetworkName = "landslide-test" + + defaultMaxBytes int64 = 100 * 1024 * 1024 // 10MB + defaultMaxGas int64 = 10000000 + + defaultMaxSubscriptionClients = 100 + defaultMaxSubscriptionsPerClient = 5 +) + +type ( + Config struct { + VMConfig VMConfig `json:"vm_config"` + AppConfig json.RawMessage `json:"app_config"` + } + + // VMConfig contains the configuration of the VM. + VMConfig struct { + NetworkName string `json:"network_name"` + TimeoutBroadcastTxCommit uint16 `json:"timeout_broadcast_tx_commit"` + ConsensusParams ConsensusParams `json:"consensus_params"` + MaxSubscriptionClients int `json:"max_subscription_clients"` + MaxSubscriptionsPerClient int `json:"max_subscriptions_per_client"` + } + + // ConsensusParams contains consensus critical parameters that determine the + // validity of blocks. + ConsensusParams struct { + Block BlockParams `json:"block"` + Evidence EvidenceParams `json:"evidence"` + } + // BlockParams contains the consensus critical parameters for a block. + BlockParams struct { + MaxBytes int64 `json:"max_bytes"` + MaxGas int64 `json:"max_gas"` + } + // EvidenceParams contains the consensus critical parameters for evidence. + EvidenceParams struct { + MaxBytes int64 `json:"max_bytes"` + } +) + +// SetDefaults sets the default values for the config. +func (c *VMConfig) SetDefaults() { + c.NetworkName = defaultNetworkName + c.TimeoutBroadcastTxCommit = defaultTimeoutBroadcastTxCommit + + c.ConsensusParams.Block.MaxBytes = defaultMaxBytes + c.ConsensusParams.Block.MaxGas = defaultMaxGas + c.ConsensusParams.Evidence.MaxBytes = 1000 + + c.MaxSubscriptionsPerClient = defaultMaxSubscriptionsPerClient + c.MaxSubscriptionClients = defaultMaxSubscriptionClients +} + +// Validate returns an error if this is an invalid config. +func (c *VMConfig) Validate() error { + if len(c.NetworkName) == 0 { + return fmt.Errorf("network_name can't be empty") + } + + if err := c.ConsensusParams.Validate(); err != nil { + return fmt.Errorf("consensus_params is invalid: %w", err) + } + + if c.MaxSubscriptionsPerClient < 0 { + return fmt.Errorf("max_subscriptions_per_client must be positive. Got %d", c.MaxSubscriptionsPerClient) + } + + if c.MaxSubscriptionClients < 0 { + return fmt.Errorf("max_subscription_clients must be positive. Got %d", c.MaxSubscriptionClients) + } + + return nil +} + +// Validate returns an error if this is an invalid config. +func (c *ConsensusParams) Validate() error { + if c.Block.MaxBytes == 0 { + return fmt.Errorf("block.MaxBytes cannot be 0") + } + if c.Block.MaxBytes < -1 { + return fmt.Errorf("block.MaxBytes must be -1 or greater than 0. Got %d", c.Block.MaxBytes) + } + if c.Block.MaxBytes > types.MaxBlockSizeBytes { + return fmt.Errorf("block.MaxBytes is too big. %d > %d", c.Block.MaxBytes, types.MaxBlockSizeBytes) + } + + if c.Block.MaxGas < -1 { + return fmt.Errorf("block.MaxGas must be greater or equal to -1. Got %d", c.Block.MaxGas) + } + + maxBytes := c.Block.MaxBytes + if maxBytes == -1 { + maxBytes = int64(types.MaxBlockSizeBytes) + } + if c.Evidence.MaxBytes > maxBytes { + return fmt.Errorf("evidence.MaxBytes is greater than upper bound, %d > %d", + c.Evidence.MaxBytes, c.Block.MaxBytes) + } + + if c.Evidence.MaxBytes < 0 { + return fmt.Errorf("evidence.MaxBytes must be non negative. Got: %d", + c.Evidence.MaxBytes) + } + + return nil +} diff --git a/vm/types/state/error.go b/vm/types/state/error.go index 4c7c8a26..edfa3cad 100644 --- a/vm/types/state/error.go +++ b/vm/types/state/error.go @@ -3,6 +3,7 @@ package state import ( "errors" "fmt" + "github.com/cometbft/cometbft/state" ) diff --git a/vm/types/state/executor.go b/vm/types/state/executor.go index 4ab3b26e..69eba19e 100644 --- a/vm/types/state/executor.go +++ b/vm/types/state/executor.go @@ -43,6 +43,10 @@ type BlockExecutor struct { logger log.Logger metrics *statetypes.Metrics + + blockMaxBytes int64 + blockMaxGas int64 + evidenceMaxBytes int64 } type BlockExecutorOption func(executor *BlockExecutor) @@ -61,16 +65,23 @@ func NewBlockExecutor( proxyApp proxy.AppConnConsensus, mempool mempool.Mempool, blockStore statetypes.BlockStore, + blockMaxBytes int64, + blockMaxGas int64, + evidenceMaxBytes int64, options ...BlockExecutorOption, + ) *BlockExecutor { res := &BlockExecutor{ - store: stateStore, - proxyApp: proxyApp, - eventBus: types.NopEventBus{}, - mempool: mempool, - logger: logger, - metrics: statetypes.NopMetrics(), - blockStore: blockStore, + store: stateStore, + proxyApp: proxyApp, + eventBus: types.NopEventBus{}, + mempool: mempool, + logger: logger, + metrics: statetypes.NopMetrics(), + blockStore: blockStore, + blockMaxBytes: blockMaxBytes, + blockMaxGas: blockMaxGas, + evidenceMaxBytes: evidenceMaxBytes, } for _, option := range options { @@ -104,24 +115,22 @@ func (blockExec *BlockExecutor) CreateProposalBlock( proposerAddr []byte, ) (*types.Block, error) { - // maxBytes := state.ConsensusParams.Block.MaxBytes - // emptyMaxBytes := maxBytes == -1 - // if emptyMaxBytes { - // maxBytes = int64(types.MaxBlockSizeBytes) - // } + maxBytes := blockExec.blockMaxBytes + emptyMaxBytes := maxBytes == -1 + if emptyMaxBytes { + maxBytes = int64(types.MaxBlockSizeBytes) + } - // maxGas := state.ConsensusParams.Block.MaxGas + maxGas := blockExec.blockMaxGas // Fetch a limited amount of valid txs - // maxDataBytes := types.MaxDataBytes(maxBytes, 0, state.Validators.Size()) - // maxReapBytes := maxDataBytes - // if emptyMaxBytes { - // maxReapBytes = -1 - // } - maxDataBytes := int64(-1) - - // txs := blockExec.mempool.ReapMaxBytesMaxGas(maxReapBytes, maxGas) - txs := blockExec.mempool.ReapMaxBytesMaxGas(-1, -1) + maxDataBytes := types.MaxDataBytes(maxBytes, blockExec.evidenceMaxBytes, state.Validators.Size()) + maxReapBytes := maxDataBytes + if emptyMaxBytes { + maxReapBytes = -1 + } + + txs := blockExec.mempool.ReapMaxBytesMaxGas(maxReapBytes, maxGas) commit := lastExtCommit.ToCommit() block := state.MakeBlock(height, txs, commit, nil, proposerAddr) rpp, err := blockExec.proxyApp.PrepareProposal( @@ -149,22 +158,20 @@ func (blockExec *BlockExecutor) CreateProposalBlock( return nil, err } - // TODO: get maxTxSizeBytes from the app config - maxTxSizeBytes := int64(types.MaxBlockSizeBytes) - txl := types.ToTxs(rpp.Txs) - if err := txl.Validate(maxTxSizeBytes); err != nil { + if err := txl.Validate(maxDataBytes); err != nil { return nil, err } return state.MakeBlock(height, txl, commit, nil, proposerAddr), nil } +// ProcessProposal is called whenever a node receives a complete proposal. func (blockExec *BlockExecutor) ProcessProposal( block *types.Block, state statetypes.State, ) (bool, error) { - resp, err := blockExec.proxyApp.ProcessProposal(context.TODO(), &abci.RequestProcessProposal{ + resp, err := blockExec.proxyApp.ProcessProposal(context.Background(), &abci.RequestProcessProposal{ Hash: block.Header.Hash(), Height: block.Header.Height, Time: block.Header.Time, @@ -207,7 +214,7 @@ func (blockExec *BlockExecutor) ApplyBlock( } startTime := time.Now().UnixNano() - abciResponse, err := blockExec.proxyApp.FinalizeBlock(context.TODO(), &abci.RequestFinalizeBlock{ + abciResponse, err := blockExec.proxyApp.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{ Hash: block.Hash(), NextValidatorsHash: block.NextValidatorsHash, ProposerAddress: block.ProposerAddress, @@ -384,7 +391,7 @@ func (blockExec *BlockExecutor) Commit( } // Commit block, get hash back - res, err := blockExec.proxyApp.Commit(context.TODO()) + res, err := blockExec.proxyApp.Commit(context.Background()) if err != nil { blockExec.logger.Error("client error during proxyAppConn.CommitSync", "err", err) return 0, err @@ -720,7 +727,7 @@ func ExecCommitBlock( ) ([]byte, error) { commitInfo := buildLastCommitInfoFromStore(block, store, initialHeight) - resp, err := appConnConsensus.FinalizeBlock(context.TODO(), &abci.RequestFinalizeBlock{ + resp, err := appConnConsensus.FinalizeBlock(context.Background(), &abci.RequestFinalizeBlock{ Hash: block.Hash(), NextValidatorsHash: block.NextValidatorsHash, ProposerAddress: block.ProposerAddress, @@ -743,7 +750,7 @@ func ExecCommitBlock( logger.Info("executed block", "height", block.Height, "app_hash", fmt.Sprintf("%X", resp.AppHash)) // Commit block - _, err = appConnConsensus.Commit(context.TODO()) + _, err = appConnConsensus.Commit(context.Background()) if err != nil { logger.Error("client error during proxyAppConn.Commit", "err", err) return nil, err diff --git a/vm/types/state/utils.go b/vm/types/state/utils.go index e0f53459..5d1b3e8b 100644 --- a/vm/types/state/utils.go +++ b/vm/types/state/utils.go @@ -1,16 +1,19 @@ package state import ( + "bytes" "errors" "fmt" + "time" "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/libs/json" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/state" "github.com/cometbft/cometbft/types" + cmttime "github.com/cometbft/cometbft/types/time" - "github.com/consideritdone/landslidevm/proto/vm" + "github.com/landslidenetwork/slide-sdk/proto/vm" ) func EncodeBlockWithStatus(blk *types.Block, status vm.Status) ([]byte, error) { @@ -82,6 +85,54 @@ func ValidateBlock(state state.State, block *types.Block) error { block.ChainID, ) } + if state.LastBlockHeight == 0 && block.Height != state.InitialHeight { + return fmt.Errorf("wrong Block.Header.Height. Expected %v for initial block, got %v", + block.Height, state.InitialHeight) + } + if state.LastBlockHeight > 0 && block.Height != state.LastBlockHeight+1 { + return fmt.Errorf("wrong Block.Header.Height. Expected %v, got %v", + state.LastBlockHeight+1, + block.Height, + ) + } + // Validate prev block info. + if !block.LastBlockID.Equals(state.LastBlockID) { + return fmt.Errorf("wrong Block.Header.LastBlockID. Expected %v, got %v", + state.LastBlockID, + block.LastBlockID, + ) + } + // Validate app info + if !bytes.Equal(block.AppHash, state.AppHash) { + return fmt.Errorf("wrong Block.Header.AppHash. Expected %X, got %v", + state.AppHash, + block.AppHash, + ) + } + if !bytes.Equal(block.ConsensusHash, state.ConsensusParams.Hash()) { + return fmt.Errorf("wrong Block.Header.ConsensusHash. Expected %X, got %v", + state.ConsensusParams.Hash(), + block.ConsensusHash, + ) + } + if !bytes.Equal(block.LastResultsHash, state.LastResultsHash) { + return fmt.Errorf("wrong Block.Header.LastResultsHash. Expected %X, got %v", + state.LastResultsHash, + block.LastResultsHash, + ) + } + if !bytes.Equal(block.ValidatorsHash, state.Validators.Hash()) { + return fmt.Errorf("wrong Block.Header.ValidatorsHash. Expected %X, got %v", + state.Validators.Hash(), + block.ValidatorsHash, + ) + } + if !bytes.Equal(block.NextValidatorsHash, state.NextValidators.Hash()) { + return fmt.Errorf("wrong Block.Header.NextValidatorsHash. Expected %X, got %v", + state.NextValidators.Hash(), + block.NextValidatorsHash, + ) + } // Validate block LastCommit. if block.Height == state.InitialHeight { @@ -109,6 +160,13 @@ func ValidateBlock(state state.State, block *types.Block) error { state.LastBlockTime, ) } + medianTime := MedianTime(block.LastCommit, state.LastValidators) + if !block.Time.Equal(medianTime) { + return fmt.Errorf("invalid block time. Expected %v, got %v", + medianTime, + block.Time, + ) + } case block.Height == state.InitialHeight: genesisTime := state.LastBlockTime @@ -124,5 +182,33 @@ func ValidateBlock(state state.State, block *types.Block) error { block.Height, state.InitialHeight) } + // Check evidence doesn't exceed the limit amount of bytes. + if max, got := state.ConsensusParams.Evidence.MaxBytes, block.Evidence.ByteSize(); got > max { + return types.NewErrEvidenceOverflow(max, got) + } + return nil } + +// MedianTime computes a median time for a given Commit (based on Timestamp field of votes messages) and the +// corresponding validator set. The computed time is always between timestamps of +// the votes sent by honest processes, i.e., a faulty processes can not arbitrarily increase or decrease the +// computed value. +func MedianTime(commit *types.Commit, validators *types.ValidatorSet) time.Time { + weightedTimes := make([]*cmttime.WeightedTime, len(commit.Signatures)) + totalVotingPower := int64(0) + + for i, commitSig := range commit.Signatures { + if commitSig.BlockIDFlag == types.BlockIDFlagAbsent { + continue + } + _, validator := validators.GetByAddress(commitSig.ValidatorAddress) + // If there's no condition, TestValidateBlockCommit panics; not needed normally. + if validator != nil { + totalVotingPower += validator.VotingPower + weightedTimes[i] = cmttime.NewWeightedTime(commitSig.Timestamp, validator.VotingPower) + } + } + + return cmttime.WeightedMedian(weightedTimes, totalVotingPower) +} diff --git a/vm/types/state/utils_test.go b/vm/types/state/utils_test.go index b11815ce..51745018 100644 --- a/vm/types/state/utils_test.go +++ b/vm/types/state/utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/proto/vm" + "github.com/landslidenetwork/slide-sdk/proto/vm" ) func TestEncodeDecodeBlockWithStatus(t *testing.T) { diff --git a/vm/types/state/wrapped_block.go b/vm/types/state/wrapped_block.go index 9eb19528..7e112e99 100644 --- a/vm/types/state/wrapped_block.go +++ b/vm/types/state/wrapped_block.go @@ -5,9 +5,9 @@ import ( "github.com/cometbft/cometbft/types" - "github.com/consideritdone/landslidevm/proto/vm" - "github.com/consideritdone/landslidevm/utils/cache" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/proto/vm" + "github.com/landslidenetwork/slide-sdk/utils/cache" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) // TODO: make these configurable diff --git a/vm/types/state/wrapped_block_test.go b/vm/types/state/wrapped_block_test.go index 9b2b8e5a..3943e89d 100644 --- a/vm/types/state/wrapped_block_test.go +++ b/vm/types/state/wrapped_block_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/consideritdone/landslidevm/proto/vm" - "github.com/consideritdone/landslidevm/utils/ids" + "github.com/landslidenetwork/slide-sdk/proto/vm" + "github.com/landslidenetwork/slide-sdk/utils/ids" ) func TestGetCachedBlock(t *testing.T) { diff --git a/vm/vm.go b/vm/vm.go index ba36139f..d656b298 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -16,6 +16,7 @@ import ( abcitypes "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/consensus" + "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/secp256k1" "github.com/cometbft/cometbft/libs/log" "github.com/cometbft/cometbft/mempool" @@ -36,20 +37,20 @@ import ( "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/consideritdone/landslidevm/database" - "github.com/consideritdone/landslidevm/grpcutils" - "github.com/consideritdone/landslidevm/http" - "github.com/consideritdone/landslidevm/jsonrpc" - httppb "github.com/consideritdone/landslidevm/proto/http" - messengerpb "github.com/consideritdone/landslidevm/proto/messenger" - "github.com/consideritdone/landslidevm/proto/rpcdb" - vmpb "github.com/consideritdone/landslidevm/proto/vm" - "github.com/consideritdone/landslidevm/utils/ids" - vmtypes "github.com/consideritdone/landslidevm/vm/types" - "github.com/consideritdone/landslidevm/vm/types/block" - "github.com/consideritdone/landslidevm/vm/types/closer" - "github.com/consideritdone/landslidevm/vm/types/commit" - vmstate "github.com/consideritdone/landslidevm/vm/types/state" + "github.com/landslidenetwork/slide-sdk/database" + "github.com/landslidenetwork/slide-sdk/grpcutils" + "github.com/landslidenetwork/slide-sdk/http" + "github.com/landslidenetwork/slide-sdk/jsonrpc" + httppb "github.com/landslidenetwork/slide-sdk/proto/http" + messengerpb "github.com/landslidenetwork/slide-sdk/proto/messenger" + "github.com/landslidenetwork/slide-sdk/proto/rpcdb" + vmpb "github.com/landslidenetwork/slide-sdk/proto/vm" + "github.com/landslidenetwork/slide-sdk/utils/ids" + vmtypes "github.com/landslidenetwork/slide-sdk/vm/types" + "github.com/landslidenetwork/slide-sdk/vm/types/block" + "github.com/landslidenetwork/slide-sdk/vm/types/closer" + "github.com/landslidenetwork/slide-sdk/vm/types/commit" + vmstate "github.com/landslidenetwork/slide-sdk/vm/types/state" ) const ( @@ -78,17 +79,19 @@ type ( Application = abcitypes.Application AppCreatorOpts struct { - NetworkId uint32 - SubnetId []byte - ChainId []byte - NodeId []byte + NetworkID uint32 + SubnetID []byte + ChainID []byte + NodeID []byte PublicKey []byte - XChainId []byte - CChainId []byte - AvaxAssetId []byte + XChainID []byte + CChainID []byte + AvaxAssetID []byte GenesisBytes []byte UpgradeBytes []byte ConfigBytes []byte + Config *vmtypes.Config + ChainDataDir string } AppCreator func(*AppCreatorOpts) (Application, error) @@ -132,7 +135,9 @@ type ( preferred [32]byte wrappedBlocks *vmstate.WrappedBlocksStorage - clientConn grpc.ClientConnInterface + clientConn grpc.ClientConnInterface + optClientConn *grpc.ClientConn + config vmtypes.VMConfig } ) @@ -144,7 +149,7 @@ func NewViaDB(database dbm.DB, creator AppCreator, options ...func(*LandslideVM) vm := &LandslideVM{ appCreator: creator, database: database, - allowShutdown: vmtypes.NewAtomic(true), + allowShutdown: vmtypes.NewAtomic(false), vmenabled: vmtypes.NewAtomic(false), vmstate: vmtypes.NewAtomic(vmpb.State_STATE_UNSPECIFIED), vmconnected: vmtypes.NewAtomic(false), @@ -160,13 +165,23 @@ func NewViaDB(database dbm.DB, creator AppCreator, options ...func(*LandslideVM) return vm } +// WithClientConn sets the client connection for the VM. func WithClientConn(clientConn grpc.ClientConnInterface) func(vm *LandslideVM) { return func(vm *LandslideVM) { vm.clientConn = clientConn } } -// Initialize this VM. +// WithOptClientConn sets the optional client connection for the VM. +// it overrides the client connection set by WithClientConn. +func WithOptClientConn(clientConn *grpc.ClientConn) func(vm *LandslideVM) { + return func(vm *LandslideVM) { + vm.optClientConn = clientConn + } +} + +// Initialize initializes the VM. +// This method should only be accessible by the AvalancheGo node and not exposed publicly. func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest) (*vmpb.InitializeResponse, error) { registerer := prometheus.NewRegistry() @@ -191,20 +206,26 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest // Register metrics for each Go plugin processes vm.processMetrics = registerer - if vm.clientConn == nil { - clientConn, err := grpc.Dial( + vm.logger = log.NewTMLogger(os.Stdout) + + // add to connCloser even we have defined vm.clientConn via Option + if vm.optClientConn != nil { + vm.connCloser.Add(vm.optClientConn) + vm.clientConn = vm.optClientConn + } else { + clientConn, err := grpc.NewClient( "passthrough:///"+req.ServerAddr, grpc.WithChainUnaryInterceptor(grpcClientMetrics.UnaryClientInterceptor()), grpc.WithChainStreamInterceptor(grpcClientMetrics.StreamClientInterceptor()), grpc.WithTransportCredentials(insecure.NewCredentials()), ) if err != nil { - // Ignore closing errors to return the original error - _ = vm.connCloser.Close() + if closerErr := vm.connCloser.Close(); closerErr != nil { + vm.logger.Error("failed to close connCloser", "err", err) + } return nil, err } - // TODO: add to connCloser even we have defined vm.clientConn via Option vm.connCloser.Add(clientConn) vm.clientConn = clientConn } @@ -218,12 +239,17 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest select { case msg, ok := <-vm.toEngine: if !ok { + vm.logger.Error("channel closed") return } // Nothing to do with the error within the goroutine - _, _ = msgClient.Notify(context.Background(), &messengerpb.NotifyRequest{ + _, err := msgClient.Notify(context.Background(), &messengerpb.NotifyRequest{ Message: msg, }) + if err != nil { + vm.logger.Error("failed to notify", "err", err) + } + case <-vm.closed: return } @@ -232,20 +258,20 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest // Dial the database if vm.database == nil { - dbClientConn, err := grpc.Dial( + dbClientConn, err := grpc.NewClient( "passthrough:///"+req.DbServerAddr, grpc.WithChainUnaryInterceptor(grpcClientMetrics.UnaryClientInterceptor()), grpc.WithChainStreamInterceptor(grpcClientMetrics.StreamClientInterceptor()), grpc.WithTransportCredentials(insecure.NewCredentials()), ) if err != nil { + vm.logger.Error("failed to dial database", "err", err) return nil, err } vm.connCloser.Add(dbClientConn) vm.databaseClient = rpcdb.NewDatabaseClient(dbClientConn) vm.database = database.New(vm.databaseClient) } - vm.logger = log.NewTMLogger(os.Stdout) dbBlockStore := dbm.NewPrefixDB(vm.database, dbPrefixBlockStore) vm.blockStore = store.NewBlockStore(dbBlockStore) @@ -253,23 +279,38 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest vm.stateStore = state.NewStore(dbStateStore, state.StoreOptions{DiscardABCIResponses: false}) vm.appOpts = &AppCreatorOpts{ - NetworkId: req.NetworkId, - SubnetId: req.SubnetId, - ChainId: req.CChainId, - NodeId: req.NodeId, + NetworkID: req.NetworkId, + SubnetID: req.SubnetId, + ChainID: req.ChainId, + NodeID: req.NodeId, PublicKey: req.PublicKey, - XChainId: req.XChainId, - CChainId: req.CChainId, - AvaxAssetId: req.AvaxAssetId, + XChainID: req.XChainId, + CChainID: req.CChainId, + AvaxAssetID: req.AvaxAssetId, GenesisBytes: req.GenesisBytes, UpgradeBytes: req.UpgradeBytes, ConfigBytes: req.ConfigBytes, + ChainDataDir: req.ChainDataDir, } app, err := vm.appCreator(vm.appOpts) if err != nil { + vm.logger.Error("failed to create app", "err", err) return nil, err } + // Set the default configuration + var cfg vmtypes.Config + cfg.VMConfig.SetDefaults() + if len(vm.appOpts.ConfigBytes) > 0 { + if err := json.Unmarshal(vm.appOpts.ConfigBytes, &cfg); err != nil { + return nil, fmt.Errorf("failed to unmarshal config %s: %w", string(vm.appOpts.ConfigBytes), err) + } + } + if err := cfg.VMConfig.Validate(); err != nil { + return nil, err + } + vm.config = cfg.VMConfig + vm.state, vm.genesis, err = node.LoadStateFromDBOrGenesisDocProvider( dbStateStore, func() (*types.GenesisDoc, error) { @@ -352,7 +393,16 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest blk = vm.blockStore.LoadBlock(vm.state.LastBlockHeight) } else { vm.logger.Debug("creating genesis block") - executor := vmstate.NewBlockExecutor(vm.stateStore, vm.logger, vm.app.Consensus(), vm.mempool, vm.blockStore) + executor := vmstate.NewBlockExecutor( + vm.stateStore, + vm.logger, + vm.app.Consensus(), + vm.mempool, + vm.blockStore, + vm.config.ConsensusParams.Block.MaxBytes, + vm.config.ConsensusParams.Block.MaxGas, + vm.config.ConsensusParams.Evidence.MaxBytes, + ) executor.SetEventBus(vm.eventBus) blk, err = executor.CreateProposalBlock(context.Background(), vm.state.LastBlockHeight+1, vm.state, &types.ExtendedCommit{}, proposerAddress) @@ -388,10 +438,10 @@ func (vm *LandslideVM) Initialize(_ context.Context, req *vmpb.InitializeRequest if err != nil { return nil, err } - vm.logger.Debug("initialize block", "bytes ", blockBytes) + // vm.logger.Debug("initialize block", "bytes ", blockBytes) vm.logger.Info("vm initialization completed") - parentHash := block.BlockParentHash(blk) + parentHash := block.ParentHash(blk) return &vmpb.InitializeResponse{ LastAcceptedId: blk.Hash(), @@ -420,7 +470,7 @@ func (vm *LandslideVM) SetState(_ context.Context, req *vmpb.SetStateRequest) (* } vm.logger.Debug("SetState", "LastAcceptedId", vm.state.LastBlockID.Hash, "block", blk.Hash()) - parentHash := block.BlockParentHash(blk) + parentHash := block.ParentHash(blk) res := vmpb.SetStateResponse{ LastAcceptedId: blk.Hash(), LastAcceptedParentId: parentHash[:], @@ -439,7 +489,7 @@ func (vm *LandslideVM) CanShutdown() bool { // Shutdown is called when the node is shutting down. func (vm *LandslideVM) Shutdown(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { - vm.logger.Info("Shutdown") + fmt.Println("Shutdown") vm.allowShutdown.Set(true) if vm.closed != nil { close(vm.closed) @@ -504,10 +554,20 @@ func (vm *LandslideVM) Disconnected(context.Context, *vmpb.DisconnectedRequest) return &emptypb.Empty{}, nil } -// BuildBlock attempt to create a new block from data contained in the VM. +// BuildBlock attempts to create a new block from data contained in the VM. +// This method should be restricted to the AvalancheGo node. func (vm *LandslideVM) BuildBlock(context.Context, *vmpb.BuildBlockRequest) (*vmpb.BuildBlockResponse, error) { vm.logger.Info("BuildBlock") - executor := vmstate.NewBlockExecutor(vm.stateStore, vm.logger, vm.app.Consensus(), vm.mempool, vm.blockStore) + executor := vmstate.NewBlockExecutor( + vm.stateStore, + vm.logger, + vm.app.Consensus(), + vm.mempool, + vm.blockStore, + vm.config.ConsensusParams.Block.MaxBytes, + vm.config.ConsensusParams.Block.MaxGas, + vm.config.ConsensusParams.Evidence.MaxBytes, + ) executor.SetEventBus(vm.eventBus) signatures := make([]types.ExtendedCommitSig, len(vm.state.Validators.Validators)) @@ -517,7 +577,7 @@ func (vm *LandslideVM) BuildBlock(context.Context, *vmpb.BuildBlockRequest) (*vm BlockIDFlag: types.BlockIDFlagNil, Timestamp: time.Now(), ValidatorAddress: vm.state.Validators.Validators[i].Address, - Signature: []byte{0x0}, + Signature: crypto.CRandBytes(types.MaxSignatureSize), }, } } @@ -565,7 +625,8 @@ func (vm *LandslideVM) BuildBlock(context.Context, *vmpb.BuildBlockRequest) (*vm // ParseBlock attempt to create a block from a stream of bytes. func (vm *LandslideVM) ParseBlock(_ context.Context, req *vmpb.ParseBlockRequest) (*vmpb.ParseBlockResponse, error) { - vm.logger.Debug("ParseBlock", "bytes", req.Bytes) + vm.logger.Info("ParseBlock") + // vm.logger.Debug("ParseBlock", "bytes", req.Bytes) var ( blk *types.Block blkStatus vmpb.Status @@ -821,7 +882,7 @@ func (vm *LandslideVM) GetStateSummary(context.Context, *vmpb.GetStateSummaryReq func (vm *LandslideVM) BlockVerify(_ context.Context, req *vmpb.BlockVerifyRequest) (*vmpb.BlockVerifyResponse, error) { vm.logger.Info("BlockVerify") - vm.logger.Debug("block verify", "bytes", req.Bytes) + // vm.logger.Debug("block verify", "bytes", req.Bytes) blk, blkStatus, err := vmstate.DecodeBlockWithStatus(req.Bytes) if err != nil { @@ -851,6 +912,8 @@ func (vm *LandslideVM) BlockVerify(_ context.Context, req *vmpb.BlockVerifyReque return &vmpb.BlockVerifyResponse{Timestamp: timestamppb.New(blk.Time)}, nil } +// BlockAccept notifies the VM that a block has been accepted. +// This is a critical method and should not be exposed publicly. func (vm *LandslideVM) BlockAccept(_ context.Context, req *vmpb.BlockAcceptRequest) (*emptypb.Empty, error) { vm.logger.Info("BlockAccept") @@ -865,7 +928,16 @@ func (vm *LandslideVM) BlockAccept(_ context.Context, req *vmpb.BlockAcceptReque return nil, ErrNotFound } - executor := vmstate.NewBlockExecutor(vm.stateStore, vm.logger, vm.app.Consensus(), vm.mempool, vm.blockStore) + executor := vmstate.NewBlockExecutor( + vm.stateStore, + vm.logger, + vm.app.Consensus(), + vm.mempool, + vm.blockStore, + vm.config.ConsensusParams.Block.MaxBytes, + vm.config.ConsensusParams.Block.MaxGas, + vm.config.ConsensusParams.Evidence.MaxBytes, + ) executor.SetEventBus(vm.eventBus) blk := wblk.Block diff --git a/vm/vm_test.go b/vm/vm_test.go index dc4e31c2..a5001c2f 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -3,14 +3,18 @@ package vm import ( "context" _ "embed" + "net" "testing" dbm "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/abci/example/kvstore" "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/test/bufconn" + "google.golang.org/protobuf/types/known/emptypb" - vmpb "github.com/consideritdone/landslidevm/proto/vm" + vmpb "github.com/landslidenetwork/slide-sdk/proto/vm" ) var ( @@ -18,22 +22,38 @@ var ( kvstorevmGenesis []byte ) -type mockClientConn struct { -} +const bufSize = 1024 * 1024 + +var lis *bufconn.Listener -func (m *mockClientConn) Invoke(ctx context.Context, method string, args any, reply any, opts ...grpc.CallOption) error { - return nil +func init() { + lis = bufconn.Listen(bufSize) + s := grpc.NewServer() + // Register your server implementations here, e.g., pb.RegisterGreeterServer(s, &server{}) + go func() { + if err := s.Serve(lis); err != nil { + panic("Server exited with error: " + err.Error()) + } + }() } -func (m *mockClientConn) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { - return nil, nil +func bufDialer(context.Context, string) (net.Conn, error) { + return lis.Dial() } func newKvApp(t *testing.T, vmdb, appdb dbm.DB) vmpb.VMServer { - mockConn := &mockClientConn{} + mockConn, err := grpc.NewClient( + "bufnet", + grpc.WithContextDialer(bufDialer), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + t.Fatalf("Failed to dial bufnet: %v", err) + } + vm := NewViaDB(vmdb, func(*AppCreatorOpts) (Application, error) { return kvstore.NewApplication(appdb), nil - }, WithClientConn(mockConn)) + }, WithOptClientConn(mockConn)) require.NotNil(t, vm) initRes, err := vm.Initialize(context.TODO(), &vmpb.InitializeRequest{ DbServerAddr: "inmemory", @@ -120,3 +140,39 @@ func TestAcceptBlock(t *testing.T) { }) require.NoError(t, err) } + +// TestShutdownWithoutInit tests VM Shutdown function. This function called without Initialize in Avalanchego Factory +// https://github.com/ava-labs/avalanchego/blob/0c4efd743e1d737f4e8970d0e0ebf229ea44406c/vms/manager.go#L129 +func TestShutdownWithoutInit(t *testing.T) { + vmdb := dbm.NewMemDB() + appdb := dbm.NewMemDB() + + mockConn, err := grpc.NewClient( + "bufnet", + grpc.WithContextDialer(bufDialer), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + t.Fatalf("Failed to dial bufnet: %v", err) + } + + vm := NewViaDB(vmdb, func(*AppCreatorOpts) (Application, error) { + return kvstore.NewApplication(appdb), nil + }, WithOptClientConn(mockConn)) + require.NotNil(t, vm) + _, err = vm.Shutdown(context.Background(), &emptypb.Empty{}) + require.NoError(t, err) +} + +// allowShutdown should be false by default https://github.com/ava-labs/avalanchego/blob/c8a5d0b11bcfe8b8a74983a9b0ef04fc68e78cf3/vms/rpcchainvm/vm.go#L40 +func TestAllowShutdown(t *testing.T) { + vm := newFreshKvApp(t) + vmLnd := vm.(*LandslideVM) + + require.False(t, vmLnd.CanShutdown()) + + _, err := vm.Shutdown(context.Background(), &emptypb.Empty{}) + require.NoError(t, err) + + require.True(t, vmLnd.CanShutdown()) +}