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

Ability to report slog events from golang bridge #10957

Open
mhofman opened this issue Feb 7, 2025 · 0 comments
Open

Ability to report slog events from golang bridge #10957

mhofman opened this issue Feb 7, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@mhofman
Copy link
Member

mhofman commented Feb 7, 2025

What is the Problem Being Solved?

We want to be able to capture some structured log events (slog) from golang cosmos modules that are executed while handling SwingSet bridge messages. For example adding details about the paths modified during vstorage writes (to extends on metrics, see #10938)

Description of the Design

ReceiveMessage would created a context with a Slogger, and any x/v* module would be able to grab this slogger during their Receive handling to create slog event entries. These event entries would be added to the response.
The cosmic-swingset side would have to be updated as well to unwrap the response and separate the result from the slog entries (allowing for future extensions as well). We need to review as well how the chainSends are stored for hangover replay to only store the result and not the slog events. This likely means updating chainSend, and possibly changing how the chain sends are stored (parsed JSON instead of raw string)

Security Considerations

We need to allow slog events being out of consensus, and thus need to make sure any non-determinism is allowed and wouldn't cause a chain halt.

Scaling Considerations

All bridge sends already incur at least 2 slog events (for the syscall to the bridge device) and likely more like 5 when accounting for the necessary message to the bridge vat. The modules in golang are free to generate as many slog events as they wish, but should avoid doing anything proportional (keep O(1) messages per bridge send)

Test Plan

TBD

Upgrade Considerations

Requires a coordinated upgrade of the golang cosmos and js cosmic swingset bridge code. We can assume that during the upgrade all stored chainSend will simply be cleared and that we don't need the new version to handle what the previous version may have stored.

@mhofman mhofman added the enhancement New feature or request label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant