-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add voyager verification to the verify
command
#2566
base: master
Are you sure you want to change the base?
Add voyager verification to the verify
command
#2566
Conversation
verify
command
3b1f764
to
4c5d105
Compare
Addressing some of @integraledelebesgue comments from #2288
Seems that its failing to compile without the macro. Any alternatives you might have had in your mind?
Sure
|
Successfully made some of the methods default, and remove the need of using a base struct inside each concrete verification interface struct. Since the verification provider api is constructed slightly differently, I don't think that replacing Will move on to update the current tests tomorrow. |
d978d39
to
70532da
Compare
Tests updated! Reviews would be appreciated. |
cc @cptartur |
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.
Hey, thanks for contributing. I think some parts may be improved.
Also, I haven't reviewed the tests yet but will do soon.
docs/src/appendix/sncast/verify.md
Outdated
|
||
The address of the contract that is to be verified. | ||
|
||
## `--class-name <CONTRACT_NAME>` |
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.
Why are we renaming this?
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.
This is renamed as we feel its more accurate to call it class name rather than contract name. The class (or the code ) is what is being verified, and the contract is an instance of the class (contract). Thus why we decided to change the name to better reflect it.
Changing it to<CLASS_NAME>
to make it clearer too.
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 wonder about this. I get your point about it verifying the class. However, we're using --contract-name
in sncast declare
even though it just declares the contract class, so this was named mostly for consistency.
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.
if that's the case then let's make it --contract-name
for consistency. I think it all comes down to preferences, and we can wait and see if there's any feedback on this once its released.
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.
Sorry, just went through the specs and realized that changing this might not be a good idea since prior to this we had changed the specs and walnut had followed suit with the spec change where we use --class-name
instead of --contract-name
. Do we want to change this again?
We can change it on our side and preserve the api payload schema, which should work. Wdyt @cptartur ?
70532da
to
4a9f0fd
Compare
Addressed partially, will continue in awhile to address the rest. |
docs/src/appendix/sncast/verify.md
Outdated
|
||
The address of the contract that is to be verified. | ||
|
||
## `--class-name <CONTRACT_NAME>` |
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 wonder about this. I get your point about it verifying the class. However, we're using --contract-name
in sncast declare
even though it just declares the contract class, so this was named mostly for consistency.
9fb1de9
to
4d46251
Compare
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.
Looking good. Just some minor comments.
#[clap(flatten)] | ||
pub contract_address_or_class_hash: ContractAddressOrClassHashGroup, | ||
|
||
/// Class name of the contract to be verified. Either this or class hash should be provided. |
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.
This is required, no?
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.
Yes, that's a mistake on my part, will amend it now.
#[clap(short, long)] | ||
pub class_name: String, | ||
|
||
/// Where you want your contract to be verified |
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.
/// Where you want your contract to be verified | |
/// Verification provider to be used |
#[clap(long, default_value = "false")] | ||
pub confirm_verification: bool, | ||
|
||
/// Optionally specify package with the contract to be verified |
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.
/// Optionally specify package with the contract to be verified | |
/// Specify package with the contract to be verified |
docs/src/appendix/sncast/verify.md
Outdated
|
||
The address of the contract that is to be verified. | ||
The address of the contract that is to be verified. Either this or the class hash should be provided. |
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 address of the contract that is to be verified. Either this or the class hash should be provided. | |
The address of the contract that is to be verified. |
docs/src/starknet/verify.md
Outdated
@@ -17,6 +17,11 @@ For detailed CLI description, see [verify command reference](../appendix/sncast/ | |||
|
|||
Walnut is a tool for step-by-step debugging of Starknet transactions. You can learn more about Walnut here [walnut.dev](https://walnut.dev). Note that Walnut requires you to specify the Starknet version in your `Scarb.toml` config file. | |||
|
|||
### Voyager | |||
|
|||
[Voyager](https://voyager.online) is a block explorer for Starknet. It gives developers immediate insight into the state of the starknetnetwork. It also intends to become the one-stop location for all Starknet statistics. Note that Voyager requires you to specify the Starknet version in your `Scarb.toml` config file. |
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.
[Voyager](https://voyager.online) is a block explorer for Starknet. It gives developers immediate insight into the state of the starknetnetwork. It also intends to become the one-stop location for all Starknet statistics. Note that Voyager requires you to specify the Starknet version in your `Scarb.toml` config file. | |
[Voyager](https://voyager.online) is a block explorer for Starknet. It gives developers immediate insight into the state of the Starknet network. Note that Voyager requires you to specify the Starknet version in your `Scarb.toml` config file. |
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.
Let's keep it simple
e344b3a
to
9a54415
Compare
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.
Maybe it was mentioned, but you potentially by mistake reformated the entire CHANGELOG.md
file. Please revert these changes.
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.
Looks good, let's just restore the formatting of the changelog file
0b1523b
to
9ced501
Compare
9ced501
to
caf4a1e
Compare
docs/src/starknet/verify.md
Outdated
@@ -26,7 +30,7 @@ Then run: | |||
```shell | |||
$ sncast \ | |||
verify \ | |||
--contract-address 0x01e4ebe3278ab4633a9d0d3f5c4290001f29bc3179a70e570b6817dd7f8264fa \ | |||
--contract-address 0x8448a68b5ea1affc45e3fd4b8b480ea36a51dc34e337a16d2567d32d0c6f8b \ |
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.
Why was this address changed? It doesn't seem like a class hash of any existing contract
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.
hmm, I'm not sure why this was changed. Let me revert this.
CHANGELOG.md
Outdated
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
- You can skip `--name` flag when using `account import` - a default name will be generated. | |||
- Addresses outputted when calling `sncast account create`, `sncast deploy` and `sncast declare` are now padded to 64 characters length and prefixed with `0x0` | |||
- Voyager API support for `verify` subcommand [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/sncast/verify.html). |
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.
Generally, I try to limit the usage of links in CHANGELOG.md because they often eventually become outdated.
- Voyager API support for `verify` subcommand [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/sncast/verify.html). | |
- Voyager API support for sncast `verify` subcommand |
This is a follow up PR to complete changes that #2288 wants to introduce.
Closes #2287
Introduced changes
Additional context on a possible edge case
As Voyager backend limits the http alive time to less than 30s, given a large contract which compilation might take longer, we might have to have the compilation task run asynchronously in order and have the status polled. This is currently not implemented in this PR as testing is being done to see if this is significant enough of a problem to be addressed this way.
Checklist
CHANGELOG.md
Will complete this checklist after another self review.