0

One of the Solidity best practices relating to external calls is to avoid state changes after an external call.

However, does this principle still apply if one is using a private blockchain such as Quorum?

For example, in a hypothetical situation, to decide if a trade should proceed (i.e., update a state variable in the smart contract), an external call to a service which returns credit spread VaR needs to be made first. Based on the result of the external call, the trade will either proceed or be halted.

Understand that the original intent of this external call principle is to ensure determinism. However, based on the returned external call result (i.e., an arbitrary number), the smart contract will use a if-else range to decide if the trade should proceed or not -- making this process deterministic again.

Thus, should a smart contract in a private/permissioned blockchain such as Quorum be allowed to make state changes after external calls?

SOURCES: https://docs.oraclize.it/#background

  • As far as I know, Quorum is a fork from the ethereum geth client. It has the same exact features as ethereum, except they changed the consensus algorithm to RAFT, and created a layer of transaction hiding( via cryptography ) made out of precompiled smart contracts. So if the no-state-changes work in ethereum and is not mentioned explicitly in the quorum docs, then it should be the same in both implementations. – Kaki Master Of Time Jul 16 '18 at 8:07
1

As mentioned in the comment, this would work the same way as it does in the public Ethereum. The only caveat is that private contracts cannot modify state of a public contract, but they can read values from them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.