-
Notifications
You must be signed in to change notification settings - Fork 144
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
feat(bens): add zns-ink #1222
feat(bens): add zns-ink #1222
Conversation
WalkthroughThe pull request introduces configuration updates for the ZNS (Zns) protocol across multiple files in the blockscout-ens project. Specifically, the changes involve adding support for the "zns-ink" protocol with network ID 57073. The modifications span three configuration files: Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
blockscout-ens/bens-server/config/prod.json
(2 hunks)blockscout-ens/graph-node/deployer/config.json
(1 hunks)blockscout-ens/graph-node/subgraphs/zns-subgraph/networks.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Unit, doc and integration tests
🔇 Additional comments (3)
blockscout-ens/graph-node/subgraphs/zns-subgraph/networks.json (1)
14-18
: Verify the registry contract address and start block.The registry configuration looks structurally correct. However, please ensure:
- The registry contract address is the official deployed address
- The start block (334900) captures all historical events
blockscout-ens/graph-node/deployer/config.json (1)
78-81
: LGTM!The configuration correctly reuses the ZNS subgraph and properly references the ink-mainnet network.
blockscout-ens/bens-server/config/prod.json (1)
170-170
: LGTM!The network configuration correctly includes both ENS and ZNS-ink protocols.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
blockscout-ens/bens-logic/src/subgraph/offchain/d3/offchain.rs (1)
92-109
: Consider adding error handling for reverse resolution.The reverse resolution logic is well-structured, but it might benefit from additional error handling. Currently, if reverse resolution fails, the error is propagated up the call stack, which might be too aggressive.
Consider wrapping the reverse resolution in a
match
ormap_err
to handle specific error cases:AddressResolveTechnique::Addr2Name => { - let reverse_resolve_result = - alloy_ccip_read::d3::reverse_resolve_d3_name(reader, addr, resolver_address, "") - .await?; + match alloy_ccip_read::d3::reverse_resolve_d3_name(reader, addr, resolver_address, "") + .await + { + Ok(reverse_resolve_result) => DomainName::new( + &reverse_resolve_result.name.value, + name.deployed_protocol + .protocol + .info + .protocol_specific + .empty_label_hash(), + ) + .map(|name| name.name) + .ok(), + Err(err) => { + tracing::warn!( + error = err.to_string(), + "failed to reverse resolve d3 name" + ); + None + } + } - DomainName::new( - &reverse_resolve_result.name.value, - name.deployed_protocol - .protocol - .info - .protocol_specific - .empty_label_hash(), - ) - .map(|name| name.name) - .ok() }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
blockscout-ens/bens-logic/src/subgraph/offchain/d3/offchain.rs
(5 hunks)blockscout-ens/bens-logic/src/subgraph/offchain/resolve.rs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Linting
- GitHub Check: Unit, doc and integration tests
🔇 Additional comments (3)
blockscout-ens/bens-logic/src/subgraph/offchain/resolve.rs (1)
66-71
: LGTM! Code readability improved.The introduction of the
info
variable and passingaddress_resolve_technique
tod3::maybe_offchain_resolution
improves code readability and maintainability. The changes align well with the broader context of adding support for the "zns-ink" protocol.blockscout-ens/bens-logic/src/subgraph/offchain/d3/offchain.rs (2)
23-23
: LGTM! Function signatures consistently updated.The new parameter
address_resolve_technique
is consistently added across all related functions with the correct type specification.Also applies to: 46-46, 86-86
67-74
: LGTM! Clean and readable function call.The function call is well-formatted with one argument per line, improving readability.
Summary by CodeRabbit
New Features
Configuration Updates
Enhancements