-
Notifications
You must be signed in to change notification settings - Fork 6
Chore/arb to gnosis subgraphs and veascan config #426
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
base: dev
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for veascan ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThis update adds two new Arbitrum-to-Gnosis inbox data sources to the subgraph configuration, updates related contract addresses and ABI references, and extends the frontend to support these new bridge routes. Supporting scripts, environment variables, and configuration files are refactored for multi-network support and improved clarity. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WebApp
participant Subgraph (Inbox)
participant Subgraph (Outbox)
participant Arbitrum Sepolia
participant Gnosis Chiado
User->>WebApp: Selects Arbitrum Sepolia → Gnosis Chiado bridge
WebApp->>Subgraph (Inbox): Queries via VEASCAN_INBOX_SUBGRAPH_ARBSEPOLIA
WebApp->>Subgraph (Outbox): Queries via VEASCAN_OUTBOX_SUBGRAPH_CHIADO
Subgraph (Inbox)->>Arbitrum Sepolia: Fetches events from VeaInboxArbToGnosis contracts
Subgraph (Outbox)->>Gnosis Chiado: Fetches events from VeaOutboxArbToGnosis contracts
WebApp->>User: Displays bridge status and message data
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
🔭 Outside diff range comments (1)
veascan-web/src/consts/bridges.ts (1)
75-83
:⚠️ Potential issueEnvironment variables are typed
string | undefined
– runtime risk
inboxEndpoint
/outboxEndpoint
expect plainstring
, butprocess.env.*
isstring | undefined
.
If the env var is missing the URL turns into"https://api.studio.thegraph.com/query/undefined"
which fails silently.- inboxEndpoint: `https://api.studio.thegraph.com/query/${process.env.VEASCAN_INBOX_SUBGRAPH_ARBSEPOLIA}`, + inboxEndpoint: ensureEnv("VEASCAN_INBOX_SUBGRAPH_ARBSEPOLIA"),Add a tiny guard:
function ensureEnv(key: string): string { const v = process.env[key]; if (!v) throw new Error(`Missing env ${key}`); return `https://api.studio.thegraph.com/query/${v}`; }
🧹 Nitpick comments (9)
veascan-subgraph-inbox/package.json (1)
3-3
: Add matching CHANGELOG entry for the patch bumpThe patch‐level version increment to
0.2.4
is fine, but please remember to append a brief note to the project’s CHANGELOG so downstream users can quickly see what changed.veascan-subgraph-inbox/src/VeaInbox.ts (2)
6-7
: Remove unuseddataSource
import
dataSource
is imported but never referenced, which will raise an “unused import” warning in the AssemblyScript compiler and some CI linters.-import { +import { Address, BigInt, ByteArray, Bytes, - dataSource, } from "@graphprotocol/graph-ts";
125-129
: Consider renaming the bound contract type for cross-network clarityYou bind the event address to
VeaInboxArbToEthDevnet
, even for the new Arb → Gnosis data sources.
Functionally this works (ABI is identical), but the mis-named symbol will confuse future readers when debugging multi-network issues.Two low-effort options:
- Generate a shared interface (e.g.,
VeaInboxCommon
) in the subgraph manifest and import that here.- At minimum, add a short comment explaining that the ETH-devnet ABI is reused intentionally.
veascan-web/.env.public (1)
2-4
: Verify docs & CI pick up the renamed variablesThe old
VEASCAN_INBOX/OUTBOX_SUBGRAPH
names were replaced. Make sure:
- Any deployment or local-dev docs reference the new names.
- CI pipelines (e.g., Vercel, GH Actions) have the variables updated, otherwise the web app will query
undefined
.veascan-web/src/consts/bridges.ts (2)
6-10
: Import names leak implementation details – consider path/alias consolidationSix nearly-identical import statements for every deployment artefact quickly bloat this constants file and make future additions error-prone.
A small helper that builds the path from{network}/{name}.json
would remove duplication and centralise naming rules.
42-51
:arbToGnosisContracts
duplicates logic – extract to factory helper
arbToEthContracts
andarbToGnosisContracts
only differ in artefact variables. A one-liner helper such asbuildContracts(inbox,outbox)
would keep the section DRY.veascan-subgraph-inbox/subgraph.yaml (1)
77-81
: Redundant ABI entries inflate code-gen timeFor the new Arb→Gnosis data sources you still include the
VeaInboxArbToEthDevnet
ABI.
Unless the mapping intentionally uses both ABIs, drop the unused one to speed up graph-codegen and avoid accidental signature mismatches.Also applies to: 105-108
veascan-subgraph-outbox/scripts/update.sh (2)
59-66
: Missing artifact guard prints nothing usefulWhen the artefact is absent, the script only echoes “Artifact not found for dataSource[$i]:” without the expected path, hindering debugging.
- echo "Artifact not found for dataSource[$i]:" + echo "Artifact not found for dataSource[$i] ($artifact)"
75-79
: Hard-coding ‘gnosis-chiado’ twice – leverage variableYou already pass
graphNetwork
; derive the actual Graph network name once to avoid drift:graph_yaml_network=$([[ $graphNetwork == "chiado" ]] && echo "gnosis-chiado" || echo "$graphNetwork") ... yq -i ".dataSources[$i].network = \"$graph_yaml_network\"" "$SUBGRAPH_YAML"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
veascan-subgraph-inbox/package.json
(1 hunks)veascan-subgraph-inbox/src/VeaInbox.ts
(2 hunks)veascan-subgraph-inbox/subgraph.yaml
(1 hunks)veascan-subgraph-outbox/scripts/update.sh
(1 hunks)veascan-subgraph-outbox/src/VeaOutbox.ts
(3 hunks)veascan-subgraph-outbox/subgraph.yaml
(4 hunks)veascan-web/.env.public
(1 hunks)veascan-web/codegen.ts
(1 hunks)veascan-web/src/consts/bridges.ts
(3 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
veascan-subgraph-outbox/src/VeaOutbox.ts
[error] 81-81: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 102-102: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: Redirect rules - veascan
- GitHub Check: Header rules - veascan
- GitHub Check: Pages changed - veascan
- GitHub Check: dependency-review
- GitHub Check: test
- GitHub Check: Scorecard analysis
- GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
veascan-web/codegen.ts (1)
6-9
: Guard against missing env-vars to avoid failinggraphql-codegen
If any of the three environment variables are undefined, the composed URL becomes
https://api.studio.thegraph.com/query/undefined
and code-generation will throw.- schema: [ - `https://api.studio.thegraph.com/query/${process.env.VEASCAN_INBOX_SUBGRAPH_ARBSEPOLIA}`, - `https://api.studio.thegraph.com/query/${process.env.VEASCAN_OUTBOX_SUBGRAPH_CHIADO}`, - `https://api.studio.thegraph.com/query/${process.env.VEASCAN_OUTBOX_SUBGRAPH_SEPOLIA}`, - ], + schema: [ + process.env.VEASCAN_INBOX_SUBGRAPH_ARBSEPOLIA, + process.env.VEASCAN_OUTBOX_SUBGRAPH_CHIADO, + process.env.VEASCAN_OUTBOX_SUBGRAPH_SEPOLIA, + ] + .filter(Boolean) // drop undefined + .map((p) => `https://api.studio.thegraph.com/query/${p}`),This fails fast in CI instead of producing an obscure network error at run-time.
veascan-subgraph-outbox/src/VeaOutbox.ts (3)
8-8
: Import path change looks correctThe switch to
VeaOutboxArbToGnosisDevnet
aligns with the updated subgraph manifest. No additional action required.
81-83
: Explicit null-check is safer than optional chaining in AssemblyScriptUsing
claim && claim.epoch…
avoids the optional-chaining edge cases that Biome flags but which often break with--target web
compilation. Good call.🧰 Tools
🪛 Biome (1.9.4)
[error] 81-81: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
102-103
: Same explicit null-check style consistently appliedMaintaining the same pattern across handlers keeps the codebase uniform and avoids the optional-chain pitfalls noted above.
🧰 Tools
🪛 Biome (1.9.4)
[error] 102-102: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
veascan-subgraph-outbox/subgraph.yaml (1)
16-35
:VerificationStarted
handler is kept but its entity was dropped – double-check mapping logicThe
entities:
array no longer listsVerificationStarted
, yet the handler is still declared for that event.
IfhandleVerificationStarted
writes/updates theVerificationStarted
entity instore
, removal here will break type-gen and fail at runtime.Please confirm the mapping file no longer creates/updates a
VerificationStarted
entity or add it back:entities: - Challenged - Claimed - MessageRelayed - Verified + - VerificationStarted
Also applies to: 47-66
veascan-web/src/consts/bridges.ts (1)
85-91
: Both bridges share the same inbox endpoint – intentional?
id:0
(Arb→Eth) andid:1
(Arb→Gnosis) point to the identical inbox subgraph.
That makes sense because both originate on Arbitrum, but if the inbox schema diverges per route this will cause data overlap.
|
PR-Codex overview
This PR focuses on updating the
veascan
project, including version increments, environment variable adjustments, and changes to the subgraph configurations for Ethereum networks, specifically regarding theVeaInbox
andVeaOutbox
components.Detailed summary
version
inpackage.json
from0.2.3
to0.2.4
..env.public
forVEASCAN_INBOX_SUBGRAPH
andVEASCAN_OUTBOX_SUBGRAPH
.codegen.ts
to reflect new environment variable names.VeaInbox
logic inVeaInbox.ts
to useveaInbox
instead ofcontract
.VeaOutbox.ts
to referenceVeaOutboxArbToGnosisDevnet
.claim
inhandleVerificationStarted
andhandleVerified
functions.subgraph.yaml
forVeaInboxArbToGnosisDevnet
andVeaOutboxArbToGnosisDevnet
.subgraph.yaml
.Summary by CodeRabbit
New Features
Configuration
Refactor
Bug Fixes