Skip to content

Commit

Permalink
fix!: close epochs based on block numbers
Browse files Browse the repository at this point in the history
- Fixes the ClaimMismatch bug on v.1x.
- BREAKING CHANGE: replaces the CARTESI_EPOCH_DURATION environment
  variable with CARTESI_EPOCH_LENGTH_IN_BLOCKS.
  • Loading branch information
renan061 committed Jun 19, 2024
1 parent a04487a commit 679c183
Show file tree
Hide file tree
Showing 10 changed files with 793 additions and 621 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<<<<<<< HEAD
## [Unreleased]

### Added

- Added Rollups end-to-end test using Echo Dapp

### Fixed

- Fixed a bug that caused a `authority_claimer::ClaimMismatch` error when reprocessing inputs after a reboot.

### Changed

- Changed the dispatcher to close epochs based on block numbers instead of block timestamps.
- **BREAKING**: replaced `CARTESI_EPOCH_DURATION` with `CARTESI_EPOCH_LENGTH_IN_BLOCKS` to match the new epoch algorithm, and set its default value to 7200 (1 day worth of blocks, in average, considering one block is mined every 12 seconds).

## [1.4.0] 2024-04-09

### Added
Expand Down
8 changes: 4 additions & 4 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ for more information.
* **Type:** `string`
* **Default:** `""`

## `CARTESI_EPOCH_DURATION`
## `CARTESI_EPOCH_LENGTH_IN_BLOCKS`

Duration of a rollups epoch in seconds.
Length of a rollups epoch in blocks.

At the end of each epoch, the node will send claims to the blockchain.

* **Type:** `Duration`
* **Default:** `"86400"`
* **Type:** `uint64`
* **Default:** `"7200"`

## `CARTESI_SNAPSHOT_DIR`

Expand Down
8 changes: 4 additions & 4 deletions internal/node/config/generate/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ the snapshot matches the hash in the Application contract."""
# Rollups
#

[rollups.CARTESI_EPOCH_DURATION]
default = "86400" # 1 day in seconds
go-type = "Duration"
[rollups.CARTESI_EPOCH_LENGTH_IN_BLOCKS]
default = "7200" # 1 day (average) in blocks (considering one block is mined every 12 seconds)
go-type = "uint64"
description = """
Duration of a rollups epoch in seconds.
Length of a rollups epoch in blocks.
At the end of each epoch, the node will send claims to the blockchain."""

Expand Down
10 changes: 5 additions & 5 deletions internal/node/config/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 679c183

Please sign in to comment.