-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(ampd): add Stacks handlers #728
base: main
Are you sure you want to change the base?
Conversation
feat(ampd): custom ITS logic for Stacks
… contract deployment by any contract on Stacks.
ampd/src/stacks/contract_verifier.rs
Outdated
pub async fn verify_contract_code( | ||
http_client: &Client, | ||
reference_address: PrincipalData, | ||
contract_address: PrincipalData, | ||
) -> Result<bool, Box<dyn std::error::Error>> { | ||
let reference_contract_code = http_client | ||
.get_contract_info(format!("{}", reference_address.to_string()).as_str()) | ||
.await?; | ||
|
||
let actual_contract_code = http_client | ||
.get_contract_info(format!("{}", contract_address.to_string()).as_str()) | ||
.await?; | ||
|
||
Ok(reference_contract_code.source_code == actual_contract_code.source_code) | ||
} | ||
|
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 am worried about the performance implications of this. As far as I can tell, this is downloading two sets of source code and then comparing them? Is it comparing a hash of the source code or the full bytes of the source code?
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.
No longer applicable
ampd/src/stacks/verifier.rs
Outdated
// In case message is from Stacks -> Stacks and the same contract to itself, | ||
// try to see if we need to verify if a contract was deployed | ||
let result = get_verify_contract_params(event); |
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 still don't think this functionality should exist in ampd. Suddenly now ampd is doing something different than what it normally does (verify gmp messages and verify verifier set rotations). This change opens the door for ampd to start doing all kinds of custom logic, and just makes the code and system more complicated to reason about and maintain. Even from a performance perspective, we need to be aware of the overhead of attempting to verify contract deployments now. I don't think we should go down this route.
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.
Actually, I am wondering why this functionality needs to utilize axelar at all? It doesn't need to be a cross chain call. The contract being verified is on stacks, and the ITS contract that needs to react to the verification is also on stacks. So can this system can and should, in my opinion, be built entirely on stacks, and not utilize the amplifier/axelar protocol at all. Unless I am missing something.
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.
The contract verification logic was removed, no custom logic for Stacks is now in ampd.
Description
Stacks verify msg & verify verifier set handlers.