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

fix(gnovm): limit value string size #2570

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_4_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func main() {
// > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/3) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=3&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=2&postid=3)]
//
// > Second reply of the second post
// > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/4) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=4&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=2&postid=4)]
Copy link
Member

Choose a reason for hiding this comment

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

println should be special-cased if it's just printing a string directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean by special-cased?

Copy link
Member

@thehowl thehowl Jul 30, 2024

Choose a reason for hiding this comment

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

what I wrote afterwards in the review comment - it's kind of unexpected that println doesn't print what you want if the value is too long.

// > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/4) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=4&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&th...

// Realm:
// switchrealm["gno.land/r/demo/users"]
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/boards/z_5_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ func main() {
//
// > Second reply of the second post
// >
// > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/4) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=4&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=2&postid=4)]
// > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/4) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=4&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1...
6 changes: 1 addition & 5 deletions examples/gno.land/r/demo/boards/z_6_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,4 @@ func main() {
// >
// > > First reply of the first reply
// > >
// > > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/5) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=5&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=2&postid=5)]
//
// > Second reply of the second post
// >
// > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/4) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=4&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=2&postid=4)]
// > > \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm (UTC)](/r/demo/boards:test_board/2/5) \[[reply](/r/demo/boards?help&__func=CreateReply&bid=1&threadid=2&postid=5&body.type=textarea)] \[[x](/r/demo/boards?help&__func=DeletePos...
166 changes: 1 addition & 165 deletions examples/gno.land/r/gnoland/home/home_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -32,168 +32,4 @@ func main() {
// - [Events](/events)
// - Tokenomics (soon)
// - [Partners, Fund, Grants](/partners)
// - [Explore the Ecosystem](/ecosystem)
// - [Careers](https://jobs.lever.co/allinbits?department=Gno.land)
//
// </div><!-- end column-->
//
// <div class="column">
//
// ### Build with Gno
//
// - [Write Gno in the browser](https://play.gno.land)
// - [Read about the Gno Language](/gnolang)
// - [Visit the official documentation](https://docs.gno.land)
// - [Gno by Example](https://gno-by-example.com/)
// - [Efficient local development for Gno](https://docs.gno.land/gno-tooling/cli/gno-tooling-gnodev)
// - [Get testnet GNOTs](https://faucet.gno.land)
//
// </div><!-- end column-->
// <div class="column">
//
// ### Explore the universe
//
// - [Discover demo packages](https://github.com/gnolang/gno/tree/master/examples)
// - [Gnoscan](https://gnoscan.io)
// - [Portal Loop](https://docs.gno.land/concepts/portal-loop)
// - [Testnet 4](https://test4.gno.land/) (Launched July 2024!)
// - [Testnet 3](https://test3.gno.land/) (archive)
// - [Testnet 2](https://test2.gno.land/) (archive)
// - Testnet Faucet Hub (soon)
//
// </div><!-- end column-->
// </div><!-- end columns-3-->
// </div><!-- /jumbotron -->
//
// <div class="columns-3">
// <div class="column">
//
// ### [Latest Blogposts](/r/gnoland/blog)
//
// No posts.
// </div><!-- /column-->
// <div class="column">
//
// ### [Latest Events](/r/gnoland/events)
//
// No events.
// </div><!-- /column-->
// <div class="column">
//
// ### Latest Contributions
//
// [View latest contributions](https://github.com/gnolang/gno/pulls)
// </div><!-- /column-->
// </div><!-- /columns-3 -->
//
//
// ---
//
// ### [Gno Playground](https://play.gno.land)
//
//
// Gno Playground is a web application designed for building, running, testing, and interacting
// with your Gno code, enhancing your understanding of the Gno language. With Gno Playground, you can share your code,
// execute tests, deploy your realms and packages to gno.land, and explore a multitude of other features.
//
//
// Experience the convenience of code sharing and rapid experimentation with [Gno Playground](https://play.gno.land).
//
//
// ---
//
// ### Explore New Packages and Realms
//
// <div class="columns-3">
// <div class="column">
//
// #### [r/gnoland](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/gnoland)
//
// - [r/gnoland/blog](r/gnoland/blog)
// - [r/gnoland/dao](r/gnoland/dao)
// - [r/gnoland/faucet](r/gnoland/faucet)
// - [r/gnoland/home](r/gnoland/home)
// - [r/gnoland/pages](r/gnoland/pages)
//
// #### [r/sys](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/sys)
//
// - [r/sys/names](r/sys/names)
// - [r/sys/rewards](r/sys/rewards)
// - [r/sys/validators](r/sys/validators)
//
// </div><!-- /column-->
// <div class="column">
//
// #### [r/demo](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/demo)
//
// - [r/demo/boards](r/demo/boards)
// - [r/demo/users](r/demo/users)
// - [r/demo/banktest](r/demo/banktest)
// - [r/demo/foo20](r/demo/foo20)
// - [r/demo/foo721](r/demo/foo721)
// - [r/demo/microblog](r/demo/microblog)
// - [r/demo/nft](r/demo/nft)
// - [r/demo/types](r/demo/types)
// - [r/demo/art/gnoface](r/demo/art/gnoface)
// - [r/demo/art/millipede](r/demo/art/millipede)
// - [r/demo/groups](r/demo/groups)
// - ...
//
// </div><!-- /column-->
// <div class="column">
//
// #### [p/demo](https://github.com/gnolang/gno/tree/master/examples/gno.land/p/demo)
//
// - [p/demo/avl](p/demo/avl)
// - [p/demo/blog](p/demo/blog)
// - [p/demo/ui](p/demo/ui)
// - [p/demo/ufmt](p/demo/ufmt)
// - [p/demo/merkle](p/demo/merkle)
// - [p/demo/bf](p/demo/bf)
// - [p/demo/flow](p/demo/flow)
// - [p/demo/gnode](p/demo/gnode)
// - [p/demo/grc/grc20](p/demo/grc/grc20)
// - [p/demo/grc/grc721](p/demo/grc/grc721)
// - ...
//
// </div><!-- /column-->
// </div><!-- /columns-3 -->
//
//
// ---
//
// ### Contributions (WorxDAO & GoR)
//
// coming soon
//
// ---
//
//
// <div class="columns-2">
// <div class="column">
//
// ### Socials
//
// - Check out our [community projects](https://github.com/gnolang/awesome-gno)
// - ![Discord](static/img/ico-discord.svg) [Discord](https://discord.gg/S8nKUqwkPn)
// - ![Twitter](static/img/ico-twitter.svg) [Twitter](https://twitter.com/_gnoland)
// - ![Youtube](static/img/ico-youtube.svg) [Youtube](https://www.youtube.com/@_gnoland)
// - ![Telegram](static/img/ico-telegram.svg) [Telegram](https://t.me/gnoland)
//
// </div><!-- /column-->
// <div class="column">
//
// ### Quote of the ~Day~ Block#123
//
// > Now, you Gno.
//
// </div><!-- /column-->
// </div><!-- /columns-2 -->
//
//
// ---
//
// **This is a testnet.**
// Package names are not guaranteed to be available for production.
//
// </main>
// - [Explore the Ecosystem](/ecosystem)...
2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

type Value interface {
assertValue()
String() string // for debugging
fmt.Stringer
}

// Fixed size primitive types are represented in TypedValue.N
Expand Down
Loading
Loading