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

共识错误 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

共识错误 #10

wants to merge 1 commit into from

Conversation

coderInk
Copy link

  1. 给header.Time赋值时如果在Finalize函数中,在收到远端挖出的块的时候,会在验证state的时候也会再次调用Finalize函数,将再次给header.Time赋值,使得state状态不一样,从而产生分叉.模拟重现,部署智能合约,合约中调用now()函数给变量赋值,由于now()函数取值为header.Time值,使得打包块打包的header.Time值与验证时header.Time值不一样,从事验证时stateRoot验证不通过,产生bad block从而分叉.

  2. 指针赋值发生浅拷贝赋值.

…ize函数,将再次给header.Time赋值,使得state状态不一样,从而产生分叉.模拟重现,部署智能合约,合约中调用now()函数给变量赋值,由于now()函数取值为header.Time值,使得打包块打包的header.Time值与验证时header.Time值不一样,从事验证时stateRoot验证不通过,产生bad block从而分叉.

2. 指针赋值发生浅拷贝.
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.

1 participant