-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: added async retryer for currentL2BlockNumber in case the contra… #425
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
============================================
- Coverage 70.17% 70.14% -0.04%
Complexity 1070 1070
============================================
Files 306 306
Lines 12337 12330 -7
Branches 1179 1181 +2
============================================
- Hits 8658 8649 -9
- Misses 3200 3201 +1
- Partials 479 480 +1
*This pull request uses carry forward flags. Click here to find out more.
|
backoffDelay = pollingInterval | ||
) { | ||
SafeFuture.of(lineaRollupSmartContractWeb3jClient.currentL2BlockNumber().sendAsync()) | ||
} |
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.
Add retry here to wait until currentL2BlockNumber
on L1 is present, otherwise will get the following error:
time=2024-12-12T06:25:21,230Z level=FATAL message=org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract | logger=CoordinatorAppCli thread=main | java.util.concurrent.ExecutionException: org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract
2024-12-12 14:25:21 at java.base/java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
2024-12-12 14:25:21 at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
2024-12-12 14:25:21 at net.consensys.zkevm.coordinator.app.L1DependentApp.<init>(L1DependentApp.kt:308)
...
vertx, | ||
backoffDelay = config.pollingInterval | ||
) { | ||
SafeFuture.of(lineaRollup.currentL2BlockNumber().sendAsync()) |
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.
Add retry here to wait until currentL2BlockNumber
on L1 is present to avoid printing the "Empty value (0x) returned from contract" warning log message.
@@ -31,7 +31,7 @@ class FeeHistoryFetcherImpl( | |||
} | |||
|
|||
private var cacheIsValidForBlockNumber: BigInteger = BigInteger.ZERO | |||
private var feesCache: FeeHistory = getRecentFees().get() | |||
private lateinit var feesCache: FeeHistory |
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.
To avoid calling getRecentFees().get()
immediately on coordinator start-up (i.e. when L1 current ethBlockNumber is zero) which would lead to get(...) must not be null
NPE
…ct variable is not initialized yet
45da1fe
to
93af0f5
Compare
…ct variable is not initialized yet
This PR implements issue(s) #317
Checklist