-
Notifications
You must be signed in to change notification settings - Fork 26
chore: eigen costs #247
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
Draft
rymnc
wants to merge
6
commits into
master
Choose a base branch
from
chore/update-eigen-costs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
chore: eigen costs #247
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
.sqlx/query-ded9168a77738e356ff40c6bdb3430311821d787acd2bd50c33e92b2ed09d49b.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| use anyhow::Result; | ||
| use e2e_helpers::whole_stack::{ | ||
| create_and_fund_kms_signers, deploy_contract, start_db, start_eigen_committer, start_eth, | ||
| start_fuel_node, start_kms, | ||
| }; | ||
| use k256::ecdsa::SigningKey as K256SigningKey; | ||
| use std::time::Duration; | ||
| use tracing::info; | ||
|
|
||
| #[tokio::test] | ||
| async fn test_eigen_costs() -> Result<()> { | ||
| // Start required services | ||
| let logs = true; | ||
| let kms = start_kms(logs).await?; | ||
| let eth_node = start_eth(logs).await?; | ||
| let eth_signers = create_and_fund_kms_signers(&kms, ð_node).await?; | ||
|
|
||
| // Get Eigen key from environment and inject into KMS | ||
| let eigen_key_hex = std::env::var("EIGEN_KEY") | ||
| .expect("EIGEN_KEY environment variable must be set for Eigen tests"); | ||
|
|
||
| // Convert hex string to bytes | ||
| let key_bytes: [u8; 32] = hex::decode(&eigen_key_hex) | ||
| .expect("Failed to decode EIGEN_KEY hex") | ||
| .try_into() | ||
| .expect("EIGEN_KEY must be 32 bytes"); | ||
|
|
||
| // Create signing key and inject into KMS | ||
| let secret_key = k256::elliptic_curve::SecretKey::from_slice(&key_bytes)?; | ||
| let k256_signing_key = K256SigningKey::from(&secret_key); | ||
| let kms_key_id = kms.inject_secp256k1_key(&k256_signing_key).await?; | ||
|
|
||
| // Deploy contract and start services | ||
| let request_timeout = Duration::from_secs(50); | ||
| let max_fee = 1_000_000_000_000; | ||
| let (_contract_args, deployed_contract) = | ||
| deploy_contract(ð_node, eth_signers.clone(), max_fee, request_timeout).await?; | ||
| let db = start_db().await?; | ||
| let fuel_node = start_fuel_node(logs, Some(Duration::from_millis(200))).await?; | ||
|
|
||
| // Start Eigen committer with KMS key | ||
| let logs = true; | ||
| let committer = start_eigen_committer( | ||
| logs, | ||
| db.clone(), | ||
| ð_node, | ||
| fuel_node.url(), | ||
| &deployed_contract, | ||
| eth_signers.main, | ||
| kms_key_id, // Use the KMS key ID instead of raw EIGEN_KEY | ||
| "1 KB", | ||
| ) | ||
| .await?; | ||
|
|
||
| // Wait for some blocks to be processed | ||
| tokio::time::sleep(Duration::from_secs(100)).await; | ||
|
|
||
| // Check if committer has updated the costs | ||
| let costs = committer.latest_costs().await?; | ||
|
|
||
| info!("received {costs:?}"); | ||
|
|
||
| assert!(costs.iter().all(|cost| cost.size > 0)); | ||
|
|
||
| Ok(()) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| BEGIN; | ||
|
|
||
| CREATE INDEX idx_eigen_submission_fragments_id_desc ON eigen_submission_fragments (id DESC); | ||
| CREATE INDEX idx_eigen_submission_status ON eigen_submission (status); | ||
| CREATE INDEX idx_l1_fragments_bundle_id ON l1_fragments (bundle_id); | ||
| CREATE INDEX idx_eigen_submission_status_id ON eigen_submission (status, id); | ||
|
|
||
| COMMIT; |
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
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
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
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
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
Oops, something went wrong.
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.
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.
hmmmm
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.
i feel like we need some more metadata i.e over how much time the bundle was posted, and then compute it with the fixed cost we have with eigen that is in bytes/sec