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

fix: data race issue #135

Merged
merged 3 commits into from
Mar 16, 2023
Merged

fix: data race issue #135

merged 3 commits into from
Mar 16, 2023

Conversation

pythonberg1997
Copy link
Contributor

Description

This pr aims to fix data race issue within EIP712 sign mode's GetSignBytes method

Rationale

The previous implementation is not thread-safe.

Changes

  • The EIP712 domain will be created locally.

image

  • Remove global MsgCodec

@pythonberg1997 pythonberg1997 changed the base branch from master to develop March 16, 2023 05:33
@@ -180,11 +180,12 @@ func WrapTxToTypedData(
// filling nil value
cleanTypesAndMsgValue(msgTypes, "Msg", txData["msg"].(map[string]interface{}))

domain.ChainId = math.NewHexOrDecimal256(int64(chainID))
domainTemp := domain
Copy link
Collaborator

Choose a reason for hiding this comment

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

It can not fix the race issue.

@unclezoro unclezoro merged commit ab4c7d5 into develop Mar 16, 2023
@pythonberg1997 pythonberg1997 deleted the wallet_support branch April 4, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants