Skip to content

Conversation

@nivcertora
Copy link
Contributor

No description provided.

@nivcertora nivcertora requested a review from nd-certora July 1, 2025 10:36
@nivcertora nivcertora self-assigned this Jul 1, 2025
@yoav-el-certora yoav-el-certora requested a review from johspaeth July 1, 2025 10:50
/**
* @notice Rule to verify data integrity during storage pointer operations
*/
rule testDataIntegrity(env e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's interesting in this rule?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what our policy for the Certora Examples here is, but this rule seems to be a sanity check that re-routing summaries doesn't break the data, while it's good to have, my opinion is that this should rather be a test in EVMVerifier than living here in examples, as it is just unnecessary noise for the example. @yoav-el-certora what do you think?

If you agree, I'll remove the test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what was the motivation for writing this example.
If you both agree, we can probably remove it.

"Current data length should match new data length";

// Verify operation counter was incremented
assert operationCounter() == initialCounter + 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this will fail, right?

* @notice Invariant to ensure operation counter only increases
*/
invariant operationCounterMonotonic()
operationCounter() >= 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so with the summary it will not increase, right?


## Problem Statement

In traditional CVL specifications, internal functions that accept storage pointers (especially mappings) are difficult to summarize because:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In traditional CVL specifications, internal functions that accept storage pointers (especially mappings) are difficult to summarize because:
Internal functions that accept storage pointers (especially mappings) can not be summarized to a CVL function that uses the arguments

@yoav-el-certora
Copy link
Contributor

Assigning @johspaeth (or someone from his team) to complete and merge this Example.

Copy link
Contributor

@johspaeth johspaeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my side, this is good to go modulo deletion of the noise that I will take care of when Yoav agrees.

@nd-certora can you re-review?

/**
* @notice Rule to verify data integrity during storage pointer operations
*/
rule testDataIntegrity(env e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what our policy for the Certora Examples here is, but this rule seems to be a sanity check that re-routing summaries doesn't break the data, while it's good to have, my opinion is that this should rather be a test in EVMVerifier than living here in examples, as it is just unnecessary noise for the example. @yoav-el-certora what do you think?

If you agree, I'll remove the test.

Comment on lines 99 to 108
/**
* @notice Invariant to ensure operation counter only increases
*/
invariant operationCounterMonotonic()
operationCounter() >= 0
{
preserved {
require operationCounter() <= max_uint256 - 1;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The invariant is excluded from verification in .conf and I don't see it's value. I removed it to reduce the noise here.

@johspaeth johspaeth requested a review from nd-certora July 29, 2025 11:26
# Conflicts:
#	CVLByExample/README.md
@johspaeth johspaeth merged commit ce303a1 into cli-beta Aug 4, 2025
yoav-el-certora added a commit that referenced this pull request Aug 11, 2025
* Add an example on how to reason about events in CVL (#174)

* 7.26.0 Release (#163)

* Niv/cert 8248 revert example (#155)

* CERT 8248 Add Revert Example

* Update README

* Address Christiane review

* Update example based on Nurit Review

* Clean

* Update config.yml (#160)

Co-authored-by: yoav-el-certora <122207807+yoav-el-certora@users.noreply.github.com>

* Example ready

* christiane cr

* Code reviews

---------

Co-authored-by: Niv vaknin <122722245+nivcertora@users.noreply.github.com>
Co-authored-by: liav-certora <114004726+liav-certora@users.noreply.github.com>
Co-authored-by: liav-certora <liav@certora.com>

* Bug fixed

* Add an example on how to reason about events in CVL

* Addressing code reviews

* Addressing Christiane's CR

* Issue with merge resolution

* Revert "Bug fixed"

This reverts commit 33b87b9.

* Reverse incorrect change after merge

---------

Co-authored-by: yoav-el-certora <122207807+yoav-el-certora@users.noreply.github.com>
Co-authored-by: Niv vaknin <122722245+nivcertora@users.noreply.github.com>
Co-authored-by: liav-certora <114004726+liav-certora@users.noreply.github.com>
Co-authored-by: liav-certora <liav@certora.com>
Co-authored-by: Otakar <Otakar@certora.com>

* Removed Process from conf file

* Removed send_only from conf file

* add a simple example with a transient field and hooks and direct storage accesses on it

* remove rule sanity

Co-authored-by: Johannes Späth <johspaeth@users.noreply.github.com>

* remove ambiguity

* CERT 8687 Realistic example (#167)

* CERT 8687 Realistic example

* fix spec, sanity issue

* fix

* require invariant example

* Update README

* Update CVLByExample/Invariant/RequireInvariantArray/README.md

* Addressing Nurit's CR

---------

Co-authored-by: Nurit Dor <57101353+nd-certora@users.noreply.github.com>
Co-authored-by: Johannes Späth <johspaeth@users.noreply.github.com>
Co-authored-by: Johannes Spaeth <johannes@certora.com>

* Re routing example (#180)

* Re routing example

* Updating example

---------

Co-authored-by: Johannes Spaeth <johannes@certora.com>

* Niv/fix sanity failure (#183)

* Fix some of the sanity failure

* Fixing specification to not have sanity failures

runFullPool.conf -> https://vaas-stg.certora.com/output/53900/a7ab7f221da84eb4accea1c95e936803?anonymousKey=e063b8e60bae944b4a9d0d0431999b5bd4b578ea
runBroken.con -> https://vaas-stg.certora.com/output/53900/c85b8c49fec24d32ac0de00043d7ddd6?anonymousKey=a6c585f91d010a7c13f1c6d8935143b894a0c05d

* Updates to spec

* Self-Review

---------

Co-authored-by: Johannes Spaeth <johannes@certora.com>
Co-authored-by: yoav-el-certora <122207807+yoav-el-certora@users.noreply.github.com>

* Added fixes to breaking changes (#190)

* foundry toml

* comment

* branch

* branch

* branch

* Add an example for internal function calls (#191)

* add an example for internal function calls

* Update CVLByExample/InternalFunctionsFromCVL/README.md

Co-authored-by: Johannes Späth <johspaeth@users.noreply.github.com>

---------

Co-authored-by: Johannes Späth <johspaeth@users.noreply.github.com>

* Added foundry installation to CI (#194)

---------

Co-authored-by: Johannes Späth <johspaeth@users.noreply.github.com>
Co-authored-by: Niv vaknin <122722245+nivcertora@users.noreply.github.com>
Co-authored-by: liav-certora <114004726+liav-certora@users.noreply.github.com>
Co-authored-by: liav-certora <liav@certora.com>
Co-authored-by: Otakar <Otakar@certora.com>
Co-authored-by: Christiane Goltz <christiane@certora.com>
Co-authored-by: Nurit Dor <57101353+nd-certora@users.noreply.github.com>
Co-authored-by: Johannes Spaeth <johannes@certora.com>
Co-authored-by: rahav <rahav@certora.com>
Co-authored-by: Rahav <103361134+rahav-certora@users.noreply.github.com>
Co-authored-by: Naftali Goldstein <44599898+naftali-g@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants