Skip to content

Conversation

@Davphla
Copy link
Contributor

@Davphla Davphla commented Nov 22, 2025

Fix: #4440 (already closed)

This follows notJoon comment : The three issues you pointed out can be resolved with proper bounds checking alone, without requiring separate type changes. In particular, it would be good to add guard for GetByIndex and TraverseByOffset methods. from #4440 (comment)

As well I added a check on pager GetPageWithSize, as it can trigger a division by zero / undefined behavior.

I verified and there shouldn't be any other needed checks in avl packages.

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Nov 22, 2025
@Davphla Davphla moved this to NEED PEER REVIEW (INTERNAL) in FlashorgSprint: Gnocore Minicrew 🥷 Nov 22, 2025
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 22, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Nov 22, 2025

🛠 PR Checks Summary

🔴 Pending initial approval by a review team member, or review from tech-staff

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
  • The pull request description provides enough details
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🔴 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: Davphla/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🔴 Requirement not satisfied
└── 🔴 If
    ├── 🔴 Condition
    │   └── 🔴 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 leohhhn n0izn0iz notJoon omarsy x1unix] (with state "APPROVED")
    │       ├── 🔴 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🔴 This pull request is a draft
    └── 🔴 Else
        └── 🔴 And
            ├── 🟢 This label is applied to pull request: review/triage-pending
            └── 🔴 On no pull request

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)
    └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])

Can be checked by

  • team core-contributors

@Davphla Davphla marked this pull request as draft November 22, 2025 15:30
@Davphla Davphla moved this from NEED PEER REVIEW (INTERNAL) to In progress in FlashorgSprint: Gnocore Minicrew 🥷 Nov 22, 2025
@Gno2D2 Gno2D2 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 22, 2025
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Davphla Davphla marked this pull request as ready for review November 24, 2025 12:59
@Davphla Davphla moved this from In progress to NEED PEER REVIEW (INTERNAL) in FlashorgSprint: Gnocore Minicrew 🥷 Nov 24, 2025
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 24, 2025

// fast paths. these happen only if TraverseByOffset is called directly on a leaf.
if limit <= 0 || offset >= node.size {
if limit <= 0 || node.size <= offset {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: I think it is better you can have this change reverted to avoid reviewing uneccessary changes

Comment on lines +116 to 117
if index != 0 {
panic("GetByIndex asked for invalid index")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here
nitpick: I think it is better you can have this change reverted to avoid reviewing uneccessary changes

Copy link
Contributor Author

@Davphla Davphla Nov 27, 2025

Choose a reason for hiding this comment

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

This condition is not return first, therefore it is hard to read and should be change (As I've done in #4889). If not done in this PR, it should be done in another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧾 package/realm Tag used for new Realms or Packages. review/triage-pending PRs opened by external contributors that are waiting for the 1st review

Projects

Status: No status
Status: Triage

Development

Successfully merging this pull request may close these issues.

examples/gno.land/p/demo/avl use signed size

4 participants