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

XDP-02 fix Panic In ProcessOrderPending Leads To Chain Halt #392

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

liam-lai
Copy link
Collaborator

@liam-lai liam-lai commented Jan 15, 2024

Proposed changes

In the implementation, if from != acc and len(accTxs) == 1, the key from will be deleted from the map txs, and an empty array accTxs[1:] will be assigned to the key acc. As a result, when the for loop checks the key acc, a panic will occur with the error index out of range [0] with length 0 because the code is trying to get the value of accTxs[0].

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

@liam-lai liam-lai changed the title fix Panic In ProcessOrderPending Leads To Chain Halt XDP-02 fix Panic In ProcessOrderPending Leads To Chain Halt Jan 17, 2024
@wjrjerome wjrjerome merged commit 81ff642 into dev-upgrade Jan 19, 2024
2 checks passed
@wjrjerome wjrjerome deleted the XDP-02 branch January 19, 2024 00:22
@liam-lai liam-lai mentioned this pull request Feb 4, 2024
19 tasks
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