Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(gnovm): remove Get prefixes from GetCallerAt, GetOrigSend, GetOrigCaller and extend abbreviations #3374

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

hthieu1110
Copy link
Contributor

@hthieu1110 hthieu1110 commented Dec 19, 2024

Linked to #1475

  • GetCallerAt =>CallerAt
  • GetOrigSend => OriginSend
  • origSend => originSend
  • GetOrigCaller => OriginCaller
  • origCaller => originCaller
  • Orig => Origin
  • Addr => Address
  • PrevRealm => PreviousRealm

This is a BREAKING CHANGE.

@github-actions github-actions bot added 🧾 package/realm Tag used for new Realms or Packages. 📦 🤖 gnovm Issues or PRs gnovm related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Dec 19, 2024
@Gno2D2 Gno2D2 requested review from a team December 19, 2024 14:31
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 19, 2024

🛠 PR Checks Summary

🔴 Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
  • Determine if infra needs to be updated before merging
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)
🔴 Changes to 'docs' folder must be reviewed/authored by at least one devrel and one 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
└── 🟢 The pull request was created from a fork (head branch repo: hthieu1110/gno)

Then

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

Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff

If

🟢 Condition met
└── 🟢 A changed file matches this pattern: ^docs/ (filename: docs/assets/how-to-guides/creating-grc20/mytoken-1.gno)

Then

🔴 Requirement not satisfied
└── 🔴 Or
    ├── 🔴 And
    │   ├── 🔴 Pull request author is a member of the team: devrels
    │   └── 🔴 At least 1 user(s) of the team tech-staff approved pull request
    └── 🔴 And
        ├── 🔴 Pull request author is a member of the team: tech-staff
        └── 🟢 At least 1 user(s) of the team devrels approved 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
Determine if infra needs to be updated before merging

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: master
    └── 🟢 Or
        ├── 🔴 A changed file matches this pattern: Dockerfile
        ├── 🟢 A changed file matches this pattern: ^misc/deployments (filename: misc/deployments/test5.gno.land/genesis_txs.jsonl)
        ├── 🔴 A changed file matches this pattern: ^misc/docker-
        ├── 🔴 A changed file matches this pattern: ^.github/workflows/releaser.*\.yml$
        └── 🔴 A changed file matches this pattern: ^.github/workflows/portal-loop\.yml$

Can be checked by

  • team devops

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gnovm/tests/stdlibs/std/std.go 40.00% 6 Missing ⚠️
gnovm/stdlibs/std/banker.go 0.00% 5 Missing ⚠️
gnovm/stdlibs/std/native.go 50.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hthieu1110 hthieu1110 marked this pull request as ready for review December 19, 2024 16:01
@hthieu1110 hthieu1110 changed the title feat(gnovm): remove Get prefixes from GetCallerAt, GetOrigSend, GetOrigCaller refactor(gnovm): remove Get prefixes from GetCallerAt, GetOrigSend, GetOrigCaller Dec 20, 2024
@hthieu1110 hthieu1110 changed the title refactor(gnovm): remove Get prefixes from GetCallerAt, GetOrigSend, GetOrigCaller refactor(gnovm): remove Get prefixes from GetCallerAt, GetOrigSend, GetOrigCaller and extend abbreviations Dec 20, 2024
@jefft0 jefft0 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Dec 20, 2024
@@ -22,7 +22,7 @@ Returns the **Address** field of the realm it was called upon.

#### Usage
Copy link
Member

Choose a reason for hiding this comment

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

missing modification in struct + subtitle name func

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

```
---

## GetOrigPkgAddr
## GetOriginPkgAddr
Copy link
Member

Choose a reason for hiding this comment

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

GetOriginPkgAddress

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

```
---

## TestSetOrigPkgAddr
## TestSetOriginPkgAddr
Copy link
Member

Choose a reason for hiding this comment

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

Why you "Addr" and sometimes "Address" which one is good, we should try to keep it consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Address is good :) this is the missing refactor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -7,7 +7,7 @@ func ExampleExposeBankForMaketxRunOrImports() {}
func ExampleCustomTellerImpl() {}
func ExampleAllowance() {}
func ExampleRealmBanker() {}
func ExamplePrevRealmBanker() {}
func ExamplePreviousRealmBanker() {}
Copy link
Member

Choose a reason for hiding this comment

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

should we limit the scope of the PR to change naming in std lib only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is related to Realm so I think we should change also here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Kouteki Kouteki added the in focus Core team is prioritizing this work label Dec 20, 2024
@Kouteki Kouteki requested review from petar-dambovaliev and mvertes and removed request for a team December 20, 2024 12:07
@Kouteki Kouteki added this to the 🚀 Mainnet beta launch milestone Dec 20, 2024
@Gno2D2 Gno2D2 requested review from a team December 20, 2024 12:07
@notJoon
Copy link
Member

notJoon commented Dec 26, 2024

While changing the Get prefix from std APIs aligns with Go's conventions. I am concerned that an immediate change would severely impact backward compatibility for other projects.

Taking Gnoswap as an example, once a contract is deployed, it becomes practically impossible to modify1. This means there would be no way to adapt if these method names change, which could lead to fatal issues in production evironments.

Therefore, I propose the following gradual approach:

  1. Mark existing APIs as deprecated while maintaining them
  2. Add new methods following the new naming convention
  3. Gradually phase out support for existing methods after providing sufficient migration period

This approach would allow existing projects adequate time to apply to the new changes.

Also, I think this PR must mark as a breaking change BTW.

Footnotes

  1. While this task could be executed through governance voting, we would have no way to respond or adapt during that voting period.

Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

..

@notJoon

This is part of the std refactor that we're in the works for, for which we cannot avoid breaking backwards compatibility unfortunately.

@Gno2D2 Gno2D2 requested a review from a team December 27, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in focus Core team is prioritizing this work 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 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: In Review
Development

Successfully merging this pull request may close these issues.

7 participants