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

test: restart with relayer data #1866

Merged
merged 18 commits into from
Apr 29, 2024

Conversation

bvrooman
Copy link
Contributor

@bvrooman bvrooman commented Apr 25, 2024

The relayer service fails to start if the relayer database is already populated with a DaHeightTable entry. When the relayer starts, it attempts to set the DA height to the config's da_deploy_height. If the da_deploy_height defined by the config (where the default is 0) is not a monotonically increasing value compared to the database entry, the service panics.

Instead of setting we DA height at relayer start up, we can simply continue from where the relayer has previously left off. We do not need to make this invalid database commit at relayer startup. This PR removes the invalid commit.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

After merging, notify other teams

[Add or remove entries as needed]

Brandon Vrooman and others added 3 commits April 24, 2024 08:43
This branch is based off of `0.24.2` This PR is a hotfix for GQL version
types and applies the change from
#1856 on master to this
branch.

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [ ] New behavior is reflected in tests
- [ ] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [ ] I have reviewed the code myself
- [ ] I have created follow-up issues caused by this PR and linked them
here

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?
Upgrades 0.24.2 to 0.24.3

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [ ] New behavior is reflected in tests
- [ ] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [x] I have reviewed the code myself
- [ ] I have created follow-up issues caused by this PR and linked them
here

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?
@bvrooman bvrooman changed the base branch from master to release/v0.24.3 April 25, 2024 03:29
@bvrooman bvrooman self-assigned this Apr 28, 2024
@bvrooman bvrooman added the breaking A breaking api change label Apr 28, 2024
@bvrooman bvrooman requested a review from a team April 28, 2024 23:51
@bvrooman bvrooman marked this pull request as ready for review April 28, 2024 23:51
@@ -31,10 +28,6 @@ pub struct RelayerArgs {
#[arg(long = "relayer-v2-listening-contracts", value_parser = parse_h160, env)]
pub eth_v2_listening_contracts: Vec<H160>,

/// Number of da block that the contract is deployed at.
#[clap(long = "relayer-da-deploy-height", default_value_t = Config::DEFAULT_DA_DEPLOY_HEIGHT, env)]
pub da_deploy_height: u64,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need a way to pass the block height from which we need to start requesting ethereum blocks. Otherwise we will start from zero and it could take a lot of time to catch up with the current block height.

@@ -143,29 +147,29 @@ where
}

db_tx.storage::<EventsHistory>().insert(da_height, events)?;

grow_monotonically(&mut db_tx, da_height)?;
db_tx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need DaHeightTable table anymore=)

@xgreenx xgreenx changed the base branch from release/v0.24.3 to master April 29, 2024 13:57
xgreenx and others added 6 commits April 29, 2024 15:58
# Conflicts:
#	CHANGELOG.md
#	Cargo.lock
#	Cargo.toml
#	crates/client/assets/schema.sdl
#	crates/fuel-core/src/schema/chain.rs
#	crates/fuel-core/src/service/sub_services.rs
#	deployment/charts/Chart.yaml
#	tests/tests/relayer.rs
…er-data' into bvrooman/test/restart-with-relayer-data
@bvrooman bvrooman merged commit 6f5c4fc into master Apr 29, 2024
33 checks passed
@bvrooman bvrooman deleted the bvrooman/test/restart-with-relayer-data branch April 29, 2024 18:13
@xgreenx xgreenx mentioned this pull request Apr 30, 2024
xgreenx added a commit that referenced this pull request Apr 30, 2024
## Version v0.26.0

### Fixed

#### Breaking

- [#1868](#1868): Include the
`event_inbox_root` in the header hash. Changed types of the
`transactions_count` to `u16` and `message_receipt_count` to `u32`
instead of `u64`. Updated the application hash root calculation to not
pad numbers.
- [#1866](#1866): Fixed a
runtime panic that occurred when restarting a node. The panic happens
when the relayer database is already populated, and the relayer attempts
an empty commit during start up. This invalid commit is removed in this
PR.
- [#1871](#1871): Fixed
`block` endpoint to return fetch the blocks from both databases after
regenesis.
- [#1856](#1856): Replaced
instances of `Union` with `Enum` for GraphQL definitions of
`ConsensusParametersVersion` and related types. This is needed because
`Union` does not support multiple `Version`s inside discriminants or
empty variants.
- [#1870](#1870): Fixed
benchmarks for the `0.25.3`.
- [#1870](#1870): Improves the
performance of getting the size of the contract from the
`InMemoryTransaction`.
- [#1851](#1851): Provided
migration capabilities (enabled addition of new column families) to
RocksDB instance.

### Added 

- [#1853](#1853): Added a test
case to verify the database's behavior when new columns are added to the
RocksDB database.
- [#1860](#1860): Regenesis
now preserves `FuelBlockIdsToHeights` off-chain table.

### Changed

- [#1847](#1847): Simplify the
validation interface to use `Block`. Remove `Validation` variant of
`ExecutionKind`.
- [#1832](#1832): Snapshot
generation can be cancelled. Progress is also reported.
- [#1837](#1837): Refactor the
executor and separate validation from the other use cases

## What's Changed
* Weekly `cargo update` by @github-actions in
#1850
* Refactor/separate validation from other executions by @MitchTurner in
#1837
* fix: Use `Enum` for `ConsensusParametersVersion` and related types by
@bvrooman in #1856
* feat: snapshot generation graceful shutdown by @segfault-magnet in
#1832
* regenesis: migrate FuelBlockIdsToHeights by @Dentosal in
#1860
* Weekly `cargo update` by @github-actions in
#1869
* Refactor/Simplify validation logic by @MitchTurner in
#1847
* Fixed `block` endpoint to return fetch the blocks from both databases
after regenesis by @xgreenx in
#1871
* Add Eq and Partial Eq to tx response and status by @MujkicA in
#1872
* test: restart with relayer data by @bvrooman in
#1866
* Fix `BlockHeader` hash by @MitchTurner in
#1868
* Added a test for the case of adding new columns into the existing
RocksDB database by @xgreenx in
#1853
* Fixed benchmarks for the `0.25.3` by @xgreenx in
#1870


**Full Changelog**:
v0.25.3...v0.26.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking api change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants