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

Release #985

Merged
merged 35 commits into from
Apr 19, 2023
Merged

Release #985

merged 35 commits into from
Apr 19, 2023

Conversation

kuzdogan
Copy link
Member

@kuzdogan kuzdogan commented Apr 19, 2023

  • Added basic test coverage
  • Fix: Handling Etherscan contracts with multiple sources
  • Use the respective solc binary according to the platform, save binaries locally
  • Update Etherscan chains
    • Users can now import contracts from other Etherscan instances: Polygonscan, Snowtrace etc.
  • Make use of immutableReferences on verification
    • This lets us verify contracts with immutables very often without needing alternative methods such as looking at the creatorTxHash or "simulation"
  • Fix addLibraryAddresses potential vulnerability with regex.

View in Huly HI-732

marcocastignoli and others added 30 commits March 9, 2023 16:47
* fix nyc for mocha
* enable coverage export
* push coverage to +75%
* installed nyc
* nyc configuration
* now coverage more than 85%
* add missing open-cli package
* add tests
* rename previous etherscan method to standard-json-input
* overwrite chainId at create2 verification
* display create2 verified message in ui
* fixe #954 force solcjs to use the setupMethods api
* download the solcjs binary like the amd one
* use the downloaded binary through setupMethods
* check existing binaries before downloading new one

* fix #955 automatic fetch of solc compiler for the right platform
* if platform is not supported fallback on solcjs
* ! needs to be tested

* merge functions to download solc and solcjs

* fix conflicts after rebasing onto staging

* * add comment to fetchAndSaveSolc
* fix typo
* add missing expect in tests
* add test for solcjs

* fail useCompiler test with a meaningful error message

* test "Should compile with solc binary" on linux-platform
* Add other Etherscan chains

* Fix 2>&1

* Handle Cloudflare security check 403 on scraping

* Add Etherscan instances to server

* Add Etherscan chains to the UI

* Fix ethscn endpoint, add etherscn tests, refactor

Apparently the non-session endpoint was not being
tested and not behaving correctly.

- Add validation to non-session Etherscan verification
- fix `req.body.chainId` in `verifyFromEtherscan`. Non-session endpoints
expect `chain` instead of `chainId`

Also the create2 session verification was returning the storageTimestamp
which is not expected according to other session tests.
- Removes storageTimestamp from verifyCreate2

- Refactor etherscan tests into own file.
- Refactor shared assertions into own file.

* Rename assertions, use shared asrtn.s in server.js

* Validate Etherscan Input

* Fix Snowtrace API

* Add Etherscan instance contracts, env vars secrets

* Fix tests, print test fail, fix env vars

* Server port in constructor, increase timeout

Both etherscan and server tests were trying to use the same ports.
Allow custom ports for server in constructor.

Increase Etherscan tests timeout to 5s

* Fix timeout call

* Rimraf repository sync

* Debug all lib-sourcify tests

* Use creatorTxHash for unable to scrape tests

* Fix "Contract is not saved"

* Don't build twice before test CI

* Send even more req's to ensure rate limit

On the CI, the rate limit does not get hit until around 15 reqs

* Pass creatorTxHash, log validation test assertions

* Session tests, accept both chain&chainId on API

- Etherscan session and non session bodies accept different parameters:
`chainId` and `chain` respectively.
Make both accept both.
- Validate address on /session/verify/etherscan

- Add Etherscan validation tests with invalid address, unsupported chain
- Add Etherscan session tests.
- Test Etherscan verification once for session and non session.
Don't run each instance's tests in etherscan.js.
(Will run somewhere else periodically)

* Seperate Ethscn instance tests. Reuse verify funcs

* Test Ethscn instances tests on CI

* Fix install step

* Add contract call decoder launch.json

* Change default IPFS GW ContractCallDecoder

* Remove creatorTxHash, fix rate limit tests

* Use Etherscan API for fetching creatorTx

* Increase etherscan rate limt req frequency

* Switch back to ipfs.io as local ipfs fails

For some reason the local ipfs GW started not to work.
This would require further investigation.
Meanwhile switch to ipfs.io GW.

* Move Etherscn instance tests to nightly

* Wait longer after rate limit

* Add Base Goerli to Etherscn Instances

* Fix Etherscan chains scroll overflow

* Move ratelimit test to end, don't assign req.chain
…successful verification

* re-enable component to display already verified triggered while filling the address
* Verify with `immutableReferences`

* Shared assertion in chain-tests. Check im-ref.json

* Remove .only from test

* Add lib-sourcify tests, lower branch treshold

* Don't delete non-existent repo

* Assign undefined when immutableRefs is empty obj

* Modify simulation tests

Since using `immutableReferences`, the contracts that coudl only be
verified with "simulation" can already be verified
with "matchWithDeployedBytecode".
This renders the prev. "simulation" tests useless.

Modify those tests for the new case accordingly, remove irrelevant tests

* Fix missing case when immutableReferences is null

* Remove constructor-args.txt check in monitor test

* Skip the Etherscan tests
kuzdogan and others added 5 commits April 13, 2023 12:13
Since the bodyParser, was set before the cors in server.ts, the response
will have wrong CORS when body size limit is hit.
Move the cors settings above bodyParser.

Also add conditional CORS settings as session requires cookies and
"*" CORS is not possible. Remove the individual cors() middleware on
every session route in VerificationController.
* fix #975 handle solc links in repo

* remove useless try-catch from fetchAndSaveSolc for handling solc links

* add test for SolcJS compiler that is saved as a link in the repo
* fix: scroll to about section

* Change element type div to button

---------

Co-authored-by: Kaan Uzdoğan <[email protected]>
…e template (#981)

* instead of using regex use replace
@kuzdogan kuzdogan merged commit ec2ac91 into master Apr 19, 2023
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

Successfully merging this pull request may close these issues.

4 participants