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

Remove Goerli chain ID support #454

Merged
merged 49 commits into from
May 20, 2024

Conversation

franciszekjob
Copy link
Contributor

@franciszekjob franciszekjob commented Apr 15, 2024

Describe your changes

  • Bump starknet-devnet-rs to v0.0.5
  • Change Goerli to Sepolia in references and tests
  • Update chainId to use StarknetChainId.fromNetworkName("SN_GOERLI") in DeprecatedTransactionHashTest and TransactionHashV3Test - we just want to test calculation process, so there's no need to update this field to Sepolia
  • Remove unused secrets

Linked issues

Closes #425

Breaking changes

  • This issue contains breaking changes
  • StarknetChainId: Removed GOERLI field

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.60%. Comparing base (d28b008) to head (70c5f16).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
- Coverage   71.12%   69.60%   -1.52%     
==========================================
  Files          75       75              
  Lines        3338     3313      -25     
  Branches      367      365       -2     
==========================================
- Hits         2374     2306      -68     
- Misses        798      848      +50     
+ Partials      166      159       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.github/workflows/checks.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -12,7 +12,7 @@ internal class TransactionHashCalculatorTest {
inner class DeprecatedTransactionHashTest {
private val calldata = listOf(Felt(999), Felt(888), Felt(777))
private val maxFee = Felt.fromHex("0xabcd987654210")
private val chainId = StarknetChainId.GOERLI
private val chainId = StarknetChainId.SEPOLIA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'm a bit unsure about this change. If I remember correctly, the previous hashes were verified against some tool like sn.js.

Did you verify the new ones? Maybe we should just use StarknetChainId.fromHex("SN_GOERLI") to avoid changing the test cases.

@THenry14 WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be pretty safe, we can verify to be double-sure but I suppose this should be fine as is (as we do not change any logic behind calculations)

// This test sometimes fails due to getNonce receiving higher (pending) nonce than addDeclareTransaction expects

// TODO: (#384) Test v3 transactions on Sepolia
assumeTrue(network == Network.GOERLI_INTEGRATION)
assumeTrue(network == Network.SEPOLIA_INTEGRATION)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test pass locally?

If I remember correctly, v3 tests on Sepolia networks should've been added only in #384. If they do work as expected on SEPOLIA_INTEGRATION without any additional changes, I would assume SEPOLIA_TESTNET tests should work as well and this line could be removed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also applies to other places where this line is present

Network.SEPOLIA_INTEGRATION -> Felt.fromHex("0x01556b67a22bc26dfc4827286997e3e3b53380e14ba1d879f1d67b7ffbd5a808")
Network.SEPOLIA_TESTNET -> Felt.fromHex("0x0683e900e4c0e27e164f0b7569f86edec6dec919e55d97728113b40fe6b731c7")
}
private val deployAccountV3TransactionHash by lazy {
when (network) {
Network.GOERLI_INTEGRATION -> Felt.fromHex("0x7c1ca558aaec1a14a4c0553517013631fad81c48667a3bcd635617c2560276")
Network.SEPOLIA_INTEGRATION -> Felt.fromHex("0x7c1ca558aaec1a14a4c0553517013631fad81c48667a3bcd635617c2560276")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work, there's no such transaction on Sepolia integration.

You should manually look up deploy account / invoke / declare v3 transactions for both testnet and integration Sepolia networks (or send them yourself) and paste their hashes here.

This is of course part of a different issue (#384), so you can either include the change in this PR, or disable tests for now and deal with this in a separate one.

@@ -121,7 +105,7 @@ class ProviderTest {
val transactionHash2 = revertedInvokeV1TransactionHash
val transactionStatus = provider.getTransactionStatus(transactionHash).send()
// TODO: Re-enable this assertion for integration once transaction appear as accepted on L1 again
if (network != Network.GOERLI_INTEGRATION) {
if (network != Network.SEPOLIA_INTEGRATION) {
Copy link
Collaborator

@DelevoXDG DelevoXDG Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify whether this is still needed on Sepolia integration.

Copy link
Collaborator

@DelevoXDG DelevoXDG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed changes offline, submitting empty review so you can re-request it later

@DelevoXDG DelevoXDG removed their request for review April 20, 2024 09:33
@@ -766,12 +756,10 @@ class AccountTest {
fun `test udc deploy with parameters`() {
assumeTrue(NetworkConfig.isTestEnabled(requiresGas = true))

assumeFalse(network == Network.GOERLI_INTEGRATION)
assumeFalse(network == Network.SEPOLIA_INTEGRATION)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed?

Previously, it was used because (for whatever reason) we could only run the test on GOERLI_INTEGRATION. Does that still hold and this test pass only on SEPOLIA_INTEGRATION?

The same applies to all the other assumeFalse / assumeTrue checks

… into chore/425-remove-goerli-chain-id-support
@franciszekjob franciszekjob removed the request for review from THenry14 May 17, 2024 18:14
.github/workflows/checks.yml Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
androiddemo/README.md Show resolved Hide resolved
lib/src/test/kotlin/network/account/AccountTest.kt Outdated Show resolved Hide resolved
Co-authored-by: Wojciech Szymczyk <wojciech.szymczyk@swmansion.com>
Copy link
Collaborator

@DelevoXDG DelevoXDG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall

.github/workflows/checks.yml Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@franciszekjob franciszekjob merged commit 586897f into main May 20, 2024
2 checks passed
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.

Remove support for Goerli chain ID
4 participants