feat(aggregation): have constant costs proof sending#2179
Merged
Conversation
MauroToscano
approved these changes
Dec 2, 2025
JuArce
reviewed
Dec 4, 2025
JuArce
requested changes
Dec 5, 2025
JuArce
approved these changes
Dec 9, 2025
Comment on lines
+37
to
+53
| pub fn new_for_testing(config: &Config) -> Self { | ||
| let rpc_url = config.eth_rpc_url.parse().expect("RPC URL should be valid"); | ||
| let rpc_provider = ProviderBuilder::new().connect_http(rpc_url); | ||
| let aligned_service_manager = AlignedLayerServiceManager::new( | ||
| Address::from_str(&config.aligned_service_manager_address) | ||
| .expect("AlignedProofAggregationService address should be valid"), | ||
| rpc_provider.clone(), | ||
| ); | ||
|
|
||
| let last_aggregated_block = 0; | ||
|
|
||
| Self { | ||
| rpc_provider, | ||
| aligned_service_manager, | ||
| last_aggregated_block, | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| pub fn new_for_testing(config: &Config) -> Self { | |
| let rpc_url = config.eth_rpc_url.parse().expect("RPC URL should be valid"); | |
| let rpc_provider = ProviderBuilder::new().connect_http(rpc_url); | |
| let aligned_service_manager = AlignedLayerServiceManager::new( | |
| Address::from_str(&config.aligned_service_manager_address) | |
| .expect("AlignedProofAggregationService address should be valid"), | |
| rpc_provider.clone(), | |
| ); | |
| let last_aggregated_block = 0; | |
| Self { | |
| rpc_provider, | |
| aligned_service_manager, | |
| last_aggregated_block, | |
| } | |
| } | |
| pub fn new_for_testing(config: &Config) -> Self { | |
| let mut proof_fetcher = self.new(); | |
| proof_fetcher.last_aggregated_block = 0; | |
| proof_fetcher | |
| } |
Contributor
Author
There was a problem hiding this comment.
This is done this way to avoid having to read from the files, which was causing conflicts in the CI. Instead of reading from the file we just set it to zero (since it isn’t important for what we’re testing). If we call the other constructor, then we’ll get the error that led us to create this new_for_testing in the first place.
MarcosNicolau
approved these changes
Dec 9, 2025
Comment on lines
9
to
26
| if std::env::var("SKIP_AGG_PROGRAMS_BUILD") | ||
| .map(|v| v == "1") | ||
| .unwrap_or(false) | ||
| { | ||
| let out_dir = std::env::var("OUT_DIR").unwrap(); | ||
| let methods_path = PathBuf::from(out_dir).join("methods.rs"); | ||
|
|
||
| if methods_path.exists() { | ||
| println!("cargo:warning=SKIP_AGG_PROGRAMS_BUILD=1: methods.rs already exists, skipping aggregation programs build"); | ||
| return; | ||
| } else { | ||
| println!( | ||
| "cargo:warning=SKIP_AGG_PROGRAMS_BUILD=1 set, but {path} does not exist, running full build", | ||
| path = methods_path.display() | ||
| ); | ||
| } | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
I would move this to a function: should_skip_build() -> bool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Description of the pull request changes and motivation.
How to test
Unit test
You can run the unit test cases with:
This target avoids recompiling for the tests when the aggregation programs are already compiled (to be used when the programs are not being tested).
Ethereum package
Another way to test this is to test the proof aggregation service, which can be done in the following way:
Submission skipping with anvil
To test that the proof is skipped when the gas cost is too high, you should use Anvil to test, following these steps:
You should see the log
Skipping sending proof to ProofAggregationService contract due to budget/time constraints..The proof submission to the contract will fail because the anvil node does not work for the Fusaka fork, but with these steps, we were testing that the skipping works.
Type of change
Please delete options that are not relevant.
Checklist
testnet, everything else tostaging