hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
305 stars 139 forks source link

Check Checker: question about toml settings #722

Open whoabuddy opened 1 year ago

whoabuddy commented 1 year ago

We were experimenting with callee_filter = true in the CityCoins protocol (being updated here on this branch).

This produced varying results with a public function that checks data through private functions.

The mine public function in contracts/extensions/ccd006-city-mining.clar folds over mine-block with response data, which calls a few other read-only/private functions to complete mining, including the private function set-mining-data.

Adding the callee_filter = true required us to add filters to each private function, but they are designed to unwrap a value successfully or return an error.

It would be great if we had a way to mark that a function will only accept clean data.

It also seems like trusted_sender = true and trusted_caller = true didn't have the intended effects on functions within the xDAO model, including:

We're working to reduce some of the check checker errors in the branch linked above so we can dig into the more meaty ones!

whoabuddy commented 1 year ago

Expanding on this a bit:

Example of git diff --no-index between both text files above:

image

Shouldn't the files be created in the same order each time? Is there a better way to help visualize the diff here?

From there we still have some edge cases but so far the warnings are slowly getting cleaned up!

lgalabru commented 1 year ago

Shouldn't the files be created in the same order each time? Is there a better way to help visualize the diff here?

hey @whoabuddy! thanks for raising this issue. I noticed this issue, it is pretty annoying, specially in the context of deployments plans - dependencies get re-ordered, creating useless differences. I'll try to address this issue soon.

lgalabru commented 1 year ago

Ordering issue should be addressed with https://github.com/hirosystems/clarinet/pull/716/commits/cf8140e6534bfc1a2f01c09addcae3a45d85d290