-
Notifications
You must be signed in to change notification settings - Fork 145
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
Provide a feature to specify block finality time #160
Comments
Hey, did you found a solution, @DoubleOTheven? I'm facing a similar problem right now. Not only from the perspective that frontend development is more artificial then (no loading states etc.), but I also have the problem that polkadot.js/api transactions never yield an Small example:
|
I think we should just move to a very short block time (<< 1s) instead of having instant finality. |
Would be perfectly fine from my side (if that actually solves the problem above, but I guess) :) |
We could also add a flag |
@PierreOssun Do you have any thoughts here? And more important: would you by chance be up for implementing it 😊? Asking because you were so kind to do the original PR for instant finality. |
Just pushing this up once again, as I stumble across issues everywhere due to the instant finality nature of For example I wanted to index my local node with Subsquid, and when starting its archive (https://github.com/subsquid/substrate-archive-setup) it says |
@cmichi How about this approach? Same as spawning two tasks for e.g. aura (authoring) & grandpa (finality), Now, |
@wottpal |
Released v1.6.0 with delayed finalize feature |
Thanks @shunsukew, I just tried it, and it's working smoothly 👌🥳 It fixes both problems mentioned above:
Would love to see this in |
That's great to hear! |
Adds `--finalize-delay-sec` cli argument, based on the great work by @shunsukew at inkdevhub/swanky-node#61. Manual testing by starting node with/without option, along with example contract upload: ```shell # build example contract cargo contract build --manifest-path=../ink-examples/erc20/Cargo.toml # start node cargo run # upload contract cargo contract upload --suri //Alice --execute --manifest-path=../ink-examples/erc20/Cargo.toml # check finalized head remains at genesis sleep 1 test $(curl -sH "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "chainHead_unstable_genesisHash", "params":[]}' http://localhost:9944 | jq .result) \ = $(curl -sH "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "chain_getFinalizedHead", "params":[]}' http://localhost:9944 | jq .result) && echo PASS || echo FAIL # start node (with delayed finalization) cargo run -- --finalize-delay-sec 1 # upload contract cargo contract upload --suri //Alice --execute --manifest-path=../ink-examples/erc20/Cargo.toml # check finalized head matches chain head sleep 1 test $(curl -sH "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "chain_getHead", "params":[]}' http://localhost:9944 | jq .result) \ = $(curl -sH "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "chain_getFinalizedHead", "params":[]}' http://localhost:9944 | jq .result) && echo PASS || echo FAIL ``` Closes #160
instant finality makes front end development difficult, and unrealistic. It would be great to be able to simulate the various states of a transaction
in block
,finalized
, etcThe text was updated successfully, but these errors were encountered: