Uh oh!
There was an error while loading. Please reload this page.
feat(aggregation): have constant costs proof sending - #2179
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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, | ||
| } | ||
| } |
There was a problem hiding this comment.
| pubfn 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, | |
| } | |
| } | |
| pubfn new_for_testing(config:&Config) -> Self{ | |
| letmut proof_fetcher = self.new(); | |
| proof_fetcher.last_aggregated_block = 0; | |
| proof_fetcher | |
| } |
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.
| 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() | ||
| ); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
I would move this to a function: should_skip_build() -> bool
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