Skip to content

fix(sdk): correctly handle no batch case#2214

Merged
smartcontracts merged 1 commit intodevelopfrom
sc/sdk-fix-no-batch
Feb 17, 2022
Merged

fix(sdk): correctly handle no batch case#2214
smartcontracts merged 1 commit intodevelopfrom
sc/sdk-fix-no-batch

Conversation

@smartcontracts
Copy link
Contributor

Description
Fixes the SDK so that it correctly handles the case where no batches
have been submitted to the StateCommitmentChain yet. Only happens in
development or immediately after a new chain is started.

Metadata

@changeset-bot
Copy link

changeset-bot bot commented Feb 15, 2022

🦋 Changeset detected

Latest commit: f37c283

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2022

Codecov Report

Merging #2214 (5329ab4) into develop (e0f7e5f) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2214      +/-   ##
===========================================
- Coverage    73.35%   73.33%   -0.02%     
===========================================
  Files           84       84              
  Lines         2766     2768       +2     
  Branches       472      473       +1     
===========================================
+ Hits          2029     2030       +1     
- Misses         737      738       +1     
Flag Coverage Δ
batch-submitter 62.63% <ø> (ø)
contracts 90.48% <ø> (ø)
core-utils 87.80% <ø> (ø)
data-transport-layer 36.89% <ø> (ø)
sdk 59.94% <50.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/sdk/src/cross-chain-messenger.ts 71.86% <50.00%> (-0.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0f7e5f...5329ab4. Read the comment docs.

@palango
Copy link
Contributor

palango commented Feb 15, 2022

Great, that fixes the problem for me.

Would it be possible to add logging of the transaction hash of the L1 transaction that is sent?

@smartcontracts
Copy link
Contributor Author

Great, that fixes the problem for me.

Would it be possible to add logging of the transaction hash of the L1 transaction that is sent?

Hmmm where would you want the logging added? I'd prefer not to add logging directly into the SDK, although I could add logging into the message relayer if that's what you're asking.

@palango
Copy link
Contributor

palango commented Feb 15, 2022

Hmmm where would you want the logging added? I'd prefer not to add logging directly into the SDK, although I could add logging into the message relayer if that's what you're asking.

In the message relayer is completely fine. It would just be good to know which transactions are send by the relayer.

@smartcontracts
Copy link
Contributor Author

@palango Ok great, I will make a PR for that. Thank you for the feedback! Also, feel free to email me at [kelvin AT optimism DOT io] for a hand-drawn contributor NFT since you've been making a lot of great issues :-)

@smartcontracts
Copy link
Contributor Author

@palango
Copy link
Contributor

palango commented Feb 15, 2022

@palango is this PR sufficient? https://github.com/ethereum-optimism/optimism/pull/2217/files

Yes, perfect. Thanks a lot!

Fixes the SDK so that it correctly handles the case where no batches
have been submitted to the StateCommitmentChain yet. Only happens in
development or immediately after a new chain is started.
@github-actions github-actions bot added the A-pkg-sdk Area: packages/sdk label Feb 17, 2022
@smartcontracts smartcontracts merged commit 944f75c into develop Feb 17, 2022
@smartcontracts smartcontracts deleted the sc/sdk-fix-no-batch branch February 17, 2022 16:02
theochap pushed a commit that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-pkg-sdk Area: packages/sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relayer: unhandled exception

4 participants