-
Notifications
You must be signed in to change notification settings - Fork 81
Add multicall batching support to access check helpers #326
Copy link
Copy link
Closed
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewards
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewards
Difficulty: Intermediate
Type: Performance
Recommended labels (if available in this repo):
enhancement,performance,sdkBackground
src/contracts/providers/multicall3Provider.tsalready exists, providing Multicall3 batching at the provider level. However,src/access/accessHelpers.tsdoes not yet use it — access checks that require multiple on-chain reads appear to issue them individually.Problem
Multi-condition access checks (e.g. checking multiple role/token requirements for one resource) currently make N separate RPC calls instead of one batched Multicall3 call, increasing latency and RPC provider load.
Expected Outcome
accessHelpers.tsbatches eligible on-chain read calls through the existingmulticall3Provider.tswhen checking multiple requirements for a single access decision.Suggested Implementation
Identify the call sites in
accessHelpers.tsthat issue multiple independent contract reads for one access decision. Route them throughmulticall3Provider.tsinstead of individual calls, preserving per-call error isolation (one failed sub-call shouldn't fail the whole batch if partial results are usable).Acceptance Criteria
checkAccess()return type or behavior from the caller's perspectivepnpm test:runpassesLikely Affected Files/Directories
src/access/accessHelpers.tssrc/access/access.service.tssrc/contracts/providers/multicall3Provider.ts