|
|
|
|
|
by JulianMorrison
3655 days ago
|
|
Isn't this just a normal data race with stateful actors? Something modified the data while A is calling B (doesn't have to be B, could be any X) in between a call and its response. The answer to this is that mutation needs to be kept under control. Immutable data structures in mutable buckets. Locking around the data that mustn't change. Deep copy all state before calling out. And so forth. This is basically an understood problem and I'm a bit appalled that Ethereum didn't build protection against it into their design. |
|
One easy solution is to have just one external call per method, and always put it at the end of the method. Another is to use a single mutex for all public functions of the contract, so any callbacks fail.