Giter Site home page Giter Site logo

gnolang / gno Goto Github PK

View Code? Open in Web Editor NEW
824.0 73.0 329.0 39.21 MB

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

Home Page: https://gno.land/

License: Other

Makefile 0.37% Go 88.00% Shell 0.12% C 8.64% M4 0.34% Sage 0.39% Assembly 0.37% Java 0.39% Dockerfile 0.04% CSS 0.32% JavaScript 0.72% HTML 0.23% Perl 0.03% GAP 0.02% AMPL 0.01%
gno gnoland gnolang bft blockchain cosmos smart-contracts tendermint golang tendermint2

gno's Introduction

Gno

At first, there was Bitcoin, out of entropy soup of the greater All. Then, there was Ethereum, which was created in the likeness of Bitcoin, but made Turing complete.

Among these were Tendermint and Cosmos to engineer robust PoS and IBC. Then came Gno upon Cosmos and there spring forth Gnoland, simulated by the Gnomes of the Greater Resistance.

Gno is an interpreted and fully-deterministic implementation of the Go programming language, designed to build succinct and composable smart contracts. The first blockchain to use it is Gno.land, a Proof of Contribution-based chain, backed by a variation of the Tendermint consensus engine.

Getting started

If you haven't already, take a moment to check out our website.

The website is a deployment of our gnoweb frontend; you can use it to check out some example contracts.

Use the [source] button in the header to inspect the program's source; use the [help] button to view how you can use gnokey to interact with the chain from your command line.

If you have already played around with the website, use our Getting Started guide to learn how to write and deploy your first smart contract. No local set-up required!

Once you're done, learn how to set up your local environment with the quickstart guide and the contributing guide.

You can discover additional details about current tools and Gno documentation on our official documentation. Additionally, the awesome-gno repository offers more resources to dig into. We are eager to see your first PR!

Gno Playground

play.gno.land

Gno Playground, available at play.gno.land, is a web app that allows users to write, share, and deploy Gno code. Developers can seamlessly test, debug, and deploy realms and packages on Gno.land, while being able to collaborate with peers to work on projects together and seek assistance. A key feature of Gno Playground is the ability to get started without the need to install any tools or manage any services, offering immediate access and convenience for users.

Repository structure

  • examples - Smart-contract examples and guides for new Gno developers.
  • gnovm - GnoVM and Gnolang.
  • gno.land - Gno.land blockchain and tools.
  • tm2 - Tendermint2.
  • docs - Official documentation, deployed under docs.gno.land.
  • contribs - Collection of enhanced tools for Gno.

Socials & Contact

  • Discord: good for general chat-based conversations, as well as for asking support on developing with Gno.
  • Reddit: more "permanent" and forum-style discussions. Feel free to post anything Gno-related, as well as any question related to Gno programming!
  • Telegram: unofficial Telegram group.
  • Twitter: official Twitter account. Follow us to know about new developments, events & official announcements about Gno!
  • YouTube: here we post all of our video content, like workshops, talks and public development calls. Follow along on our development journey!
Short doc about all the commands

User commands:

  • gnokey - key manipulation, also general interaction with gnoland
  • gnoland - runs the blockchain node
  • gnoweb - serves gno website, along with user-defined content

Developer commands:

  • gno - handy tool for developing gno packages & realms
  • goscan - dumps imports from specified file’s AST
  • genproto - helper for generating .proto implementations
  • gnofaucet - serves GNOT faucet
CI/CD/Tools badges and links

GitHub Actions:

  • gno.land
  • gnovm
  • tm2
  • examples
  • docker

Codecov:

  • General: codecov
  • tm2: codecov
  • gnovm: codecov
  • gno.land: codecov
  • examples: TODO

Go Report Card:

  • Go Report Card
  • tm2, gnovm, gno.land: TODO (blocked by tm2 split, because we need go mod workspaces)

Pkg.go.dev

  • Go Reference
    (pkg.go.dev will not show our repository as it has a license it doesn't recognise)

gno's People

Contributors

ajnavarro avatar albttx avatar alexiscolin avatar anarcher avatar deelawn avatar dependabot[bot] avatar faddat avatar gfanton avatar giansalex avatar grepsuzette avatar harry-hov avatar jaekwon avatar jefft0 avatar leohhhn avatar ltzmaxwell avatar maleklahbib avatar moul avatar mvertes avatar notjoon avatar petar-dambovaliev avatar peter7891 avatar piux2 avatar r3v4s avatar schollz avatar tbruyelle avatar thehowl avatar wall-e avatar waymobetta avatar yassinouider avatar zivkovicmilos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gno's Issues

Making `r/users` package `grc721` compliant

Currently, the realm package users associates a user profile to an address, it seems the associated address for a name can no longer be updated after registration.

Is there a specific motivation or idea behind this not being possible?

This issue is about implementing the grc721 interface to make a User tokenised and transferable, which would allow:

  • Updating address when transitioning to a new account
  • Giving away or selling the name or the benefit of the user profile

`grc20.Token` doesn't implement `IGRC20` interface

Maybe this part is under active development. grc20.Token in https://github.com/gnolang/gno/blob/master/examples/gno.land/p/grc/grc20/grc20.gno doesn't implement the IGRC20 as it seems the interface has been modified

I wanted to make a quick fix but I'm unsure of some changes like for Transfer(to std.Address, amount uint64), does the plan is to call GetCallerAt in Token implementation?

Some methods also return boolean for successful completion, wouldn't be better to use an error object?

Multiplatform build config

We may need a c cross compile setup when building for various platforms.

It should be possible to document this without much difficulty, especially for linux, so that someone working from a specific platform can build for any desired Target platform.

[gno] synchronous garbage collection

Currently the memory allocator doesn't account for any GC freed objects.
That is, objects like large strings or arrays each count against the allocation limit, even for temporary objects that get thrown away after the scope of the function call.

func SomeFunction() {
    x := ""
    for i:=0; i<100; i++ {
        x += "."
    }
}

For example, the above variable x returned is 100 bytes long, but all the prior subsequent strings were also accounted for, from x length 1, 2, 3, .. to length 100. Even though all prior x's become garbage collected, gno's memory management is not yet that smart.

This is a feature request issue to add some kind of synchronous garbage collection mechanism to free up GC'd memory. This could happen between realm function call boundaries, or it could happen with some special system function call. Or maybe this is best solved with function comment directives.


update

Garbage collection can be implemented synchronously upon memory alloc failure (before it returns failure) to scan all stack and block local variables to see what is still alive (and then decrement the total allocated number accordingly).

Two points:

  • If there is still not enough memory, there needs to be a second check where we panic out because GC couldn't save us.
  • GC itself should cost some meaningful deterministic gas amount.
  • Without GC cost, one can craft a program that ends up running GC on repeat, and can be very expensive.

`boards` app crashes on incorrect name

If we try to create a board with a name starting with a digit, we'll get a stacktrace.

I used the following commands to create a board:

./build/gnokey maketx call jubnzv --pkgpath "gno.land/r/boards" --func CreateBoard --args "2something" --gas-fee 1gnot --gas-wanted 2000000 > createboard.unsigned.txt
./build/gnokey sign jubnzv --txpath createboard.unsigned.txt --chainid "testchain" --number 645 --sequence 0 > createboard.signed.txt              
./build/gnokey broadcast createboard.signed.txt --remote gno.land:36657

Error output:

transaction failed &core_types.ResultBroadcastTxCommit{CheckTx:abci.ResponseCheckTx{ResponseBase:abci.ResponseBase{Error:abci.Error(nil), Data:[]uint8(nil), Events:[]abci.Event(nil), Log:"msg:0,success:true,log:,events:[]", Info:""}, GasWanted:2000000, GasUsed:24979}, DeliverTx:abci.ResponseDeliverTx{ResponseBase:abci.ResponseBase{Error:std.InternalError{abciError:std.abciError{}}, Data:[]uint8(nil), Events:[]abci.Event(nil), Log:"recovered: (\"invalid name: 2something\" string)\nstack:\ngoroutine 15 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1()\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:741 +0x2aa\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call.func1()\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:229 +0xc5\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno.(*Machine).doOpPanic2(0xc0044b0480)\n\t/home/user/website2/gno/op_call.go:405 +0xc9\ngithub.com/gnolang/gno.(*Machine).Run(0xc0044b0480)\n\t/home/user/website2/gno/machine.go:999 +0x5ae\ngithub.com/gnolang/gno.(*Machine).Eval(0xc0044b0480, {0xea1008, 0xc00615c240})\n\t/home/user/website2/gno/machine.go:573 +0x552\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:232 +0xbe5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.handleMsgCall({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:64 +0x2c5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Process({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:29 +0x238\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runMsgs(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:642 +0x42e\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx(0xc000208100, 0x2, {0xc00521a960, 0xed, _}, {{0xc002b54bd0, 0x1, 0x1}, {0x1e8480, {{0xc004793776, ...}, ...}}, ...})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:821 +0x905\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).DeliverTx(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:578 +0x167\ngithub.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).DeliverTxAsync(0xc003d19d40, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/abci/client/local_client.go:82 +0x103\ngithub.com/gnolang/gno/pkgs/bft/proxy.(*appConnConsensus).DeliverTxAsync(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/proxy/app_conn.go:73 +0x26\ngithub.com/gnolang/gno/pkgs/bft/state.execBlockOnProxyApp({0xe936b8, 0xc003d1ba40}, {0xe98cb0, 0xc003d2e730}, 0xc007ab0680, {0xea2680, 0xc0000102c0})\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:256 +0x8c2\ngithub.com/gnolang/gno/pkgs/bft/state.(*BlockExecutor).ApplyBlock(_, {{0xc5b291, 0xb}, {0xc5b291, 0xb}, {0x0, 0x0}, {0xc003d03ff0, 0x9}, 0x8112, ...}, ...)\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:104 +0x115\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).finalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1353 +0x97e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryFinalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1281 +0x305\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit.func1()\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1227 +0x8e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit(0xc003861200, 0x8113, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1258 +0xaaf\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).addVote(0xc003861200, 0xc00aad83c0, {0x0, 0x0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1646 +0x8ce\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryAddVote(0xc003861200, 0x4af2a6, {0x0, 0xc00b219bf0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1489 +0x27\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).handleMsg(0xc003861200, {{0xe7cca0, 0xc006c1c3f0}, {0x0, 0xeda172398}})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:695 +0x388\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).receiveRoutine(0xc003861200, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:654 +0x45f\ncreated by github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).OnStart\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:346 +0x4dd\n", Info:""}, GasWanted:2000000, GasUsed:620155}, Hash:[]uint8{0xc9, 0x70, 0x9e, 0xf1, 0xb6, 0x77, 0xb0, 0x53, 0x95, 0x4a, 0xf1, 0x8, 0xe7, 0x6e, 0xdc, 0xae, 0x93, 0xc8, 0xee, 0xcd, 0xe8, 0xc0, 0x7d, 0xa5, 0x39, 0x7a, 0x85, 0x2b, 0x49, 0x35, 0x8d, 0xca}, Height:33043}
log recovered: ("invalid name: 2something" string)
stack:
goroutine 15 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1()
	/home/user/website2/gno/pkgs/sdk/baseapp.go:741 +0x2aa
panic({0xc4ac60, 0xc0085ff5c0})
	/usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call.func1()
	/home/user/website2/gno/pkgs/sdk/vm/keeper.go:229 +0xc5
panic({0xc4ac60, 0xc0085ff5c0})
	/usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/gnolang/gno.(*Machine).doOpPanic2(0xc0044b0480)
	/home/user/website2/gno/op_call.go:405 +0xc9
github.com/gnolang/gno.(*Machine).Run(0xc0044b0480)
	/home/user/website2/gno/machine.go:999 +0x5ae
github.com/gnolang/gno.(*Machine).Eval(0xc0044b0480, {0xea1008, 0xc00615c240})
	/home/user/website2/gno/machine.go:573 +0x552
github.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
	/home/user/website2/gno/pkgs/sdk/vm/keeper.go:232 +0xbe5
github.com/gnolang/gno/pkgs/sdk/vm.vmHandler.handleMsgCall({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
	/home/user/website2/gno/pkgs/sdk/vm/handler.go:64 +0x2c5
github.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Process({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
	/home/user/website2/gno/pkgs/sdk/vm/handler.go:29 +0x238
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runMsgs(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
	/home/user/website2/gno/pkgs/sdk/baseapp.go:642 +0x42e
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx(0xc000208100, 0x2, {0xc00521a960, 0xed, _}, {{0xc002b54bd0, 0x1, 0x1}, {0x1e8480, {{0xc004793776, ...}, ...}}, ...})
	/home/user/website2/gno/pkgs/sdk/baseapp.go:821 +0x905
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).DeliverTx(0x0, {{}, {0xc00521a960, 0x0, 0x0}})
	/home/user/website2/gno/pkgs/sdk/baseapp.go:578 +0x167
github.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).DeliverTxAsync(0xc003d19d40, {{}, {0xc00521a960, 0x0, 0x0}})
	/home/user/website2/gno/pkgs/bft/abci/client/local_client.go:82 +0x103
github.com/gnolang/gno/pkgs/bft/proxy.(*appConnConsensus).DeliverTxAsync(0x0, {{}, {0xc00521a960, 0x0, 0x0}})
	/home/user/website2/gno/pkgs/bft/proxy/app_conn.go:73 +0x26
github.com/gnolang/gno/pkgs/bft/state.execBlockOnProxyApp({0xe936b8, 0xc003d1ba40}, {0xe98cb0, 0xc003d2e730}, 0xc007ab0680, {0xea2680, 0xc0000102c0})
	/home/user/website2/gno/pkgs/bft/state/execution.go:256 +0x8c2
github.com/gnolang/gno/pkgs/bft/state.(*BlockExecutor).ApplyBlock(_, {{0xc5b291, 0xb}, {0xc5b291, 0xb}, {0x0, 0x0}, {0xc003d03ff0, 0x9}, 0x8112, ...}, ...)
	/home/user/website2/gno/pkgs/bft/state/execution.go:104 +0x115
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).finalizeCommit(0xc003861200, 0x8113)
	/home/user/website2/gno/pkgs/bft/consensus/state.go:1353 +0x97e
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryFinalizeCommit(0xc003861200, 0x8113)
	/home/user/website2/gno/pkgs/bft/consensus/state.go:1281 +0x305
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit.func1()
	/home/user/website2/gno/pkgs/bft/consensus/state.go:1227 +0x8e
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit(0xc003861200, 0x8113, 0x0)
	/home/user/website2/gno/pkgs/bft/consensus/state.go:1258 +0xaaf
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).addVote(0xc003861200, 0xc00aad83c0, {0x0, 0x0})
	/home/user/website2/gno/pkgs/bft/consensus/state.go:1646 +0x8ce
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryAddVote(0xc003861200, 0x4af2a6, {0x0, 0xc00b219bf0})
	/home/user/website2/gno/pkgs/bft/consensus/state.go:1489 +0x27
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).handleMsg(0xc003861200, {{0xe7cca0, 0xc006c1c3f0}, {0x0, 0xeda172398}})
	/home/user/website2/gno/pkgs/bft/consensus/state.go:695 +0x388
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).receiveRoutine(0xc003861200, 0x0)
	/home/user/website2/gno/pkgs/bft/consensus/state.go:654 +0x45f
created by github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).OnStart
	/home/user/website2/gno/pkgs/bft/consensus/state.go:346 +0x4dd

--= Error =--
Data: errors.FmtError{format:"transaction failed %#v\nlog %s", args:[]interface {}{(*core_types.ResultBroadcastTxCommit)(0xc0000f0500), "recovered: (\"invalid name: 2something\" string)\nstack:\ngoroutine 15 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1()\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:741 +0x2aa\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call.func1()\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:229 +0xc5\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno.(*Machine).doOpPanic2(0xc0044b0480)\n\t/home/user/website2/gno/op_call.go:405 +0xc9\ngithub.com/gnolang/gno.(*Machine).Run(0xc0044b0480)\n\t/home/user/website2/gno/machine.go:999 +0x5ae\ngithub.com/gnolang/gno.(*Machine).Eval(0xc0044b0480, {0xea1008, 0xc00615c240})\n\t/home/user/website2/gno/machine.go:573 +0x552\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:232 +0xbe5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.handleMsgCall({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:64 +0x2c5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Process({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:29 +0x238\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runMsgs(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:642 +0x42e\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx(0xc000208100, 0x2, {0xc00521a960, 0xed, _}, {{0xc002b54bd0, 0x1, 0x1}, {0x1e8480, {{0xc004793776, ...}, ...}}, ...})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:821 +0x905\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).DeliverTx(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:578 +0x167\ngithub.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).DeliverTxAsync(0xc003d19d40, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/abci/client/local_client.go:82 +0x103\ngithub.com/gnolang/gno/pkgs/bft/proxy.(*appConnConsensus).DeliverTxAsync(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/proxy/app_conn.go:73 +0x26\ngithub.com/gnolang/gno/pkgs/bft/state.execBlockOnProxyApp({0xe936b8, 0xc003d1ba40}, {0xe98cb0, 0xc003d2e730}, 0xc007ab0680, {0xea2680, 0xc0000102c0})\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:256 +0x8c2\ngithub.com/gnolang/gno/pkgs/bft/state.(*BlockExecutor).ApplyBlock(_, {{0xc5b291, 0xb}, {0xc5b291, 0xb}, {0x0, 0x0}, {0xc003d03ff0, 0x9}, 0x8112, ...}, ...)\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:104 +0x115\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).finalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1353 +0x97e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryFinalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1281 +0x305\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit.func1()\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1227 +0x8e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit(0xc003861200, 0x8113, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1258 +0xaaf\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).addVote(0xc003861200, 0xc00aad83c0, {0x0, 0x0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1646 +0x8ce\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryAddVote(0xc003861200, 0x4af2a6, {0x0, 0xc00b219bf0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1489 +0x27\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).handleMsg(0xc003861200, {{0xe7cca0, 0xc006c1c3f0}, {0x0, 0xeda172398}})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:695 +0x388\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).receiveRoutine(0xc003861200, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:654 +0x45f\ncreated by github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).OnStart\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:346 +0x4dd\n"}}
Msg Traces:
--= /Error =--

Map package variable breaks the contract execution without exception

package maptest

var m = make(map[string]string)

func Deposit() string{
  m["0xABC"] = "10ugnot"
  return "Deposited"
}

The maptest contract does not return anything when Deposit() is called a second time. The contract seems to have stopped executing before the return but no panic or exception.

gnokey add can't add pubkeys

i think it might be failing due to a bech32 decoding error.
it could be that the prefix is set to "g" and length assumed to be shorter than a "gpub" prefixed bech32 pubkey.
i suppose we should check the prefix and then check the length accordingly, in some places.

docs: upgrade recommended CLI version

In some tutorials, the recommended version of CLI is 0.22, which is linked to the old org ignite-hq. This complicates the upgrade for the user, and in addition there's probably no good reason to recommend this version.

Check if the related tutorials are still doable with the latest version of CLI, if yes update the version recommendation to the latest.

Cosmos governance scrape for ION airdrop

https://twitter.com/sunnya97/status/1415377340507508738?s=20

Will this work? It's using Figment.io Datahub's Cosmos LCD/REST (Archive) service to determine if the address was the proposer, a depositor, and voter info for proposals 1-37 on cosmos.

I haven't run it for the full ions.json as that will take ~1.8M (3x37x16,462) calls I think and I'm only on the free tier.

I did include a couple sample runs. One using the address of the proposer for proposal 1 and another for the top 3 ION receiving addresses...interestingly they all had zero cosmos gov participation based on my results.

https://github.com/Nostradamus411/unclaimed-ions/blob/main/cosmo_gov.py

Serve faucet via a reverse proxy.

Low priority

I noticed the faucet is exposed directly by Go on port 5050. Would it make sense to serve it behind a reverse proxy on port 80 and just add Cloudflare's SSL to it instead of managing certificates with let's encrypt? If yes, I can provide some commands to setup this quickly.

gnoview is not compiling

cd cmd/gnoview 
go build
# github.com/gnolang/gno/cmd/gnoview
./main.go:31:3: unknown field 'Package' in struct literal of type gno.MachineOptions
./main.go:33:3: unknown field 'Importer' in struct literal of type gno.MachineOptions
./main.go:161:24: undefined: gno.Realmer
./main.go:163:6: rlm.SetLogRealmOps undefined (type *gno.Realm has no field or method SetLogRealmOps)
./main.go:164:13: undefined: gno.Realmer
./main.go:173:38: undefined: gno.Importer
./main.go:188:26: too many arguments in call to pkg.NewPackage
        have (nil)
        want ()
./main.go:193:26: too many arguments in call to pkg.NewPackage
        have (nil)
        want ()
./value_elem.go:110:26: cv.Values undefined (type *gno.PackageValue has no field or method Values)
./value_elem.go:111:14: cv.Values undefined (type *gno.PackageValue has no field or method Values)
./value_elem.go:111:14: too many errors

I think it is either need to fix it or document it

Documentation

So currently as far as I can see, the documentation is mainly in the readme file and scattered elsewhere.
People initially are hit with the readme, but might want to see the other areas of the project.
So it might be better to split the documentation into specific modules.

How about set up docs.gnolang.com as the documentation site and also put the bulk of the current documentation there.
You could use gitbook (I've used it before and it seems good, and free to use for opensource projects like this)

Let me know if I can help!

Test and document floating point determinsm

#306 introduced floating point and decimals, but it isn't clear if it actually is deterministic across go versions and architectures. This Issue should remain open until genesis, to ensure that the genesis validators can stay in sync.

GOR phase 2 — Various Topics

Depends on #407

Gnolang smart contracts

  • DAO/MODULES
  • SOCIAL/TWITTER
  • SOCIAL/BOARDS
  • SOCIAL/LINKEDIN
  • SOCIAL/OTHER
  • DEFI/AMM
  • DEFI/ORDERBOOK
  • DEFI/STABLE
  • GNO/VM
  • TENDERMINT/*
  • LIB/DATA-STRUCTURES
  • LIB/GRC*
  • GAMING/* (#611)

Optimization battles

  • PERF/PROGRAMMING-GAME

Documents

  • CONSTITUTION/ATOM
  • CONSTITUTION/GNOSH
  • CONSTITUTION/GNOT
  • WHITEPAPER/ECONOMICS
  • WHITEPAPER/GNO/VM
  • WHITEPAPER/DAO
  • WHITEPAPER/CONTENT_MODERATION

Misc

  • DESIGN/LOGO

TODO to embellish and to add more.

wal

The write ahead log does some thrashing, and I'm curious if we can live without it.

for example, we could do the same thing in RAM, most devices have a ton of it these days, even mobiles.

the WAL seems quite tightly coupled with consensus. @jaekwon you reckon that it is possible to safely do consensus without the WAL? I feel like it actually is not the best thing. May make more sense to just ensure that there's a second fully-synced machine at the ready, than deal with all of the disk thrashing that the WAL causes.

End-state, we'd end up with something that runs more quickly, in more places.

Panic call payment must not be less than 200000000\" string when using quotation marks

I had someone on Discord with constant errors, trying to make a username.
He had 7436004650ugnot

First he tried
./build/gnokey maketx call g1a8a2pxj6jkvkqtph745g3mct2uwnynajxgyaet --pkgpath "gno.land/r/users" --func "Register" --gas-fee 1000000ugnot --gas-wanted 2000000 --send "" --broadcast true --chainid "test2" --args "" --args "CARPEDIEMWORLD" --args "CARPEDIEMWORLD" --remote "test2.gno.land:36657"
Got error
payment must not be less than 200000000"}}\nMsg Traces:\n--= /Error =--\n,events:[]"}}

His next try was
./build/gnokey maketx call g1a8a2pxj6jkvkqtph745g3mct2uwnynajxgyaet --pkgpath "gno.land/r/users" --func "Register" --gas-fee 1000000ugnot --gas-wanted 2000000 --send "200000000ugnot" --broadcast true --chainid "test2" --args "" --args "CARPEDIEMWORLD" --args "CARPEDIEMWORLD" --remote "test2.gno.land:36657"
Got error
transaction failed &core_types.ResultBroadcastTxCommit{CheckTx:abci.ResponseCheckTx{ResponseBase:abci.ResponseBase{Error:std.InvalidGasWantedError{abciError:std.abciError{}}, Data:[]uint8(nil), Events:[]abci.Event(nil), Log:"--= Error =--\nData: std.InvalidGasWantedError{abciError:std.abciError{}}\nMsg Traces:\n 0 /opt/build/pkgs/std/errors.go:102 - invalid gas-wanted; got: 200000000 block-max-gas: 10000000\nStack Trace:\n 0 /opt/build/pkgs/errors/errors.go:20\n 1 /opt/build/pkgs/std/errors.go:102\n

First option I gave him was
./build/gnokey maketx call ADDRESS --pkgpath "gno.land/r/users" --func "Register" --gas-fee 1000000ugnot --gas-wanted 2000000 --send "2000000ugnot" --args "" --args "NAME" --args "" > unsigned.tx (NAME in lower case)

./build/gnokey sign ADRRESS --txpath unsigned.tx --chainid test2 --number ACCOUNT --sequence NUMBER > signed.tx
./build/gnokey broadcast signed.tx --remote "test2.gno.land:36657"

He got error
tException:\n\t (\"payment must not be less than 200000000\" string)\n\t payment must not be less than 200000000"}}\nMsg Traces:\n--= /Error =--\n,events:[]"}}

I than asked for screenshot
screenshot-errors
I remember people had problems before when using quotation marks but they gave different errors.
I told him to try

./build/gnokey maketx call g1a8a2pxj6jkvkqtph745g3mct2uwnynajxgyaet --pkgpath "gno.land/r/users" --func "Register" --gas-fee 2000000ugnot --gas-wanted 2000000 --send 200000000ugnot --broadcast true --chainid test2 --args "" --args "carpediemworld" --args "" --remote test2.gno.land:36657

And it worked
screenshot-final-result

I don't know if this might give problems in the future but I want to let you know.


I don't know if it's been reported yet but there's also problems when

--gas-fee 1gnot is used, it needs to be --gas-fee 1000000ugnot or people get a insufficient funds to pay for fees; 2100000000ugnot < 1gnot error, or whatever they have, on any realm being called.

Discord link is broken

It seems that the Discord link in README.md is expired:

image

So, there are many newcomers who ask for the invitation in the telegram chat.

Could someone with admin access to discord renew the link please?

No linters are enabled

Hi!

I would suggest to enable some linters on this repo. For example by using golangci-lint.

It will help to catch some bugs early and keep code quality at good level.

This is a short list of potential bugs found by staticcheck linter:
image

bech32 lower vs UPPER distinction

Since we use the bech32 address in std, we need to add validation regarding capitalization, else unexpected bugs will occur.
Another solution is to forgo bech32 and use a different string representation... This is about whether gno.land std packages prefer to include the prefix and deal with malleability, or prefer to strip the prefix but use an efficient representation with string kind.

It is not safe to generate random number with a simple entropy on chain.

https://github.com/gnolang/gno/blob/master/examples/gno.land/p/rand/rand.gno
I think we should not include a random number generator in the package until we have a proper solution.

Blockchain is determinstic. Generating a random number with an entropy is not safe, because all nodes need to have the same entropy and it becomes public information.

To use random numbers in smart contracts, we need to use the random numbers generated through VRF (Verifiable Random Function) from an off-chain oracle, which potentially could be a good feature provided by the cosmos hub or a dedicated oracle zone.

gnoland doesn't start

to start local test-net, cd ~/gno; ./build/gnoland used to work with previous commit.

but with current master branch, gnoland won't start due to error shown below.

ERROR LOG: recovered: gno.land/r/foo20/foo.gno:1: unknown import path gno.land/r/users
# 6 {"msg":[{"@type":"/vm.m_addpkg","creator":"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5","package":{"Name":"foo20","Path":"gno.land/r/foo20","Files":[{"Name":"foo.gno","Body":"package foo20\n\nimport (\n\t\"std\"\n\t\"strings\"\n\n\tgrc20 \"gno.land/p/grc/grc20/impl\"\n\t\"gno.land/p/ufmt\"\n\t\"gno.land/r/users\"\n)\n\nvar foo *grc20.Token\nvar admin std.Address = \"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj\" // TODO: helper to change admin\n\nfunc init() {\n\tfoo = grc20.NewToken(\"Foo\", \"FOO\", 4)\n\tfoo.Mint(admin, 1000000*10000)                                    // @administrator (1M)\n\tfoo.Mint(\"g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq\", 10000*10000) // @manfred (10k)\n}\n\n// method proxies as public functions.\n//\n\n// getters.\n\nfunc TotalSupply() uint64 {\n\treturn foo.TotalSupply()\n}\n\nfunc BalanceOf(owner users.AddressOrName) uint64 {\n\treturn foo.BalanceOf(owner.Resolve())\n}\n\nfunc Allowance(owner, spender users.AddressOrName) uint64 {\n\treturn foo.Allowance(owner.Resolve(), spender.Resolve())\n}\n\n// setters.\n\nfunc Transfer(to users.AddressOrName, amount uint64) {\n\tcaller := std.GetCallerAt(2)\n\tfoo.Transfer(caller, to.Resolve(), amount)\n}\n\nfunc Approve(spender users.AddressOrName, amount uint64) {\n\tcaller := std.GetCallerAt(2)\n\tfoo.Approve(caller, spender.Resolve(), amount)\n}\n\nfunc TransferFrom(from, to users.AddressOrName, amount uint64) {\n\tcaller := std.GetCallerAt(2)\n\tfoo.TransferFrom(caller, from.Resolve(), to.Resolve(), amount)\n}\n\n// administration.\n\nfunc Mint(address users.AddressOrName, amount uint64) {\n\tcaller := std.GetCallerAt(2)\n\tassertIsAdmin(caller)\n\tfoo.Mint(address.Resolve(), amount)\n}\n\nfunc Burn(address users.AddressOrName, amount uint64) {\n\tcaller := std.GetCallerAt(2)\n\tassertIsAdmin(caller)\n\tfoo.Burn(address.Resolve(), amount)\n}\n\n// render.\n//\n\nfunc Render(path string) string {\n\tparts := strings.Split(path, \"/\")\n\tc := len(parts)\n\n\tswitch {\n\tcase path == \"\":\n\t\treturn foo.RenderHome()\n\tcase c == 2 \u0026\u0026 parts[0] == \"balance\":\n\t\towner := users.AddressOrName(parts[1])\n\t\tbalance := foo.BalanceOf(owner.Resolve())\n\t\treturn ufmt.Sprintf(\"%d\\n\", balance)\n\tdefault:\n\t\treturn \"404\\n\"\n\t}\n}\n\nfunc assertIsAdmin(address std.Address) {\n\tif address != admin {\n\t\tpanic(\"restricted access\")\n\t}\n}\n"}]},"deposit":""}],"fee":{"gas_wanted":"50000","gas_fee":"1gnot"},"signatures":[{"pub_key":null,"signature":null}],"memo":""}
panic: internal error

[tendermint2] re-implement tx indexing

The tx indexing and query system was removed to attempt a more modular and minimal implementation.

The goal I have in mind is to simply log to file all EventSwitch events (serialized using amino:binary, using protobuf for speed), and then to make readers that can idempotent-ly index or filter these events for whatever purpose, including tx indexing, but also streaming of filtered events (from the RPC using websockets, say). These streaming readers would be independent processes from the full node, so there would be possibly no resource contention depending on the configuration. Since log files could be read by any process, the node wouldn't even have to know who are the listeners are.

We could possibly use an existing persistent pubsub system to implement this, but if we're going to use such an external dependency, it needs to be implemented in Go, be minimal and simple, and mature. Alternatively we should implement one from scratch if a suitable implementation cannot be found.

The log file could use pkgs/autofile, or a fork that doesn't automatically delete older chunk files, and we could leave it up to the user to run a background service that deletes older chunk files as needed.

I'm open to alternative solutions, but this seems to be the most conceptually simple solution. Compared to Tendermint1, instead of an asynchronous pubsub, Tendermint2 has the original synchronous simple event switch. Tendermint1 bakes in several pubsub listeners, but Tendermint2 would be more minimal and simply log all events to the filesystem.

Vietnam

As promised, a toolkit for relocating to Vietnam, should the US prove to be a bit too stimulating.

I have set this up so that you should be able to do it with or without my assistance, and I'm making it available because of the dramatic effect that a year's time in Vietnam's Zerocovid environment has had on me and my work.

Nancy Bui Is a trained attorney with experience helping foreigners relocate to Vietnam. Packages for investment visas begin at ~$10-$20k USD. She is also a very nice person, and highly responsive. She can help you to set up more or less whatever you might need.

Current situation:

  • Flight & 3-week quarantine running $3-5k
  • Investors and highly skilled workers only
  • New-build housing renting below mortgage cost
  • Very, very little COVID compared to other locales due to government policy
  • Open hardware hub slowly grinding into reality in partnership with pcbviet.com
  • 99.9% uncensored internet

Anyone wanting to avail themselves of the calm, affordable, (mainly) covidless environment here, please do not hesitate to reply to this issue, but also know:

Nancy's all you'd really need, and her contact information is above.

Utility package to specify general function conditions

I'm opening this issue assuming this is not a planned feature. Maybe you already discussed privately about this.
 

Problem

 
With smart contracts, functions may have general conditions:

  • Read only, should not be called in a tx
  • Tx that expect gnot to be sent (payable)
  • Tx that doesn't expect gnot to be sent
  • Should not be called by other package, only by sender (external)
     
    Such conditions allow to prevent sending tx for action that doesn't perform any state change, prevent sending funds to a package where those would be locked forever, etc... and therefore having a conventional solution to represent these conditions may improve developer and user experience. A convention can simplify building clients with better UX (preventing calling render through a tx for example)
     
    Solidity includes function types in its own syntax as keywords to allow to set such conditions: payable, view, external, etc...
     
    AFAIK the philosophy is to keep Gno syntax as simple and as close to Go as possible and therefore such keywords can't be incorporated into the interpreter.
     

Proposed solution

 
I may see the method std.AssertOriginCall() that already exists and is apparent to an "external" condition.
 
Therefore, a solution could be to extend the assert available methods from the standard package. Or defining a new package for this purpose. For example, a standard package named "rules"
 

import (
  "rules"
)
 
func Foo() {
  rules.Payable() // panic if no send tokens
  rules.ReadOnly() / panic if called in a tx
 
  //...
}

 
But a procedural style to define these rules might be less adapted than a declarative style. Declarative style is more visual for listing a set of conditions and makes building a code parser easier, for a client for example.
 
So an even better solution IMO can be to define a method taking generic rules. For example, an Apply method
 

// check a condition
type Rule func()
 
// check all listed condition
func Apply(rules ...Rule) {
  for r range rules {
    r()
  }
}
 
var Payable Rule  = func() = { /*check send tokens not empty*/ }
var NonPayable Rule  = func() = { /*check send tokens empty*/ }

 
Conditions can be defined as following
 

import (
  "rules"
)
 
func Foo() {
  rules.Apply(
    rules.Payable,
    rules.NonPayable,
    rules.ReadOnly,
    rules.External,
    rules.PayableWith(["1000ugnot"]),
    rules.AdminOnly(["gxxx"]),
    //...
  )
 
  //...
}

 
This example simplifies implementing a generic client that parse the AST of the uploaded smart contract and shows in the UI the methods differently, prevent calling a ReadOnly method in a tx for example.

Doesn't check for return

Preprocessor doesn't check whether all code branch paths return in functions that have a return value.
This causes unexpected behavior during runtime, in my case I got:
interface conversion: gno.Stmt is nil, not *gno.AssignStmt.

TODO: make preprocessor ensure all branch paths return when necessary.
Alternatively, use the go compiler for type-checking.

Pro and Cons to be evaluated: Incompatible ABCI proto field number with current Tendermint ABCI

The RequestBase makes gno ABCI proto field number +1 than the existing proto filed number in tendermint

This could make the VM not compatible with the existing tendermint ABCI. However, it may not be a problem if gnoland runs as a standalone chain.

It might be an issue down the line to port the gno VM module to another tendermint chain.

Another impact could be the IBC integration, which is yet to be evaluated.

GNO

https://github.com/gnolang/gno/blob/master/pkgs/bft/abci/types/abci.proto#L51

message RequestBeginBlock {
	RequestBase RequestBase = 1;
	bytes Hash = 2;
	google.protobuf.Any Header = 3;
	LastCommitInfo LastCommitInfo = 4;
}

Tendermint

https://github.com/tendermint/tendermint/blob/main/proto/tendermint/abci/types.proto

message RequestBeginBlock {
  bytes                   hash                 = 1;
  tendermint.types.Header header               = 2 [(gogoproto.nullable) = false];
  CommitInfo              last_commit_info     = 3 [(gogoproto.nullable) = false];
  repeated Misbehavior    byzantine_validators = 4 [(gogoproto.nullable) = false];
}

https://github.com/tendermint/tendermint/blob/main/spec/abci/abci++_methods.md#beginblock

Deflap flappy tests

We introduced a system to manage flappy tests differently (see #201).

The goal of this PR is to be kept open while there is at least one flappy test in the codebase.

To get an up-to-date list of flappy tests, you can use the following command: git grep func\ TestFlappy

Crash when requesting for a missing file

To reproduce request a missing file in gnoland through web-interface: https://gno.land/r/boards/missing.txt:

RPC error -32603 - Internal error: runtime error: invalid memory address or nil pointer dereference

Meanwhile, the gnoland node reports a crash:

.level 2 .msg Panic in RPC HTTP handler [err runtime error: invalid memory address or nil pointer dereference stack goroutine 26 [running]:
runtime/debug.Stack()
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x65
github.com/gnolang/gno/pkgs/bft/rpc/lib/server.RecoverAndLogHandler.func1.1()
        /home/jubnzv/Dev/gno/pkgs/bft/rpc/lib/server/http_server.go:161 +0x18f
panic({0xb876a0, 0x1354380})
        /usr/lib/go/src/runtime/panic.go:838 +0x207
github.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).QueryFile(0xe9b120?, {{0xea6170, 0xc000040178}, 0x0, {0xea5e08, 0xc00412a520}, {0xea6368, 0xc007394580}, {0xc000330420, 0x9}, ...}, ...)
        /home/jubnzv/Dev/gno/pkgs/sdk/vm/keeper.go:412 +0xe8
github.com/gnolang/gno/pkgs/sdk/vm.vmHandler.queryFile({_}, {{0xea6170, 0xc000040178}, 0x0, {0xea5e08, 0xc00412a520}, {0xea6368, 0xc007394580}, {0xc000330420, 0x9}, ...}, ...)
        /home/jubnzv/Dev/gno/pkgs/sdk/vm/handler.go:187 +0xe6
github.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Query({_}, {{0xea6170, 0xc000040178}, 0x0, {0xea5e08, 0xc00412a520}, {0xea6368, 0xc007394580}, {0xc000330420, 0x9}, ...}, ...)
        /home/jubnzv/Dev/gno/pkgs/sdk/vm/handler.go:106 +0x219
github.com/gnolang/gno/pkgs/sdk.handleQueryCustom(0xc0000fe000, {0xc0068f0220, 0x0?, _}, {{}, {0xc007086080, 0x1d, 0x1e}, {0xc006f4e298, 0x8}, ...})
        /home/jubnzv/Dev/gno/pkgs/sdk/baseapp.go:494 +0x518
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).Query(0xc003a70410?, {{}, {0xc007086080, 0x1d, 0x1e}, {0xc006f4e298, 0x8}, 0x0, 0x0})
        /home/jubnzv/Dev/gno/pkgs/sdk/baseapp.go:392 +0x28f
github.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).QuerySync(0xc00412a430?, {{}, {0xc007086080, 0x1d, 0x1e}, {0xc006f4e298, 0x8}, 0x0, 0x0})
        /home/jubnzv/Dev/gno/pkgs/bft/abci/client/local_client.go:180 +0x158
github.com/gnolang/gno/pkgs/bft/proxy.(*appConnQuery).QuerySync(0x0?, {{}, {0xc007086080, 0x1d, 0x1e}, {0xc006f4e298, 0x8}, 0x0, 0x0})
        /home/jubnzv/Dev/gno/pkgs/bft/proxy/app_conn.go:143 +0xfc
github.com/gnolang/gno/pkgs/bft/rpc/core.ABCIQuery(0x8?, {0xc006f4e298, 0x8}, {0xc007086080, 0x1d, 0x1e}, 0x2?, 0xb9?)
        /home/jubnzv/Dev/gno/pkgs/bft/rpc/core/abci.go:55 +0x12f
reflect.Value.call({0xb94b80?, 0xdcaf68?, 0x80?}, {0xc56f84, 0x4}, {0xc001a6a600, 0x5, 0x18?})
        /usr/lib/go/src/reflect/value.go:556 +0x845
reflect.Value.Call({0xb94b80?, 0xdcaf68?, 0x60?}, {0xc001a6a600, 0x5, 0x5})
        /usr/lib/go/src/reflect/value.go:339 +0xbf
github.com/gnolang/gno/pkgs/bft/rpc/lib/server.makeJSONRPCHandler.func1({0xea4d58, 0xc006f94150}, 0xc009d6db00)
        /home/jubnzv/Dev/gno/pkgs/bft/rpc/lib/server/handlers.go:158 +0xe0e
github.com/gnolang/gno/pkgs/bft/rpc/lib/server.handleInvalidJSONRPCPaths.func1({0xea4d58?, 0xc006f94150?}, 0x7fd2a7636108?)
        /home/jubnzv/Dev/gno/pkgs/bft/rpc/lib/server/handlers.go:182 +0x5d
net/http.HandlerFunc.ServeHTTP(0xc003fda800?, {0xea4d58?, 0xc006f94150?}, 0xc0073838a0?)
        /usr/lib/go/src/net/http/server.go:2084 +0x2f
net/http.(*ServeMux).ServeHTTP(0x160?, {0xea4d58, 0xc006f94150}, 0xc009d6db00)
        /usr/lib/go/src/net/http/server.go:2462 +0x149
github.com/gnolang/gno/pkgs/bft/rpc/lib/server.maxBytesHandler.ServeHTTP({{0xea10e0?, 0xc003fc7a40?}, 0x40f387?}, {0xea4d58?, 0xc006f94150}, 0xc009d6db00)
        /home/jubnzv/Dev/gno/pkgs/bft/rpc/lib/server/http_server.go:206 +0x122
github.com/gnolang/gno/pkgs/bft/rpc/lib/server.RecoverAndLogHandler.func1({0xea5bc8?, 0xc00a10a0e0}, 0xc009d6db00)
        /home/jubnzv/Dev/gno/pkgs/bft/rpc/lib/server/http_server.go:179 +0x326
net/http.HandlerFunc.ServeHTTP(0x0?, {0xea5bc8?, 0xc00a10a0e0?}, 0x40f025?)
        /usr/lib/go/src/net/http/server.go:2084 +0x2f
net/http.serverHandler.ServeHTTP({0xea3f28?}, {0xea5bc8, 0xc00a10a0e0}, 0xc009d6db00)
        /usr/lib/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc0016088c0, {0xea61e0, 0xc00a6fa270})
        /usr/lib/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
        /usr/lib/go/src/net/http/server.go:3071 +0x4db
 [module rpc-server]]

Improve r/boards to make it the official (daily) communication tool

  • prevent spam on r/boards ->
    • limit some boards to people with r/users
    • allow adding multiple moderators to a board
    • what do you suggest?
  • prevent spam on r/users ->
    • force invite, no more "pay for register" (easily abusable with faucet loop)
    • add a way to blacklist a spammer
    • what do you suggest?
  • improve usability and experience
    • finish the Keplr integration (#154)
    • limit noise by adding more subtle ways to interact, i.e. reactions
    • sort threads by last update date
    • make the comment counter recursive
    • help organize threads w/ labels
  • misc
    • bot that posts to Discord to get notified of changes, could be done in a hacky way or in a clean way alongside an official validator

Edit from @jaekwon:

We can prevent spam on r/users with a screenshot distribution; now more or less most of the people have tokens.

  • pay to register with a reasonable start fee, but maybe also considering throttling (max X per minute, say).
  • users with "admin" role can freeze any set of accounts (but not delete them).

Then r/boards can be moderated better.

  • by default require /r/users username.
  • allow anonymous posts optionally with minimum fee.

bad command in the quickstart

Hello,
I noticed that in the quickstart in the section "create a comment to a post", there was an omission in the first command.
In order to create a reply the command needs 4 args (boardid, threadid, postid and body) and not 3 as indicated in the post.

If you want I can create a new board quickstart and rectify the error before requesting the change in the code of the website.

Have a nice day

image
image

Chat?

Projects usually have some kind of "hub" chat.

There are a whole bunch of advantages and disadvantages to each, but if we're going our own way....

What about a text-based, secure P2P chat designed to run on Raspberry Pi computers for now, and soon, on Minimus machines.

I think that willingness to run a single board computer (or a VM, or even a native go app on your laptop, I suppose) would be a super-great filter.

Yeah, we're not on slack/discord.

wdyt?

Ofc, in the long term, seems like the chat would actually run in gno, with messages being delivered to realms and decrypted with a private key held by users/devs. I think.

[amino] Use pbbindings for MarshalAny.

MarshalAny() currently doesn't use pbbindings at all, so there are currently no proto savings for most values/nodes/types.
For reference, see the implementation of Marshal().

Jacob's Musings

Hey guys,

There's been a whole lot of chatter about gno, that even mentioned my involvement in Virgo, and I wanted to mention a bit about my big big hope:

https://twitter.com/notionaldao/status/1523525250654244865?s=20&t=WUZF7nJA-4Vk2KtPM7bceA

Context on virgo: I joined to work on hardware, though the original forum post I made in reply to Jae's tweet is now gone. Also, despite virgo kinda burning out, and Jae leaving tendermint, I've continued to work on hardware, self-funding its development. Right now the status is that I've paid an R&D retainer to PCBViet some months ago, and we get together every few weeks to see if there's a cosmos-suited product. Currently, the blocker is nvme storage for single-board computers. Cosmos nodes really do not perform well without NVMe storage, and I'd like for the eventual product to work up and down the cosmos stack.

Originally Jae and I had been looking into RISC-v cpu cores. The outcome of that work was the following conclusion:

It is possible to build an open source cpu core, but that cpu core would need to integrate various forms of proprietary perihiperal IP, and currently there aren't open source equivalents for those perihiperals

So, the stuff that I'm currently working on will use proprietary components, in the most conservative ways possible, and will include detailed information about the inner workings of the hardware.

It is my opinion that the main weakness of the majority of POS networks is in fact that there aren't enough nodes and users can't really run infrastructure.

With respect to gno, what that means is that I'd like to keep it lean over time.

This brings me to the code that I'd like to contribute to gno, which I mentioned recently in discord:

https://github.com/faddat/archlinux

That right there is an automated build system for amd64 / arm64 docker images using arch linux. I'd like to make that a part of this repository, in keeping with the audit requirements. It can build and push using github actions here.

but wait there's more

https://github.com/faddat/sos

Please pardon the dust on that repo. Before SOS was Seahorse, it was Starport Operating System.

It can also live in CI, using the arch linux build mentioned above, and create an image that can be flashed to a raspberry pi 4. It's also possible to support other device targets, including amd64 servers and the like.

At notional, all of our validators use basically the same setup, for conssitency's sake.

When we approach things like this, we get an open, auditable, predictable, rolling release OS that gno users can use over time.

I'm going to break up PR's as follows:

  • the docker-builder-thing
  • the rpi os image maker thing

Further followup musings

Right now the image build system uses arch linux. If we can be sure of a blob-free life, manjaro may be a better choice because they have much better mainline linux kernel device support, and that would allow gno to ship onto a wide range of devices, including several phones.

Gno Improvement Proposal (GIP): callback between realm packages - idea stage

PROBLEM: 

The current implementation does not allow a callback between two contracts (realm packages). For contract A to call a callback function on Contract-B at NotifiyMe(ABC), contract A has to import the realm package B in the gno code when people deploy Contract A. However, we have not deployed contact B yet. Therefore, we will fail to deploy contract A in the first place. 

Quit often, one entity builds contract A providing service on a chain, and other entities create contract B to call A for certain services. For example, suppose caller B cannot immediately get a status update notification through a callback within committed state changes. In that case, we can not correctly implement many smart-contract LEGO use cases such as oracle and flash loan.

MOTIVATION:

The smart-contract LEGO allows the service deployed as contracts to be called by other contracts on the chain.

Here is the contract LEGO value: The more business logic is implemented and linked on the chain other than in the UI and off-chain services, the more transparent and accessible to verify in a web3 dApp. In turn, it provides additional trust value.


SOLUTIONS:

At the high level, we have two options so far. We want to explore as many options as possible at the idea stage before we start to converge.

  1. Expose MsgCall in realm contract through std.Context and implement reflection in gno. It is the implementation at the VM level. It is similar to EVM encoding and passing ABI calls through msg.data.  
  2. Encapsulate contract B’s package path and function signature in a struct instance and register it to contract A on the contract level. A then can call back B when it is needed.

Both solutions require we verify B’s package path, address, and function signature before A makes the callback. 

PROS and CONS:

Evaluate the solution mainly from the following perspective.

  • Golang's idiomatic coding style: Is it easy to understand to go developers? Does it provide enough separation from implementation details related to blockchain transactions?
  • Security ( How to handle stack overflow for a call back looping? How will it make reentry possible? ) 
  • trust-value ( is the implementation transparent and easy to verify by humans?) 
  • Backward compatibility and upgrade path (we can ignore this for now)

PebbleDB

hi,

I've recently been doing a metric ton of work on databases in cosmos, and that is why I haven't popped up my head around here recently.

I think that we're going to find that PebbleDB is glaringly better than others, and that rocks will perform second best to it.

The trouble with rocks is that it forces us to use cgo ffi, and as they say, cgo is not go.

catshark and I have been working on pebbledb support for cosmos here:

https://github.com/osmosis-labs/tm-db/pull/4/files#diff-c80e8d6ab5da73cee445b22b98958c8a9d175f3e0001b29503a6e2983feb179d

Note that I strongly suspect that the current implementation has a bug.

Since I'm aware that Osmosis and many other active chains, like Terra are "trapped" in goleveldb, and that the current overall sentiment is that we should have a single DB so that it is easiest to work with, I would like to suggest that before we jump into a testnet, we make sure that gno can use PebbleDB.

It outperforms all other supported databases, and does not force us to use cgo.

Related work

https://github.com/nervosnetwork/ckb-vm

I think it's worthwhile to read that twice. I first ran into this when I was trying to implement smart contracts on arm in the cosmos ecosystem using Cosmwasm.

At that time I had only read it once.

VERY interesting and worth two reads.

Definitely, absolutely related to this work so you should read it until that realization settles in.

Command for repo cloning doesn't work

When type git clone github.com/gnolang/gno it doesn't find repository. To resolve it, just need to add protocol.
git clone https://github.com/gnolang/gno

amino protobufs

This is going to require more study, thinking maybe it should just be go objects and structs.

Model every dang thing as a struct, they are easier to use.

Except when speaking json to a client, let's not unmarshal/marshal things and limit type conversions to maximize joy.

Contributing policies for adding/updating new stdlibs packages

Multiple times, it happened to me that I missed a stdlibs package or method. We need to make it possible to add new stdlibs packages or update already imported ones.

I suggest:
We add a dedicated section with clear rules in CONTRIBUTING.md, let's say: "make sure the package compiles with no dead/incompatible code", and "make sure that the code allows making deterministic.", "make sure to keep the copyright", and "keep some unit tests".
Bonus: develop a small codegen script that takes a configuration file to regenerate all the stdlibs we want, and remove every function we don't want.
Bonus: if we get this configuration file from above, we could also generate an automatic changelog.

@jaekwon Before opening the first PR by myself to fully experiment with the process with some stdlibs I miss, I would like to know if you have any feedback about what you did in the past? Maybe you have already developed some helper scripts?

FYI, I plan to update "strconv" which lacks some recent Unicode helpers that I need in testing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.