Skip to content

Conversation

@MauroToscano
Copy link
Contributor

Refactor sdk modules

Refactor SDK modules so they have less indirection and are more structured

@MauroToscano MauroToscano changed the base branch from testnet to staging May 16, 2025 17:30
@github-actions
Copy link

Changes to gas cost

Generated at commit: a6f80b9ca71c67ce468ef7308ac1fb84a22ab2fb, compared to commit: b77e8fdf474834f0b9d018c28322b5c29512002e

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
RegistryCoordinatorHarness blsApkRegistry
stakeRegistry
+354 ❌
+354 ❌
+57.47%
+51.91%
StakeRegistryHarness delegation +146 ❌ +22.19%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
Slasher 728,578 (-870,247) initialize 366 (-556) -60.30% 366 (-556) -60.30% 366 (-556) -60.30% 366 (-556) -60.30% 6 (0)
RegistryCoordinatorHarness 5,528,683 (-4,601,377) blsApkRegistry
initialize
stakeRegistry
970 (+354)
55,078,420 (-1,203,055)
1,036 (+354)
+57.47%
-2.14%
+51.91%
970 (+354)
55,078,420 (-1,203,055)
1,036 (+354)
+57.47%
-2.14%
+51.91%
970 (+354)
55,078,420 (-1,203,055)
1,036 (+354)
+57.47%
-2.14%
+51.91%
970 (+354)
55,078,420 (-1,203,055)
1,036 (+354)
+57.47%
-2.14%
+51.91%
6 (0)
6 (0)
6 (0)
StakeRegistryHarness 2,590,172 (-2,549,338) delegation
initializeQuorum
804 (+146)
144,420 (-1,780)
+22.19%
-1.22%
804 (+146)
164,216 (-1,780)
+22.19%
-1.07%
804 (+146)
164,320 (-1,780)
+22.19%
-1.07%
804 (+146)
164,320 (-1,780)
+22.19%
-1.07%
6 (0)
1,152 (0)
AlignedLayerServiceManager 4,398,072 (-3,921,136) batchesState
createNewTask
disableVerifier
disabledVerifiers
enableVerifier
isVerifierDisabled
receive
setDisabledVerifiers
5,132 (-278)
56,946 (-848)
24,602 (+303)
3,030 (+516)
23,748 (-443)
2,406 (-450)
23,301 (-195)
24,243 (-7)
-5.14%
-1.47%
+1.25%
+20.53%
-1.83%
-15.76%
-0.83%
-0.03%
5,132 (-278)
76,890 (-898)
36,191 (+375)
3,030 (+516)
24,388 (-372)
2,406 (-450)
46,835 (-356)
35,262 (+86)
-5.14%
-1.15%
+1.05%
+20.53%
-1.50%
-15.76%
-0.75%
+0.24%
5,132 (-278)
77,086 (-860)
36,191 (+375)
3,030 (+516)
24,388 (-372)
2,406 (-450)
47,115 (-357)
35,262 (+86)
-5.14%
-1.10%
+1.05%
+20.53%
-1.50%
-15.76%
-0.75%
+0.24%
5,132 (-278)
77,824 (-944)
47,780 (+446)
3,030 (+516)
25,029 (-300)
2,406 (-450)
47,115 (-357)
46,282 (+179)
-5.14%
-1.20%
+0.94%
+20.53%
-1.18%
-15.76%
-0.75%
+0.39%
256 (0)
256 (0)
2 (0)
1 (0)
2 (0)
3 (0)
256 (0)
2 (0)
AVSDirectory 1,485,692 (-1,689,090) initialize 97,570 (-3,067) -3.05% 97,570 (-3,067) -3.05% 97,570 (-3,067) -3.05% 97,570 (-3,067) -3.05% 6 (0)
ServiceManagerMock 1,340,500 (-1,292,283) initialize 71,296 (-2,066) -2.82% 71,296 (-2,066) -2.82% 71,296 (-2,066) -2.82% 71,296 (-2,066) -2.82% 6 (0)
ProxyAdmin 412,495 (-345,151) upgrade
upgradeAndCall
38,758 (-883)
55,403,611 (-1,228,407)
-2.23%
-2.17%
38,767 (-883)
55,403,611 (-1,228,407)
-2.23%
-2.17%
38,770 (-883)
55,403,611 (-1,228,407)
-2.23%
-2.17%
38,770 (-883)
55,403,611 (-1,228,407)
-2.23%
-2.17%
24 (0)
6 (0)
BLSApkRegistryHarness 1,676,697 (-1,447,540) initializeQuorum
setBLSPublicKey
45,382 (-596)
89,551 (-556)
-1.30%
-0.62%
45,382 (-596)
89,551 (-556)
-1.30%
-0.62%
45,382 (-596)
89,551 (-556)
-1.30%
-0.62%
45,382 (-596)
89,551 (-556)
-1.30%
-0.62%
1,152 (0)
6 (0)
TransparentUpgradeableProxy 521,513 (-376,486) fallback 1,634 (+90) +5.83% 47,449 (-617) -1.28% 8,200 (+90) +1.11% 119,180 (-820) -0.68% 30 (0)
StrategyManagerMock 1,146,058 (-1,255,314) setAddresses 88,974 (-768) -0.86% 88,974 (-768) -0.86% 88,974 (-768) -0.86% 88,974 (-768) -0.86% 6 (0)
IndexRegistry 917,389 (-790,168) initializeQuorum 45,244 (-348) -0.76% 45,244 (-348) -0.76% 45,244 (-348) -0.76% 45,244 (-348) -0.76% 1,152 (0)

@MauroToscano MauroToscano enabled auto-merge May 16, 2025 17:51
@JuArce JuArce assigned JuArce and MauroToscano and unassigned JuArce May 16, 2025
@JuArce JuArce requested a review from Copilot May 16, 2025 17:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the SDK modules to simplify module indirection and improve overall structure by replacing imports from the core module with those from the new common module.

  • Updated module import paths across multiple files from "crate::core" to "crate::common".
  • Adjusted import ordering in some files to reflect the new structure.
  • Minor reordering in batcher and aligned-batcher modules to support clearer separation of responsibilities.

Reviewed Changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.

Show a summary per file
File Description
batcher/aligned-sdk/src/eth/aligned_service_manager.rs Updated error import path from core to common.
batcher/aligned-sdk/src/eth/aligned_proof_agg_service.rs Updated error import path from core to common.
batcher/aligned-sdk/src/communication/protocol.rs Updated error and type import paths from core to common.
batcher/aligned-sdk/src/communication/mod.rs Added new communication module exports.
batcher/aligned-sdk/src/communication/messaging.rs Replaced core type imports with common ones and reorganized import order.
batcher/aligned-sdk/src/communication/batch.rs Updated import paths and module reference from core to common/verification_layer.
batcher/aligned-sdk/src/common/mod.rs Introduces new common module structure for constants, errors, and types.
batcher/aligned-sdk/src/aggregation_layer.rs Updated Network type import path from core to common.
batcher/aligned-batcher/src/zk_utils/mod.rs Updated type import path for gnark-related verification data from core to common.
batcher/aligned-batcher/src/types/batch_queue.rs Updated multiple import paths from core to common and reordered imports.
batcher/aligned-batcher/src/lib.rs Updated constants and types import paths from core to common.
batcher/aligned-batcher/src/gnark/mod.rs Adjusted ProvingSystemId import path from core to common.
batcher/aligned-batcher/src/eth/utils.rs Updated constants import path from core to common.
batcher/aligned-batcher/src/connection.rs Updated type import paths from core to common.
batcher/aligned-batcher/src/config/mod.rs Updated constants import paths from core to common.
aggregation_mode/src/backend/s3.rs Updated VerificationData type import from core to common.
aggregation_mode/src/backend/fetcher.rs Updated ProvingSystemId type import from core to common.

@MauroToscano MauroToscano added this pull request to the merge queue May 16, 2025
Merged via the queue into staging with commit c01526e May 16, 2025
6 checks passed
@MauroToscano MauroToscano deleted the refactor_sdk_modules branch May 16, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants