Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IBC] Implement ICS-24 - Tracking IBC store transitions in the networ…
…k state (#847) ## Description <!-- reviewpad:summarize:start --> ### Summary generated by Reviewpad on 12 Jul 23 20:45 UTC This pull request includes the following changes: - The file `main_test.go` was newly added to the repository and includes various changes such as package definition, imports, variable declaration, and function definitions related to IBC modules testing. - The file `proofs_ics23.go` includes changes in error handling for the functions `createMembershipProof` and `createNonMembershipProof`, replacing the error `coreTypes.ErrCreatingProof` with `coreTypes.ErrIBCCreatingProof` for more specific error messages. - The file `keys_ics03.go` was renamed from the `ibc/host` directory to the `ibc/path` directory. Additionally, the package declaration was changed from `host` to `path`. These changes seem related to the organization of the file within the codebase. - The `config.validator2.json` file includes changes in the `ibc` section, adding two new keys: `private_key` and `stores_dir`. The `enabled` key remains unchanged. The `private_key` key has been assigned a long string value, and the `stores_dir` key has been assigned the value "/var/ibc". - The file `internal/testutil/ibc/mock.go` includes renaming of the functions `BaseIbcMock` to `BaseIBCMock` and `IbcMockWithHost` to `IBCMockWithHost`. These changes update the function names to follow proper naming conventions. - The file includes the implementation of a store manager for IBC (Inter-Blockchain Communication), responsible for managing provable stores, caching, pruning, and restoring data. - The addition of a new function, `GetIBCStoreUpdates`, which retrieves the set of key-value pairs updated at the current height for the IBC store. - Changes in the state hashes used in the tests in the file `state_test.go`. - The file `runtime/manager_test.go` includes the addition of new fields `PrivateKey` and `StoresDir` to the `IBC` struct in the `NewManagerFromReaders` function. - Changes in the `config.validator4.json` file include modifications in the `ibc` section, adding two new properties: `private_key` and `stores_dir`. The `enabled` property remains unchanged. - The file `prefix.go` was renamed from the `ibc/host` package to the `ibc/path` package. The similarity index indicates that most of the content remains unchanged. - There was a change in error handling logic in a file involving the renaming of the error variable and addressing the error during the creation of a new public key. - The file `gov.go` includes changes in import statements, variable declarations, and function modifications related to new IBC store transaction fees. - The file `persistence/types/ibc.go` is a new file added to the codebase, containing functions and constants related to IBC. - The file `persistence/types/ibc.go` in the `persistence` package includes changes, introducing methods for setting and retrieving key-value pairs in the IBC store table. - The file `persistence/trees.go` includes changes related to the addition of a new tree and corresponding functions to handle updates for the tree. - The file `utils_test.go` includes changes in the casing of a function call from `ibcUtils.IbcMockWithHost` to `ibcUtils.IBCMockWithHost`. - The file `ibc/host/path_test.go` was renamed to `ibc/path/path_test.go` with no other changes in the file. - Changes in default variable values related to IBC functionality. - The file `db.go` includes a new function, `initialiseIBCTables`, responsible for initializing an IBC store table in a PostgreSQL database. - A new file, `ibc.feature.wip`, was added, containing integration and end-to-end tests for various scenarios related to IBC functionality. - Changes in the `PROTOCOL_STATE_HASH.md` file include additions and modifications related to the IBC state tree and the handling of IBCMessage objects. - The file `ibc/host.go` includes changes in comments, import statements, and the addition of fields and methods related to the host's interaction with the IBC store. - A new file, `convert.go`, was added in the `ibc/types` directory, containing functions and imports to work with IBC messages. - Changes in the `utils_test.go` file include modifications in the casing of a function call from `ibcUtils.IbcMockWithHost` to `ibcUtils.IBCMockWithHost`. - The file `ibc/host/path_test.go` was renamed to `ibc/path/path_test.go` with no other changes in the file. - Changes in default variable values related to IBC functionality. - A new file, `db.go`, was added, containing a function <!-- reviewpad:summarize:end --> ## Issue Fixes #840 ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Add new `IbcMessage` protobuf with 2 types - `UpdateIbcStore` and `PruneIbcStore` - Track IBC store changes in the mempool - Update IBC state tree using these state transition messages ## Testing - [x] `make develop_test`; if any code changes were made - [x] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [x] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [x] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) - [x] I have tested my changes using the available tooling - [ ] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [x] I have updated the corresponding README(s); local and/or global - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
- Loading branch information