Skip to content

Conversation

shahnami
Copy link
Member

@shahnami shahnami commented Apr 16, 2025

Summary

https://linear.app/openzeppelin-development/issue/PLAT-6492/add-network-and-models

This PR lays the foundational groundwork for integrating the Midnight network into the OpenZeppelin Monitor. It introduces essential models and initial test coverage to support Midnight's unique blockchain structure.

Key Changes:

  • Introduced Transaction, Network, and Block models tailored for the Midnight network.
  • Established preliminary structures for filters and helper functions specific to Midnight.
  • Added initial tests to validate the newly introduced Midnight logic.

Reviewer Focus Areas:

  • Ensure that the new models accurately represent Midnight's blockchain data structures.
  • Assess whether the groundwork laid is sufficient for subsequent feature integrations.
  • Verify that the initial tests effectively cover the new models and logic introduced.

Merged PRs:

Testing Process

Checklist

  • Add a reference to related issues in the PR description.
  • Add unit tests if applicable.

Copy link

netlify bot commented Apr 16, 2025

Deploy Preview for openzeppelin-monitor ready!

Name Link
🔨 Latest commit ee29391
🔍 Latest deploy log https://app.netlify.com/sites/openzeppelin-monitor/deploys/680275d3c6f87b000820b5ff
😎 Deploy Preview https://deploy-preview-175--openzeppelin-monitor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shahnami shahnami added T-feature Suggests a new feature or enhancement P-high Critical tasks or blockers S-in-progress Actively being worked on cla: unsigned labels Apr 16, 2025
@shahnami shahnami marked this pull request as ready for review May 20, 2025 15:22
Copy link
Contributor

@zeljkoX zeljkoX left a comment

Choose a reason for hiding this comment

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

LGTM

@zeljkoX
Copy link
Contributor

zeljkoX commented May 21, 2025

I see that many checks are failing, seems like issue with midnight dependencies.

@shahnami
Copy link
Member Author

I see that many checks are failing, seems like issue with midnight dependencies.

The work on this started off a bit experimental, and started getting more shape in the follow-up PRs. I will be merging #218 and #240 in this one which should resolve the checks 🤞

Thanks for the review both @MCarlomagno and @zeljkoX ❤️

shahnami added 2 commits May 21, 2025 19:24
* chore: Implement BlockChainClient functions

* chore: Add default events and txs functions to client

* chore: Fix integration tests

* chore: Working deserializer

* test: Add tests for get_chain_type

* chore: Upgrade to midnight-node 0.12.0

* revert: Upgrade to midnight-node 0.12.0

This reverts commit 77c1fbe.

* chore: Add status to midnight tx and helper fns

* chore: Fix errors and imports for midnight-node 0.12.0

* fix: Remove extra whitespace

* fix: Remove untagged

* fix: Transaction deserialization

* chore: Add print statements

* feat: Match on function signature

* feat: Attempt at decrypting coininfo

* chore: Successful decrypt with Seed

* feat: Decrypt coininfo from viewing key config

* chore: Cleanup

* test: Fix monitor execution test for midnight

* test: Add test coverage for Midnight transaction

* test: Midnight client integration

* chore: Add test builders for midnight

* test: Add tests for midnight transport

* fix: Number formatting

* test: Add filter tests

* chore: Normalise midnight hashes

* chore: Add comment for why we test against empty strings

* fix: Temporarily bypass deserialization

* chore: Add comment

* feat: Add monitoring on transaction status

* chore: Cargo update

* test: Add coverage for websocket transport

* test: Add coverage for websocket and events

* test: Fix existing tests

* test: Implement ignored event tests

* chore: Fix transaction status

* test: Add test coverage for transaction status filtering

* chore: Use finalised head for Midnight get_blocks

* chore: Reverts commit a0176d8.

* chore: Get latest finalised block

* chore: Apply review suggestions

* chore: Use

* docs: Add Midnight documentation (#240)

* docs: Add Midnight documentation and examples

* fix: Remove config file

* chore: Remove unused bip32 crate

* test: Add test for secret string display value

* fix: Telegram token resolving

* chore: Update documentation with get_latest_block changes

* docs: Update rpc endpoint for chain type

* fix: Readme

* chore: Cargo update
Copy link
Contributor

@NicoMolinaOZ NicoMolinaOZ left a comment

Choose a reason for hiding this comment

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

LGTM!

shahnami added 6 commits June 2, 2025 22:57
* refactor: Draft websockets and HTTP endpoint managers

* test: Add integration tests for websocket logic

* chore: Replace generic ws client with midnight specific

* refactor: Use solely websocket for RPC requests (#253)

* refactor: Use solely websocket for RPC requests

* test: Fix tests and add helper methods

* chore: Fix tests and ignore ones that rely on substrate

* chore: Improve substrateclienttrait mocks

* test: Add more coverage for transport

* test: Add more test coverage for midnight client

* docs: Add missing docstrings

* test: Add coverage for monitor execution

* test: Add coverage for filter_block

* test: Fix remaining pool errors

* chore: Remove outdated conditions and update docs
if let Err(ConfigError::ValidationError(err)) = result {
assert!(err
.message
.contains("Protocol: must start with one of: wss://, ws://"));

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-insecure-websocket.detect-insecure-websocket

Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.
if let Err(ConfigError::ValidationError(err)) = result {
assert!(err
.message
.contains("Protocol: must start with one of: http://, https://, wss://, ws://"));

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-insecure-websocket.detect-insecure-websocket

Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.
@shahnami shahnami requested a review from a team as a code owner August 20, 2025 13:10
Copy link

cursor bot commented Aug 20, 2025

🚨 Bugbot Trial Expired

Your team's Bugbot trial has expired. Please contact your team administrator to turn on the paid plan to continue using Bugbot.

A team admin can activate the plan in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: allowlist do-not-merge P-high Critical tasks or blockers S-in-progress Actively being worked on T-feature Suggests a new feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants