Skip to content
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

[repo] Case-insensitive address queries #983

Open
volkyeth opened this issue Apr 18, 2023 · 7 comments
Open

[repo] Case-insensitive address queries #983

volkyeth opened this issue Apr 18, 2023 · 7 comments
Assignees

Comments

@volkyeth
Copy link

volkyeth commented Apr 18, 2023

Currently the repo expects Mixed-case checksum Addresses on the queries, so if we use addresses with other cases it does not find the resource.

E.g: https://repo.sourcify.dev/contracts/full_match/100/0xC4c622862a8F548997699bE24EA4bc504e5cA865/metadata.json works https://repo.sourcify.dev/contracts/full_match/100/0xc4c622862a8f548997699be24ea4bc504e5ca865/metadata.json gives a 404

The dev experience could be improved by making the query work with addresses in any kind of case. As it stands, it's often necessary to add boilerplate to convert addresses to checksum mixed-casing in the code.

View in Huly HI-398

@kuzdogan
Copy link
Member

Thanks a lot for the report!

@marcocastignoli wasn't it already resolved with this? #588

@marcocastignoli
Copy link
Member

It used to work, I'll take a look at it. Thanks for the report

@sealer3
Copy link
Contributor

sealer3 commented Apr 21, 2023

Related: if you pass a non-checksummed address in any of the verification tab inputs that accept addresses (Etherscan verification, contract/chain ID), it will give you a non-checksummed address "View in repository" link. I think the UI should always give a checksummed link and maybe checksum the address immediately upon entry.

Example:
image
The "Ethereum Mainnet" link is to a non-checksum address, and the non-checksum address is displayed in the UI.

marcocastignoli added a commit to sourcifyeth/h5ai-nginx that referenced this issue Apr 21, 2023
* removing a useless setting in h5ai config
* now formatting the address redirects to the `location /` that runs `try_files` successfuly
@marcocastignoli
Copy link
Member

I'm not an expert regarding nginx configuration but I tried to follow the logic and it seems like I added a useless location that I removed in this PR sourcifyeth/h5ai-nginx#1

Can someone with more experience than me regarding nginx check it?

@marcocastignoli
Copy link
Member

@sealer3's report is fixed by this PR: #990

marcocastignoli added a commit that referenced this issue Apr 21, 2023
* fix address checksum in repository
@marcocastignoli
Copy link
Member

Locally on my machine it works... repo.staging.sourcify.dev still has the same probllem

@kuzdogan
Copy link
Member

Leaving this aside for now as we couldn't tackle the problem successfully...

The problem currently is that the h5ai-nginx config does not match the location we are checksumming the addresses for /metadata.json or other file addresses. The location regex is not matching for some reason

https://github.com/sourcifyeth/h5ai-nginx/blob/35418954f6cd11023a2a644b5fb9db0e5cc7a981/h5ai-nginx.conf#L94-L95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants