Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IBC] Add Event Logging system #893

Merged
merged 143 commits into from
Jul 13, 2023
Merged

[IBC] Add Event Logging system #893

merged 143 commits into from
Jul 13, 2023

Conversation

h5law
Copy link
Contributor

@h5law h5law commented Jul 9, 2023

Description

Summary generated by Reviewpad on 13 Jul 23 12:29 UTC

This pull request introduces several changes across multiple files. Here is a summary of the diff:

  1. In the file benchmark_state_test.go, a slice of uint8 is modified to generate a random value using the rand.Intn function, preventing duplicate keys.
  2. In the file persistence_module.go, new methods SetIBCEvent and GetIBCEvents are added to enhance the persistence module's functionality for handling IBC events.
  3. In a different file related to IBC functionality, imports are added, and new methods SetIBCEvent and GetIBCEvents are added for storing and retrieving IBC events at a specific height and topic.
  4. In the file persistence/types/ibc.go, multiple changes include adding constants, new functions for generating queries, renaming a function, and modifying existing functions for handling IBC events and entries.
  5. In the file bus.go, a new function GetEventLogger is added to the bus struct, returning a value of type modules.EventLogger.
  6. Another file diff involves adding imports, initializing variables related to the IBC submodule, and updating the Create() function in the ibc/host package.
  7. In ibc_test.go, there are modifications to test functions, adding new test functions, and adding an attribute struct.
  8. A new file ibc_event_module.go is added, defining a package, imports, constants, types, and methods related to an event logging system.
  9. Changes in bus_module.go show the addition of a new method GetEventLogger to the Bus interface.
  10. In persistence/debug.go, functions ClearAllIBCQuery, ClearAllIBCStoreQuery, and ClearAllIBCEventsQuery are added/removed, and a modification is made to the HandleDebugMessage function signature.
  11. A new file event_manager.go is added, containing the definition of the EventManager struct and implementing the EventLogger interface.
  12. A change is made to add a new table creation statement for the IBCEventLog table in an unspecified file.
  13. Changes in the file ics24.md introduce a new section for an event logging system in the IBC module, with an overview of its implementation and usage of a persistence layer.
  14. A new file ibc_events.proto is added, defining message types for attributes and IBC events in the shared/core/types/proto directory.

These changes aim to introduce and enhance functionality related to IBC events, event logging, and persistence in the project.

Issue

Fixes #824

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Adds the EventLogger interface and submodule
  • Adds methods to add events to the persistence DB
  • Adds methods to query the persistence DB for events by height and topic
  • Adds IBCEvent protobuf type
  • Registers EventLogger to the bus for retrieval

Testing

  • make develop_test; if any code changes were made
  • make test_e2e on k8s LocalNet; if any code changes were made
  • e2e-devnet-test passes tests on DevNet; if any code was changed
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling
  • I have updated the corresponding CHANGELOG

If Applicable Checklist

  • I have updated the corresponding README(s); local and/or global
  • I have added tests that prove my fix is effective or that my feature works
  • I have added, or updated, mermaid.js diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@h5law h5law requested review from Olshansk and dylanlott July 9, 2023 16:11
@h5law h5law self-assigned this Jul 9, 2023
@reviewpad reviewpad bot added large Pull request is large waiting-for-review labels Jul 9, 2023
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments & nits here and there but overall, this is 🧹 and 💅

ibc/docs/ics24.md Show resolved Hide resolved
ibc/events/event_manager.go Outdated Show resolved Hide resolved
ibc/events/event_manager.go Outdated Show resolved Hide resolved
persistence/test/ibc_test.go Outdated Show resolved Hide resolved
persistence/test/ibc_test.go Outdated Show resolved Hide resolved
persistence/test/ibc_test.go Show resolved Hide resolved
persistence/test/ibc_test.go Show resolved Hide resolved
persistence/test/ibc_test.go Outdated Show resolved Hide resolved
persistence/types/ibc.go Show resolved Hide resolved
shared/core/types/proto/ibc_events.proto Show resolved Hide resolved
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments & nits here and there but overall, this is 🧹 and 💅

@h5law h5law requested a review from Olshansk July 11, 2023 08:53
@h5law h5law removed the do not merge Prevent merging even with sufficient approvals label Jul 13, 2023
@h5law h5law changed the base branch from ibc/host_submodule to main July 13, 2023 11:34
@h5law h5law merged commit f655ace into main Jul 13, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-devnet-test Runs E2E tests on devnet ibc IBC specific changes large Pull request is large waiting-for-review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[IBC] Add Event Logging System (ICS-24)
2 participants