Skip to content

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