semaphore-protocol / semaphore

A zero-knowledge protocol for anonymous interactions.
https://semaphore.pse.dev
MIT License
925 stars 207 forks source link

Update solidity contracts version dependency from fixed version to using `^` specifier #888

Closed jimmychu0807 closed 3 weeks ago

jimmychu0807 commented 4 weeks ago

Describe the improvement you're thinking about

Update all solidity contracts version from:

pragma solidity 0.8.23;

to

pragma solidity ^0.8.23;

or to a version range that core developers agree.

Additional context The reason is because Semaphore is becoming a library (building block) for dApp developers, and they integrate Semaphore into their dApp contracts. Using a fixed version specification 0.8.23 in Semaphore is restricting the solidity version used in downstream development.

There maybe a repercussion of updating zk-kit.solidity as well.

cedoor commented 3 weeks ago

Hey @jimmychu0807, as a good practice we've tried to keep those versions fixed to avoid any unexpected behavior.

Context: https://github.com/semaphore-protocol/semaphore/issues/115

But curious to know your opinion on this.

jimmychu0807 commented 3 weeks ago

I agree there is actually a balance here, fixed version being restrictive and safe, and a wide version range being loosed and have a higher potential security risk.

A few thought points on this:

cedoor commented 3 weeks ago

One possible (and more balanced) approach is making the version range to be restrictive such as pragma solidity >=0.8.23 <=0.8.28; The LTE version could be the latest solidity version that core dev team have tested and work with Semaphore. This ensures the security safety while giving downstream dev flexibility to pick their solidity version.

I like this compromise!

Curious to hear @vplasencia's opinion here.

PR: https://github.com/semaphore-protocol/semaphore/pull/891