Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

BlockId removal: refactor: HeaderBackend::header #12874

Merged
merged 17 commits into from
Dec 20, 2022

Conversation

michalkucharczyk
Copy link
Contributor

@michalkucharczyk michalkucharczyk commented Dec 8, 2022

BlockId removal: refactor: HeaderBackend::header

It changes the arguments of:

  • HeaderBackend::header,
  • Client::header,
  • PeersClient::header
  • ChainApi::block_header

methods from: BlockId<Block> to: Block::Hash

This PR is part of BlockId::Number refactoring analysis (paritytech/polkadot-sdk#53)

polkadot companion: paritytech/polkadot#6418
cumulus companion: paritytech/cumulus#1977

It changes the arguments of:
- `HeaderBackend::header`,
- `Client::header`,
- `PeersClient::header`
- `ChainApi::block_header`

methods from: `BlockId<Block>` to: `Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
This may required introduction of dedicated function:
header_for_block_num
@michalkucharczyk michalkucharczyk added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Dec 8, 2022
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Dec 8, 2022
@michalkucharczyk michalkucharczyk removed the A0-please_review Pull request needs code review. label Dec 8, 2022
@michalkucharczyk michalkucharczyk changed the title mku blockid headerbackend header BlockId removal: refactor: HeaderBackend::header Dec 8, 2022
Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

LGTM!

A couple of places where this needs changing:

//! let proposer = proposer_factory.init(
//! &client.header(&BlockId::number(0)).unwrap().unwrap(),
//! );

And the readme: https://github.com/paritytech/substrate/blob/master/client/basic-authorship/README.md

@michalkucharczyk
Copy link
Contributor Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@michalkucharczyk
Copy link
Contributor Author

/cmd queue -c fmt

@command-bot
Copy link

command-bot bot commented Dec 12, 2022

@michalkucharczyk https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2149145 was started for your command "$PIPELINE_SCRIPTS_DIR/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment /cmd cancel 57-ea246742-1cf7-4eb0-ae09-7efc095af177 to cancel this command or /cmd cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Dec 12, 2022

@michalkucharczyk Command "$PIPELINE_SCRIPTS_DIR/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2149145 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2149145/artifacts/download.

@michalkucharczyk
Copy link
Contributor Author

/cmd queue -c fmt

@command-bot
Copy link

command-bot bot commented Dec 15, 2022

@michalkucharczyk https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2161994 was started for your command "$PIPELINE_SCRIPTS_DIR/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment /cmd cancel 79-77b0824f-28ac-44e6-bb93-f67671da455f to cancel this command or /cmd cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Dec 15, 2022

@michalkucharczyk Command "$PIPELINE_SCRIPTS_DIR/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2161994 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2161994/artifacts/download.

@michalkucharczyk
Copy link
Contributor Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@michalkucharczyk
Copy link
Contributor Author

/cmd queue -c fmt

@command-bot
Copy link

command-bot bot commented Dec 20, 2022

@michalkucharczyk https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2177419 was started for your command "$PIPELINE_SCRIPTS_DIR/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment /cmd cancel 119-569a4ff9-fcb8-48e2-8c1b-71590e030703 to cancel this command or /cmd cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Dec 20, 2022

@michalkucharczyk Command "$PIPELINE_SCRIPTS_DIR/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2177419 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2177419/artifacts/download.

@michalkucharczyk
Copy link
Contributor Author

bot merge

@paritytech-processbot
Copy link

Error: Github API says paritytech/cumulus#1977 is not mergeable

@michalkucharczyk
Copy link
Contributor Author

bot merge

@paritytech-processbot
Copy link

Error: Github API says paritytech/cumulus#1977 is not mergeable

@michalkucharczyk
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 657c808 into master Dec 20, 2022
@paritytech-processbot paritytech-processbot bot deleted the mku-blockid-headerbackend-header branch December 20, 2022 09:43
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
* BlockId removal: refactor: HeaderBackend::header

It changes the arguments of:
- `HeaderBackend::header`,
- `Client::header`,
- `PeersClient::header`
- `ChainApi::block_header`

methods from: `BlockId<Block>` to: `Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)

* non-trivial usages of haeder(block_id) refactored

This may required introduction of dedicated function:
header_for_block_num

* fmt

* fix

* doc fixed

* ".git/.scripts/fmt.sh"

* BlockId removal: refactor: HeaderBackend::expect_header

It changes the arguments of `HeaderBackend::expect_header` method from: `BlockId<Block>` to: `Block::Hash`

* ".git/.scripts/fmt.sh"

* readme updated

* ".git/.scripts/fmt.sh"

* fix

Co-authored-by: parity-processbot <>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* BlockId removal: refactor: HeaderBackend::header

It changes the arguments of:
- `HeaderBackend::header`,
- `Client::header`,
- `PeersClient::header`
- `ChainApi::block_header`

methods from: `BlockId<Block>` to: `Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)

* non-trivial usages of haeder(block_id) refactored

This may required introduction of dedicated function:
header_for_block_num

* fmt

* fix

* doc fixed

* ".git/.scripts/fmt.sh"

* BlockId removal: refactor: HeaderBackend::expect_header

It changes the arguments of `HeaderBackend::expect_header` method from: `BlockId<Block>` to: `Block::Hash`

* ".git/.scripts/fmt.sh"

* readme updated

* ".git/.scripts/fmt.sh"

* fix

Co-authored-by: parity-processbot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants