Skip to content

Conversation

@thehowl
Copy link
Member

@thehowl thehowl commented Apr 2, 2025

This pull request performs the std split as specified initially in #1475, then #3874. Fixes #3874.

Use #4753 for a "files changed" tab that won't crash your browser

Most changes in examples are automated, and performed using gno fix (#4100). gno fix is a tool developed to update old Gno code into new one, so that this change and possible future changes are the least disruptive to those working with Gno code.

Most of the changes can be boiled down to the following:

original syntax new syntax notes
std.Address address on master, it is just a type alias
std.Emit chain.Emit
std.DerivePkgAddr chain.PackageAddress
std.Coin chain.Coin
std.Coins chain.Coins
std.NewCoin chain.NewCoin
std.NewCoins chain.NewCoins
std.CoinDenom chain.CoinDenom
std.RawAddressSize 20 constant removed
std.RawAddress [20]byte type removed
std.EncodeBech32 removed manual conversion required
std.DecodeBech32 removed manual conversion required
std.AssertOriginCall chain/runtime.AssertOriginCall
std.PreviousRealm chain/runtime.PreviousRealm
std.CurrentRealm chain/runtime.CurrentRealm
std.NewUserRealm testing.NewUserRealm moved to testing package
std.NewCodeRealm testing.NewCodeRealm moved to testing package
std.OriginCaller chain/runtime.OriginCaller
std.ChainDomain chain/runtime.ChainDomain
std.ChainHeight chain/runtime.ChainHeight
std.ChainID chain/runtime.ChainID
std.CallerAt chain/runtime.CallerAt removed on master
std.Realm chain/runtime.Realm
std.Banker chain/banker.Banker
std.NewBanker chain/banker.NewBanker
std.BankerType chain/banker.BankerType
std.OriginSend chain/banker.OriginSend
std.BankerTypeReadonly chain/banker.BankerTypeReadonly
std.BankerTypeOriginSend chain/banker.BankerTypeOriginSend
std.BankerTypeRealmSend chain/banker.BankerTypeRealmSend
std.BankerTypeRealmIssue chain/banker.BankerTypeRealmIssue
std.SetParamBool chain/params.SetBool
std.SetParamBytes chain/params.SetBytes
std.SetParamInt64 chain/params.SetInt64
std.SetParamString chain/params.SetString
std.SetParamStrings chain/params.SetStrings
std.SetParamUint64 chain/params.SetUint64
Moved from previous iterations
chain.Address address
chain.DerivePkgAddr chain.PackageAddress
chain.DerivePkgAddress chain.PackageAddress
chain/runtime.NewUserRealm testing.NewUserRealm moved to testing package
chain/runtime.NewCodeRealm testing.NewCodeRealm moved to testing package
chain/runtime.CoinDenom chain.CoinDenom promoted to chain package
chain/banker.Coin chain.Coin promoted to chain package
chain/banker.Coins chain.Coins promoted to chain package
chain/banker.NewCoin chain.NewCoin promoted to chain package
chain/banker.NewCoins chain.NewCoins promoted to chain package

There are some additional changes that are not "direct translations":

  • The testing package has been moved entirely into the testing stdlibs. I don't recall the exact reason for it, but I think it simplified something else in the split, and is something we should do anyway as part of Removing unstable stdlibs + review of diff from latest go version #3775
  • stdlibs now don't overlap now with testing stdlibs. Internally, chain/runtime still does, but it exposes no additional functions.
  • I removed AddressSet as an API that can be very easily implemented in userland and which is not commonly used enough to justify its inclusion in chain.

Further things to do:

  • Removing Encode/DecodeBech32
  • Deciding what to do about DerivePkgAddr / Address: rename DerivePkgAddr to DerivePkgAddress, or Address to Addr?
  • Fix remaining gno test ./... issues.
  • Move to std.DerivePkgAddr to chain.PackageAddress
  • Moving Coin, Coins to chain as banker-independent types.
  • Move NewUserRealm / NewCodeRealm to testing.
  • Deciding where to move CoinDenom.
  • Approval from Jae / NT tech committee.

Let's use this PR to see the result of the split, and see what should be changed.

@thehowl thehowl self-assigned this Apr 2, 2025
@github-actions github-actions bot added 📦 🤖 gnovm Issues or PRs gnovm related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Apr 2, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Apr 2, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
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)

☑️ 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: thehowl/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this 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

@codecov
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Apr 10, 2025
@thehowl thehowl marked this pull request as ready for review April 10, 2025 11:23
@thehowl thehowl added the don't merge Please don't merge this functionality temporarily label Sep 24, 2025
@thehowl
Copy link
Member Author

thehowl commented Sep 24, 2025

@gfanton @dongwon8247, please also vote on the tech committee google group thread :)

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

And my axe!

@Kouteki
Copy link
Contributor

Kouteki commented Sep 24, 2025

image

@piux2 piux2 self-requested a review September 25, 2025 22:47
@thehowl thehowl removed the don't merge Please don't merge this functionality temporarily label Sep 29, 2025
@thehowl
Copy link
Member Author

thehowl commented Sep 29, 2025

NT Tech Committee approved unanimously.

Let's merge!

@thehowl thehowl merged commit 9229e17 into gnolang:master Sep 29, 2025
73 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in 💪 Bounties & Worx Sep 29, 2025
MikaelVallenet added a commit to MikaelVallenet/gno that referenced this pull request Oct 1, 2025
This pull request performs the std split as specified initially in
gnolang#1475, then gnolang#3874. Fixes gnolang#3874.

Use gnolang#4753 for a "files changed" tab that won't crash your browser

Most changes in `examples` are automated, and performed using `gno fix`
(gnolang#4100). `gno fix` is a tool developed to update old Gno code into new
one, so that this change and possible future changes are the least
disruptive to those working with Gno code.

Most of the changes can be boiled down to the following:

| original syntax | new syntax | notes |
| ------------------------------ |
--------------------------------------- |
---------------------------------- |
| ```std.Address``` | ```address``` | on master, it is just a type alias
|
| ```std.Emit``` | ```chain.Emit``` | |
| ```std.DerivePkgAddr``` | ```chain.PackageAddress``` | |
| ```std.Coin``` | ```chain.Coin``` | |
| ```std.Coins``` | ```chain.Coins``` | |
| ```std.NewCoin``` | ```chain.NewCoin``` | |
| ```std.NewCoins``` | ```chain.NewCoins``` | |
| ```std.CoinDenom``` | ```chain.CoinDenom``` | |
| ```std.RawAddressSize``` | ```20``` | constant removed |
| ```std.RawAddress``` | ```[20]byte``` | type removed |
| ```std.EncodeBech32``` | *removed* | manual conversion required |
| ```std.DecodeBech32``` | *removed* | manual conversion required |
| ```std.AssertOriginCall``` | ```chain/runtime.AssertOriginCall``` | |
| ```std.PreviousRealm``` | ```chain/runtime.PreviousRealm``` | |
| ```std.CurrentRealm``` | ```chain/runtime.CurrentRealm``` | |
| ```std.NewUserRealm``` | ```testing.NewUserRealm``` | moved to
```testing``` package |
| ```std.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved to
```testing``` package |
| ```std.OriginCaller``` | ```chain/runtime.OriginCaller``` | |
| ```std.ChainDomain``` | ```chain/runtime.ChainDomain``` | |
| ```std.ChainHeight``` | ```chain/runtime.ChainHeight``` | |
| ```std.ChainID``` | ```chain/runtime.ChainID``` | |
| ~~```std.CallerAt```~~ | ~~```chain/runtime.CallerAt```~~ | removed on
master |
| ```std.Realm``` | ```chain/runtime.Realm``` | |
| ```std.Banker``` | ```chain/banker.Banker``` | |
| ```std.NewBanker``` | ```chain/banker.NewBanker``` | |
| ```std.BankerType``` | ```chain/banker.BankerType``` | |
| ```std.OriginSend``` | ```chain/banker.OriginSend``` | |
| ```std.BankerTypeReadonly``` | ```chain/banker.BankerTypeReadonly``` |
|
| ```std.BankerTypeOriginSend``` |
```chain/banker.BankerTypeOriginSend``` | |
| ```std.BankerTypeRealmSend``` | ```chain/banker.BankerTypeRealmSend```
| |
| ```std.BankerTypeRealmIssue``` |
```chain/banker.BankerTypeRealmIssue``` | |
| ```std.SetParamBool``` | ```chain/params.SetBool``` | |
| ```std.SetParamBytes``` | ```chain/params.SetBytes``` | |
| ```std.SetParamInt64``` | ```chain/params.SetInt64``` | |
| ```std.SetParamString``` | ```chain/params.SetString``` | |
| ```std.SetParamStrings``` | ```chain/params.SetStrings``` | |
| ```std.SetParamUint64``` | ```chain/params.SetUint64``` | |
| **Moved from previous iterations** | | |
| ```chain.Address``` | ```address``` | |
| ```chain.DerivePkgAddr``` | ```chain.PackageAddress``` | |
| ```chain.DerivePkgAddress``` | ```chain.PackageAddress``` | |
| ```chain/runtime.NewUserRealm``` | ```testing.NewUserRealm``` | moved
to ```testing``` package |
| ```chain/runtime.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved
to ```testing``` package |
| ```chain/runtime.CoinDenom``` | ```chain.CoinDenom``` | promoted to
```chain``` package |
| ```chain/banker.Coin``` | ```chain.Coin``` | promoted to ```chain```
package |
| ```chain/banker.Coins``` | ```chain.Coins``` | promoted to ```chain```
package |
| ```chain/banker.NewCoin``` | ```chain.NewCoin``` | promoted to
```chain``` package |
| ```chain/banker.NewCoins``` | ```chain.NewCoins``` | promoted to
```chain``` package |

There are some additional changes that are not "direct translations":

- The `testing` package has been moved entirely into the testing
stdlibs. I don't recall the exact reason for it, but I think it
simplified something else in the split, and is something we should do
anyway as part of gnolang#3775
- stdlibs now don't overlap now with testing stdlibs. Internally,
chain/runtime still does, but it exposes no additional functions.
- I removed `AddressSet` as an API that can be very easily implemented
in userland and which is not commonly used enough to justify its
inclusion in `chain`.

Further things to do:

- [x] Removing Encode/DecodeBech32
- [x] Deciding what to do about DerivePkgAddr / Address: rename
DerivePkgAddr to DerivePkgAddress, or Address to Addr?
- [x] Fix remaining `gno test ./...` issues.
- [x] Move to `std.DerivePkgAddr` to `chain.PackageAddress`
- [x] Moving Coin, Coins to `chain` as banker-independent types.
- [x] Move NewUserRealm / NewCodeRealm to `testing`.
- [x] Deciding where to move `CoinDenom`. 
- [ ] Approval from Jae / NT tech committee. 

Let's use this PR to see the result of the split, and see what should be
changed.

---------

Co-authored-by: MikaelVallenet <[email protected]>
jefft0 added a commit to gnolang/gnonative that referenced this pull request Oct 3, 2025
The gno PR gnolang/gno#4040 reorganizes many
files causing breaking changes, including the following error from
Gnokey Mobile.
```
unable to unmarshal response bytes, amino: unrecognized concrete type full name tm.Event
```

This PR updates to the latest gno version. (The same version as the
updated tx-indexer.)

Signed-off-by: Jeff Thompson <[email protected]>
gfanton pushed a commit to gfanton/gno that referenced this pull request Oct 10, 2025
This pull request performs the std split as specified initially in
gnolang#1475, then gnolang#3874. Fixes gnolang#3874.

Use gnolang#4753 for a "files changed" tab that won't crash your browser

Most changes in `examples` are automated, and performed using `gno fix`
(gnolang#4100). `gno fix` is a tool developed to update old Gno code into new
one, so that this change and possible future changes are the least
disruptive to those working with Gno code.

Most of the changes can be boiled down to the following:

| original syntax | new syntax | notes |
| ------------------------------ |
--------------------------------------- |
---------------------------------- |
| ```std.Address``` | ```address``` | on master, it is just a type alias
|
| ```std.Emit``` | ```chain.Emit``` | |
| ```std.DerivePkgAddr``` | ```chain.PackageAddress``` | |
| ```std.Coin``` | ```chain.Coin``` | |
| ```std.Coins``` | ```chain.Coins``` | |
| ```std.NewCoin``` | ```chain.NewCoin``` | |
| ```std.NewCoins``` | ```chain.NewCoins``` | |
| ```std.CoinDenom``` | ```chain.CoinDenom``` | |
| ```std.RawAddressSize``` | ```20``` | constant removed |
| ```std.RawAddress``` | ```[20]byte``` | type removed |
| ```std.EncodeBech32``` | *removed* | manual conversion required |
| ```std.DecodeBech32``` | *removed* | manual conversion required |
| ```std.AssertOriginCall``` | ```chain/runtime.AssertOriginCall``` | |
| ```std.PreviousRealm``` | ```chain/runtime.PreviousRealm``` | |
| ```std.CurrentRealm``` | ```chain/runtime.CurrentRealm``` | |
| ```std.NewUserRealm``` | ```testing.NewUserRealm``` | moved to
```testing``` package |
| ```std.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved to
```testing``` package |
| ```std.OriginCaller``` | ```chain/runtime.OriginCaller``` | |
| ```std.ChainDomain``` | ```chain/runtime.ChainDomain``` | |
| ```std.ChainHeight``` | ```chain/runtime.ChainHeight``` | |
| ```std.ChainID``` | ```chain/runtime.ChainID``` | |
| ~~```std.CallerAt```~~ | ~~```chain/runtime.CallerAt```~~ | removed on
master |
| ```std.Realm``` | ```chain/runtime.Realm``` | |
| ```std.Banker``` | ```chain/banker.Banker``` | |
| ```std.NewBanker``` | ```chain/banker.NewBanker``` | |
| ```std.BankerType``` | ```chain/banker.BankerType``` | |
| ```std.OriginSend``` | ```chain/banker.OriginSend``` | |
| ```std.BankerTypeReadonly``` | ```chain/banker.BankerTypeReadonly``` |
|
| ```std.BankerTypeOriginSend``` |
```chain/banker.BankerTypeOriginSend``` | |
| ```std.BankerTypeRealmSend``` | ```chain/banker.BankerTypeRealmSend```
| |
| ```std.BankerTypeRealmIssue``` |
```chain/banker.BankerTypeRealmIssue``` | |
| ```std.SetParamBool``` | ```chain/params.SetBool``` | |
| ```std.SetParamBytes``` | ```chain/params.SetBytes``` | |
| ```std.SetParamInt64``` | ```chain/params.SetInt64``` | |
| ```std.SetParamString``` | ```chain/params.SetString``` | |
| ```std.SetParamStrings``` | ```chain/params.SetStrings``` | |
| ```std.SetParamUint64``` | ```chain/params.SetUint64``` | |
| **Moved from previous iterations** | | |
| ```chain.Address``` | ```address``` | |
| ```chain.DerivePkgAddr``` | ```chain.PackageAddress``` | |
| ```chain.DerivePkgAddress``` | ```chain.PackageAddress``` | |
| ```chain/runtime.NewUserRealm``` | ```testing.NewUserRealm``` | moved
to ```testing``` package |
| ```chain/runtime.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved
to ```testing``` package |
| ```chain/runtime.CoinDenom``` | ```chain.CoinDenom``` | promoted to
```chain``` package |
| ```chain/banker.Coin``` | ```chain.Coin``` | promoted to ```chain```
package |
| ```chain/banker.Coins``` | ```chain.Coins``` | promoted to ```chain```
package |
| ```chain/banker.NewCoin``` | ```chain.NewCoin``` | promoted to
```chain``` package |
| ```chain/banker.NewCoins``` | ```chain.NewCoins``` | promoted to
```chain``` package |

There are some additional changes that are not "direct translations":

- The `testing` package has been moved entirely into the testing
stdlibs. I don't recall the exact reason for it, but I think it
simplified something else in the split, and is something we should do
anyway as part of gnolang#3775
- stdlibs now don't overlap now with testing stdlibs. Internally,
chain/runtime still does, but it exposes no additional functions.
- I removed `AddressSet` as an API that can be very easily implemented
in userland and which is not commonly used enough to justify its
inclusion in `chain`.

Further things to do:

- [x] Removing Encode/DecodeBech32
- [x] Deciding what to do about DerivePkgAddr / Address: rename
DerivePkgAddr to DerivePkgAddress, or Address to Addr?
- [x] Fix remaining `gno test ./...` issues.
- [x] Move to `std.DerivePkgAddr` to `chain.PackageAddress`
- [x] Moving Coin, Coins to `chain` as banker-independent types.
- [x] Move NewUserRealm / NewCodeRealm to `testing`.
- [x] Deciding where to move `CoinDenom`. 
- [ ] Approval from Jae / NT tech committee. 

Let's use this PR to see the result of the split, and see what should be
changed.

---------

Co-authored-by: MikaelVallenet <[email protected]>
thehowl pushed a commit that referenced this pull request Nov 4, 2025
## Description

Fullly updates the docs to match #4040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 ci 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Split std into different packages