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

Add chain 295 (Hedera Mainnet) #1009

Merged
merged 8 commits into from
May 8, 2023
Merged

Add chain 295 (Hedera Mainnet) #1009

merged 8 commits into from
May 8, 2023

Conversation

svienot
Copy link
Contributor

@svienot svienot commented May 2, 2023

Adds support for chain 295 - Hedera mainnet

View in Huly HI-719

@svienot svienot changed the title Add chain 295 - Hedera Mainnet Add chain 295 (Hedera Mainnet) May 2, 2023
@marcocastignoli
Copy link
Member

Hey @svienot, first of all thanks for the contribution! 🙏

I see you added new sources for the tests. Existing contracts sources didn't work for some reason? Just for context, I see you followed point 5.ii in Sourcify's documentation, my question is: why points 5.i.a or 5.i.b or 5.i.c didn't work for you?

Same question also for #1008

@svienot
Copy link
Contributor Author

svienot commented May 4, 2023

Hey @marcocastignoli!
I assumed the other methods for deploying the contracts required my having an Ethereum account at hand, which I don't.
So I thought the easiest would just be to deploy them from one of my Hedera accounts with the Hedera SDK.

Regarding #1008 I think I will actually need to close it, unless you can confirm there is a way to reset repository data for a test chain?

@svienot
Copy link
Contributor Author

svienot commented May 4, 2023

I have tried to sync my fork with stage. As a consequence:

  • I see one of the checks now fails (all was green when I initially submitted)
  • I can no longer run npx lerna bootstrap in my repo. I get the following errors:
$ npx lerna bootstrap
lerna notice cli v3.22.1
lerna info Bootstrapping 5 packages
lerna info Installing external dependencies
lerna ERR! npm install --no-package-lock exited 1 in 'ethereum-sourcify'
lerna ERR! npm install --no-package-lock stderr:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"^4.9.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=5.0.4" from [email protected]
npm ERR! node_modules/abitype
npm ERR!   abitype@"^0.8.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

@marcocastignoli
Copy link
Member

marcocastignoli commented May 4, 2023

peer typescript@">=5.0.4" from [email protected]

In theory I fixed this problem, try to delete all node_modules (at least the main one and the one in packages/lib-sourcify). Then execute in root of the project:

  • npm install
  • npx lerna bootstrap

@marcocastignoli
Copy link
Member

marcocastignoli commented May 4, 2023

I assumed the other methods for deploying the contracts required my having an Ethereum account at hand, which I don't. So I thought the easiest would just be to deploy them from one of my Hedera accounts with the Hedera SDK.

You can deploy the already existing contracts with your Hedera accounts, you just need to follow one of the 3 available options described at point 5.i

EDIT: from my point of view, the easiest option is to use the script:

marcocastignoli@localhost sourcify % node test/chains/deployContracts.js --help

Usage: deployContracts --chainId=<chainId> --privateKey=<privateKey>

Script to deploy Sourcify's (sourcify.dev) sample contracts (both with immutables and without)

Options:
  --chainId <chainId>         Chain ID of the chain to deploy the contract. The chain must be added to src/sourcify-chains.ts. Also make sure to build typescript after adding the chain with `npx lerna
                              run build`.
  --privateKey <privateKey>   Private key of the account that will deploy the contract
  --immutableValue <uint256>  Value to be stored as the immutable value.
  --type <contractType>       Which contract to deploy. Either 'immutable' or 'normal'. If not given, deploys both contracts by default.
  -h, --help                  Output the help message.

@svienot
Copy link
Contributor Author

svienot commented May 5, 2023

deployContracts wants a 32 bytes long private key while my Hedera account private key is 48 bytes long.

@svienot
Copy link
Contributor Author

svienot commented May 5, 2023

I have re-deployed the test contracts using the exact byte code found in 1_Storage.json and WithImmutables.json of the shared directory. The verification seems to be fine now.

@kuzdogan kuzdogan merged commit f9e74dc into ethereum:staging May 8, 2023
@svienot
Copy link
Contributor Author

svienot commented May 8, 2023

I see that Hedera Mainnet is still not listed in the available chains on the repository UI page:
https://repo.staging.sourcify.dev/select-contract/
Is it a bug or is there a distinct code change needed for that ?

@svienot svienot deleted the add-chain-295 branch May 8, 2023 19:55
@kuzdogan
Copy link
Member

kuzdogan commented May 9, 2023

We just did a release. You should see it now

@svienot
Copy link
Contributor Author

svienot commented May 10, 2023

I was just wondering... are you aware of any test chains integrated with Sourcify which have the need to regularly reset their data? How do they deal with their verification data ?

@svienot
Copy link
Contributor Author

svienot commented May 10, 2023

I also noticed that Hedera Mainnet is listed with missing verification tests in the docs. We now have 2 tests based on the shared contracts so shouldn't these be ticked ?
Screenshot 2023-05-10 at 10 22 15

@kuzdogan
Copy link
Member

I was just wondering... are you aware of any test chains integrated with Sourcify which have the need to regularly reset their data? How do they deal with their verification data ?

Not that I know of. I don't know any chains that do this or if it is considered common practice. Usually, testnets are not reset but rotated with new ones, old ones being deprecated.

I also noticed that Hedera Mainnet is listed with missing verification tests in the docs. We now have 2 tests based on the shared contracts so shouldn't these be ticked ?

This is because the tests run weekly and Hedera tests haven't run yet. They'll run on Monday

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.

3 participants