This adds the precisebank protobuf generated swagger documentation to
the swagger combine configuration in order to be rendered in the
swagger.yaml file.
This adds the upstream ethermint swagger file to the proto-deps and adds
the swagger combine config to include it in the kava generated swagger.
Run `make proto-all` to update.
* feat!(precompile): Add registry and genesis tests
Based on evgeniy-scherbina's work, this adds a new precompile module
which defines a contract moudule with an example noop contract that
will be will be used for implementing test functions. In addition,
it defines a registry module that instantiates stateful precompile
contracts and associates them with an address in a global registry
defined in kava-labs/go-ethereum. See precompile/README.md for more
information.
The kava-labs/go-ethereum and kava-labs/etheremint replace statements
are updated to support these changes as well as an update to kvtool
which includes genesis state for the registry.NoopContractAddress and
initializes the contract's EthAccount with a non-zero sequence and
codehash set to keccak256(0x01), and sets the contract code to 0x01.
See tests/e2e/e2e_precompile_genesis_test.go for an overview of the
expected genesis state for an enabled precompile.
Co-authored-by: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com>
* chore: Precompile readme improvements
This fixes a typo (import -> important) and uses package terminology
instead of unclear module terminology. This aligns best with golang
terminology were modules and packages are distinctly different and
modules are defined using go.mod.
* chore: Improve noop contract godoc
Add a more meaningful godoc where the noop contract is constructed.
* chore(e2e): Improve comments around query checks
Improve the clarity of comments around where the error is checked for
accounts and why it is not checked directly.
In addition, improve comment on why both grpc and rpc code is fetched
and where they are used.
---------
Co-authored-by: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com>
This adds a regular expression that matches `func Test...` or
`func (suite *Suite) Test...` style functions and disables the length
check. An example from e2e tests that failed lint:
`func (suite *IntegrationTestSuite) TestEip712BasicMessageAuthorization()`
These should not be replicated to docker contexts as they are local to
the build host. In addition, the golangci-lint currently doesn't assume
the host user nor add other group read permissions when writing files,
so this causes permission errors when other docker processes attempt to
copy the files.
* chore(lint): Update local make lint to match CI
This updates the `make lint` behavior to match the command being
run in CI.
In addition, we refactor the make lint command to use docker in order to
to ease cross platform install, use a local build cache that integrates
with make clean, use the same version file, and encapsulate the logic in
its own make include.
We also remove the old lint logic as to not introduce a duplicate target
and avoid confusion from a difference in behavior.
While solutions like act for running github actions locally work, it is
not as straightfoward, is slower, and uses the local git repository
instead of a clone (though I am not sure how the checkout step works
within act).
* fix(lint): Use shared timeout with .golangci.yml
Instead of using a local and different timeout in the lint makefile
target we can rely on golangci to load this configuration from
.golangci.yml instead and share this setting with CI.
* fix(lint): Fix golangci-lint cache mount path
This uses the correct cache dir default of ~/.cache enabling use
of cache between lint calls.
* fix(lint): Fix lint caching
This includes a couple fixes - 1) It adds support for full caching of go
mod and go build, speeding up the lint process quite a bit. And 2) does
not mix lint cache with make clean files -- the docker container creates
root owned files that cause make clean to error and we choose not to
require make clean to run with higher permissions. The cache must be
deleted manually.