Comments (2)
Does our gno.land platform have the capability to implement technical solutions for the above problem ? @moul @zivkovicmilos
from gno.
According to the issue of creating paid transactions on behalf of others as discussed in the previous meeting, which VAR-META suggested, I have created a demo to test this feature:
- A sponsor account is set in the first message, responsible for paying the gas fee for the entire transaction (including the msg call below).
- A call to a realm function by the sender to execute the logic (expecting the account signing this message will not incur a fee).
- I sign the transaction for each account and arrange them in the order of the corresponding msg above.
var msgs = []std.Msg{
vm.MsgCall{
Caller: sponsorInfo.Address,
// PkgPath: "gno.land/r/demo/counter",
// Func: "Increase",
// Args: nil,
// Send: std.MustParseCoins("1000000ugnot"),
},
vm.MsgCall{
Caller: senderInfo.Address,
PkgPath: "gno.land/r/demo/counter",
Func: "Increase",
Args: nil,
// Send: std.MustParseCoins("1000000ugnot"),
},
}
tx.Signatures = append(tx.Signatures,
std.Signature{
PubKey: sponsorPubKey,
Signature: sponsorSignature,
},
std.Signature{
PubKey: senderPubKey,
Signature: senderSignature,
},
)
However, the ValidateBasic() function in gno.land/pkg/sdk/vm/msgs.go does not allow sending an empty message:
func (msg MsgCall) ValidateBasic() error {
if msg.Caller.IsZero() {
return std.ErrInvalidAddress("missing caller address")
}
if msg.PkgPath == "" { // XXX
return ErrInvalidPkgPath("missing package path")
}
if msg.Func == "" { // XXX
return ErrInvalidExpr("missing function to call")
}
return nil
}
If it is necessary to call a function in the realm that does not have any logic in the first message, we still have to pay a small gas fee instead of not paying gas.
{
"jsonrpc": "2.0",
"id": "",
"result": {
"height": "543",
"results": {
"deliver_tx": [
{
"ResponseBase": {
"Error": null,
"Data": "CgooMjAgdWludDY0KQoK",
"Events": [
{
"@type": "/tm.gnoEvent",
"type": "g1y490harzjqmdngmmaw4tyc4qdm5ma5k0fv3w6p : 20",
"pkg_path": "gno.land/r/demo/counter",
"func": "Increase",
"attrs": null
},
{
"@type": "/tm.gnoEvent",
"type": "g1y490harzjqmdngmmaw4tyc4qdm5ma5k0fv3w6p : 20",
"pkg_path": "gno.land/r/demo/counter",
"func": "Increase",
"attrs": null
}
],
"Log": "msg:0,success:true,log:,events:[]\nmsg:1,success:true,log:,events:[]",
"Info": ""
},
"GasWanted": "1000000",
"GasUsed": "274145"
}
],
"end_block": {
"ResponseBase": {
"Error": null,
"Data": null,
"Events": null,
"Log": "",
"Info": ""
},
"ValidatorUpdates": null,
"ConsensusParams": null,
"Events": null
},
"begin_block": {
"ResponseBase": {
"Error": null,
"Data": null,
"Events": null,
"Log": "",
"Info": ""
}
}
}
}
}
What should I do ? @jaekwon @leohhhn
Updated : this question is out-of-date
from gno.
Related Issues (20)
- Clarify allowed files and extensions when adding a package
- gnokey does not show the full HTTP response in case of error HOT 4
- task: check the lexical restrictions on gno module paths and compare to go
- Sentry Nodes lagging behind validator in consensus process HOT 20
- [chain] Upload and display benchmarks for the gno monorepo HOT 5
- [chain] Refactor and revise the `gnolang/benchmarks` repository
- [chain] Add OTEL tracing functionality + Jaeger HOT 2
- Track and identify emitted events HOT 2
- Document some gnoland flags require -lazy
- [chain] Audit the Gno.land storage layer
- Deleting an imported key deletes the old key
- [GnoVM] Missing method DecRefCount when deleting element in pointer slice
- Client-side HTTP basic authentication support HOT 2
- Proposition to add a $GNOADDR or $ADDRESS env variable HOT 2
- Adding a package with insufficient gas causes causes 'should not happen' the next time
- [Examples] Refactor `p/demo/blog` package to use slice instead of AVL tree
- [docs-linter] Improve code readability & concurrency
- gnoweb: add Link to README.md HOT 1
- Encoding error of `priv_validator_key.json` when sharding for Horcrux
- ci: ensure examples/ is correctly formatted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gno.