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

bug: Rollkit attempts to create 2 blocks with identical Unix timestamps #1529

Open
Tracked by #1594
jcstein opened this issue Feb 6, 2024 · 4 comments · May be fixed by berachain/polaris#1494
Open
Tracked by #1594

bug: Rollkit attempts to create 2 blocks with identical Unix timestamps #1529

jcstein opened this issue Feb 6, 2024 · 4 comments · May be fixed by berachain/polaris#1494
Assignees
Labels
polaris v2 T:bug Something isn't working

Comments

@jcstein
Copy link
Member

jcstein commented Feb 6, 2024

Version of Git SHA

  1. running polaris on cd5f8ef berachain/polaris@cd5f8ef
  2. running polaris on this PR feat: Rollkit updated main berachain/polaris#1482

these both use rollkit v0.11.19-no-fraud-proofs https://github.com/rollkit/cosmos-sdk/releases/tag/v0.50.1-rollkit-v0.11.19-no-fraud-proofs

System OS

macOS

Installed tools

necessary dependencies

Others

No response

Steps to reproduce it

copied from berachain/polaris#1482 (comment)

testing setup

  1. running on celestia-da v0.12.10
docker run -d \
-e NODE_TYPE=light \
-e P2P_NETWORK=mocha \
-p 26650:26650 \
-p 26658:26658 \
-p 26659:26659 \
-v $HOME/.celestia-light-mocha-4/:/home/celestia/.celestia-light-mocha-4/ \
ghcr.io/rollkit/celestia-da:v0.12.10 \
celestia-da light start \
--p2p.network=mocha \
--da.grpc.namespace=0000506f6c6172697332 \
--da.grpc.listen=0.0.0.0:26650 \
--core.ip rpc-mocha.pops.one \
--gateway
  1. using feat: Rollkit updated main berachain/polaris#1482
  2. with default 1s block times, following instructions from https://rollkit.dev/tutorials/polaris-evm#start-your-light-node
  3. posting to mocha's "Polaris2" namespace: https://mocha.celenium.io/namespace/0000000000000000000000000000000000000000506f6c6172697332

Expected result

Rollkit does not try to make 2 blocks with the same Unix timestamp.

Actual result

Rollkit tries to make 2 blocks with the same Unix timestamp. Chain crashes. Unrecoverable for the developer and for the chain.

copied from berachain/polaris#1482 (comment)

testing update

Unfortunately, the chain crashed, due to an error seen on previous testing (before branch was updated):

3:47PM ERR failed to build payload err="invalid timestamp, parent 1707252473 given 1707252473" module=server
3:47PM INF exiting prepare proposal duration=3.421708 height=3149 module=polaris-proposal-provider timestamp=2024-02-06T15:47:53-05:00
3:47PM ERR failed to prepare proposal err="invalid timestamp, parent 1707252473 given 1707252473" height=3149 module=server
3:47PM INF entering process proposal height=3149 module=polaris-proposal-provider timestamp=2024-02-06T15:47:53-05:00
3:47PM INF exiting process proposal duration=1.003917 height=3149 module=polaris-proposal-provider timestamp=2024-02-06T15:47:53-05:00
3:47PM ERR failed to process proposal err="failed to find envelope in proposal" hash=FECD964A8D720D3E9BB272ED49C154D563ED876BCA112DC9DF6A8ED7603BF11D height=3149 module=server
panic: error while processing the proposal: <nil>

goroutine 421 [running]:
github.com/rollkit/rollkit/block.(*Manager).publishBlock(0x14000df1a40, {0x1063fac60, 0x14001b11e00?})
	github.com/rollkit/rollkit@v0.11.19/block/manager.go:732 +0xbd8
github.com/rollkit/rollkit/block.(*Manager).AggregationLoop(0x14000df1a40, {0x1063fac60, 0x14001b11e00}, 0x0)
	github.com/rollkit/rollkit@v0.11.19/block/manager.go:274 +0x1d0
github.com/rollkit/rollkit/node.(*FullNode).OnStart.func1()
	github.com/rollkit/rollkit@v0.11.19/node/full.go:379 +0x30
github.com/rollkit/rollkit/types.(*ThreadManage()
	github.com/rollkit/rollkit@v0.11.19/types/threadmanager.go:26 +0x58
created by github.com/rollkit/rollkit/types.(*ThreadManager).Go in goroutine 1
	github.com/rollkit/rollkit@v0.11.19/types/threadmanager.go:24 +0x7c
make: *** [start] Error 2

root issue

3:47PM ERR failed to build payload err="invalid timestamp, parent 1707252473 given 1707252473" module=server

logs

Relevant log output

No response

Notes

No response

@MSevey MSevey self-assigned this Feb 7, 2024
@MSevey MSevey added T:bug Something isn't working va and removed needs-triage labels Feb 7, 2024
jcstein added a commit to berachain/polaris that referenced this issue Feb 7, 2024
Due to clashing timestamps mentioned in rollkit/rollkit#1529

Signed-off-by: Josh Stein <46639943+jcstein@users.noreply.github.com>
jcstein added a commit to berachain/polaris that referenced this issue Feb 7, 2024
Due to clashing timestamps mentioned in
rollkit/rollkit#1529

Signed-off-by: Josh Stein <46639943+jcstein@users.noreply.github.com>
@jcstein
Copy link
Member Author

jcstein commented Feb 8, 2024

source rollkit/cosmos-sdk@306e719

@tzdybal
Copy link
Member

tzdybal commented Feb 8, 2024

The invalid timestamp, parent) error is thrown by geth code, not rollkit nor cosmos-sdk.
(I double checked, and there is no invalid timestamp string in rollkit/cosmos-sdk repos).

The timestamp (integer value) in the error message in clearly the Unix timestamp with seconds precission (you can test this with $ date -d @1707252473).

  • Rollkit internally use UnixNano so initially all timestamps have nanosecond precision.
  • ABCI gRPC use google.protobuf.Timestamp - precision is nanoseconds.
  • cosmos-sdk use time.Time in go objects - precision is nanoseconds.
  • Polaris explicitly trims the timestamp to seconds in Miner.submitPayloadForBuilding.

@Manav-Aggarwal Manav-Aggarwal added the P:high Priority: High label Feb 8, 2024
@Manav-Aggarwal Manav-Aggarwal assigned gupadhyaya and unassigned MSevey Feb 9, 2024
@gupadhyaya
Copy link
Member

this commit uncomments the recover logic in PrepareProposal which should consume the identical timestamp errors, which was mostly intentional to begin with. will close this issue after testing the fix.

@MSevey MSevey removed P:high Priority: High va labels Mar 8, 2024
@MSevey
Copy link
Contributor

MSevey commented Mar 8, 2024

Pending polaris v2 migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polaris v2 T:bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants