sui icon indicating copy to clipboard operation
sui copied to clipboard

calling `add_pending_certificates` when AuthorityState gets error from handling certificate

Open longbowlu opened this issue 3 years ago • 3 comments

in fn handle_certificate in authority_server.rs, when state.handle_certificate(&certificate) gets an error, we call .add_pending_certificates(vec![(tx_digest, Some(certificate))]). Is this still needed?

code pointer: https://github.com/MystenLabs/sui/blob/main/crates/sui-core/src/authority_server.rs#L483

longbowlu avatar Oct 24 '22 21:10 longbowlu

I think we should not do this for shared object certificate, since this does not take shared locks correctly. For owned object transactions, we don't have to queue the certificate but it should be ok.

mwtian avatar Nov 03 '22 19:11 mwtian

can you elaborate why " this does not take shared locks correctly." ?

longbowlu avatar Nov 04 '22 07:11 longbowlu

Before, adding a shared object txn to the pending queue, shared object locks must be taken. Otherwise the certificate will not be able to figure out its shared input object versions. Also, most handle certificate errors are likely non-transient and should not be retried internally, after we make sure there will be no missing input object errors.

mwtian avatar Nov 04 '22 17:11 mwtian