gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
899 stars 377 forks source link

fix: prevent false positive return for guarding dao member store #3121

Closed piux2 closed 1 week ago

piux2 commented 1 week ago

If we want to guard the MemStore by checking the active DAO realm, m.daoPkgPath must first be assigned a realm package path; otherwise, the isCallerDAORealm() method may return a false positive, failing to protect the MemStore.

Contributors' checklist... - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 63.78%. Comparing base (bd1d76e) to head (52dd472). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3121 +/- ## ========================================== - Coverage 63.79% 63.78% -0.01% ========================================== Files 549 549 Lines 78819 78819 ========================================== - Hits 50279 50276 -3 - Misses 25150 25152 +2 - Partials 3390 3391 +1 ``` | [Flag](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | Coverage Δ | | |---|---|---| | [contribs/gnodev](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `61.16% <ø> (ø)` | | | [contribs/gnofaucet](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `14.82% <ø> (ø)` | | | [gno.land](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `73.70% <ø> (ø)` | | | [gnovm](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `67.93% <ø> (ø)` | | | [misc/genstd](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `79.72% <ø> (ø)` | | | [tm2](https://app.codecov.io/gh/gnolang/gno/pull/3121/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `62.43% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Kouteki commented 1 week ago

Closing the issue: Manfred & Miloš discussed this and agreed that, if daoPkgPath isn't defined, realm guard should not be active.