Skip to content

[IBC] Add Event Logging System (ICS-24) #824

@h5law

Description

@h5law

Objective

ICS-24 details an Event Logging system that is to be used by the relayers to retrieve packet data and timeout information. As the IBC stores are used to generate proofs and these proofs are what is committed to the blockchain state. The Event logging system will be added to whenever a new event is processed (ie. creating a new client, or sending a ICS-20 token transfer), these can then be queried by height and topic by relayers to retrieve the actual data in question.

This PR should focus on creating an EventManager interface and struct to interact with different Event types. These should be implemented in a general fashion such as:

type Attribute struct {
    Key []byte
    Value []byte
}

type Event struct {
    Type string
    Height uint64
    Attributes []Attribute
}

The Event logging system should use an efficient data structure to underpin the Event storage to maximise IO ops and should also implement pruning to keep the number of events stored to the minimum number required.

Origin Document

ICS-24 defines the Event logging system and PR #795 mentions that the ICS-24 implementation is not complete. This PR should address this aspect of ICS-24

Reference ibc-go events and cosmos-sdk event manager

Goals

  • Create an EventManager interface and implementation
  • Create generic typed Events
  • Enable the interaction with the event manager from any part of the IBC module through the host
  • Enable the addition of events
  • Enable the efficient pruning of old events

Deliverable

  • Create the EventManager interface and its struct implementation
  • Create the Event interface and its implementation
  • Add methods to interact with the EventManager through the host like the StoreManager
  • Add an efficient underlying data structure to back the Event logging system
  • Enable pruning

Non-goals / Non-deliverables

  • Implement any other aspect of ICS-24 not related to the event logging system
  • Implement specific event types or event creators
  • Implement any relayer behaviours to use events

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • Task specific tests or benchmarks: make ...
  • New tests or benchmarks: make ...
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md
  • k8s LocalNet: verify a k8s LocalNet is still functioning correctly by following the instructions here

Creator: @h5law
Co-Owners: @h5law

Metadata

Metadata

Assignees

Labels

ibcIBC specific changes

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions