iden3 / go-iden3-core

Go core implementation of the iden3 system
https://docs.iden3.io
Apache License 2.0
90 stars 34 forks source link

Fix Issuer.PublishState consistency #381

Closed ed255 closed 4 years ago

ed255 commented 4 years ago

Resolve #379 Previously if the Issuer.PublishState got an error when calling the smart contract, the Issuer got into a corrupted state that didn't let it advance further. Now the PublishState is divided into two atomic parts: 1- Calculate new State 2- Generate zkproof and call smart contract

If the 1st part succeeds but the 2nd doesn't, the next call to PublishState only goes through 2nd part allowing the smart contract call error to be corrected.

Note: This bug was detected when the testing address didn't have enough funds.