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

Block time is incorrect if mining interval is less than 1 #245

Open
3 tasks done
dishmop opened this issue Jun 16, 2022 · 1 comment
Open
3 tasks done

Block time is incorrect if mining interval is less than 1 #245

dishmop opened this issue Jun 16, 2022 · 1 comment
Labels
C-bug Category: Something isn't working

Comments

@dishmop
Copy link

dishmop commented Jun 16, 2022

Prerequisites

Expected Behavior

I expect the block.time.seconds() to go up about 1 every second

Current Behavior

If I run the node replacing 5 in the timeout_commit config with 0.25, then time rises about twice as quickly as realtime in the contracts. My initialisation script does this:
sed -i 's/timeout_commit = "5s"/timeout_commit = "0.25s"/g' ~/.fetchd/config/config.toml

prior to calling fetchd start

I then ran a python script which every second queried a contract which returned the block.time. This is the table:

Rust: env.block.time.seconds(), Python time.time()
0.0, 0.0
3.0. 1.0
5.0, 2.0
7.0. 3.0
9.0. 4.0
11.0, 5.0
13.0, 6.0
15.0, 7.0
17.0, 8.0
19.0, 9.0

You can see that the contract time rises about twice as fast as the realtime (measured in python).

This is only an issue when the timeout_commit time is < 1. However, this is kind of crucial for us otherwise development becomes impossibly slow.

To Reproduce

Talk to Diarmid and I can point you to code.

Context

OSX
Fetchd version (docker image) image: fetchai/fetchd:0.9.0-rc4

Failure Logs

No response

@dishmop dishmop added the C-bug Category: Something isn't working label Jun 16, 2022
@daeMOn63
Copy link
Contributor

These 3 seconds seem to match the timeout_propose parameter default value. You can try to adjust this as well. Other than this I have no clue how to configure tendermint to achieve what you want, probably worth you ask over https://github.com/tendermint/tendermint or reach on cosmos discord someone to help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants