Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@dnjscksdn98
Copy link
Collaborator

@dnjscksdn98 dnjscksdn98 commented Jan 23, 2024

Description

Relayer 주소 변경을 즉시 반영이 아닌 다음 라운드 시작부터 반영될 수 있도록 변경

Changes

pallet_relay_manager

  • set_relayer() 요청 성공 시, DelayedRelayerSets 로 해당 라운드 인덱스와 새 릴레이어 주소가 등록이 되며, 다음 라운드 시작에 자동으로 변경이 됨
  • 요청을 취소할 수 있도록 cancel_relayer_set() 추가됨
  • handle_delayed_relayer_set() 메소드를 RelayManager trait에 추가 (기존의 replace_bonded_relayer() 함수를 호출함)

pallet_bfc_staking

  • Candidate 퇴장 대기 과정에서 Controller 주소 업데이트 또는 커미션 업데이트를 하지 못하도록 set_controller()set_validator_commission() 에 검증 로직 추가
  • Controller 주소 업데이트 또는 커미션 업데이트 대기 중일 때 Candidate 퇴장 못하도록 schedule_leave_candidates() 에 검증 로직 추가 (전부 cancel_* 을 해야지만 가능)
  • 라운드 업데이트 때 handle_delayed_relayer_set() 호출하여 주소 변경 요청 처리

개념

  • pallet_relay_manager의 스토리지 중 initial* (ex. InitialSelectedRelayers) 관련 데이터들이 기존에는 실시간 데이터 (ex. SelectedRelayers) 들과 차이가 발생할 수 있던 경우는 kick out 또는 address update 이었는데, 이제는 kick out 뿐으로 고쳐짐

Reviewers Check

  • Controller와 Relayer의 동시 업데이트가 가능하도록 허용함
  • 주소 업데이트 요청을 보내고 난 후에 kickout을 당하게 되어도 업데이트는 정상적으로 허용함

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Something else (simple changes that are not related to existing functionality or others)

Checklist

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have made new test codes regarding to my changes.
  • I have no personal secrets or credentials described on my changes.
  • I have run cargo-clippy and linted my code.
  • My changes generate no new warnings.
  • My changes passed the existing test codes.
  • My changes are able to compile.

@dnjscksdn98 dnjscksdn98 added the bug Working incorrectly label Jan 23, 2024
@dnjscksdn98 dnjscksdn98 self-assigned this Jan 23, 2024
@dnjscksdn98 dnjscksdn98 requested a review from SunoukMun January 23, 2024 08:41
@dnjscksdn98 dnjscksdn98 marked this pull request as ready for review January 23, 2024 08:41
pallets/bfc-staking/src/pallet/impls.rs Outdated Show resolved Hide resolved
@dnjscksdn98 dnjscksdn98 merged commit 65809b5 into pre-v1.3.0 Jan 30, 2024
@dnjscksdn98 dnjscksdn98 deleted the NODE-78-delayed-relayer-address-update branch January 30, 2024 01:38
dnjscksdn98 added a commit that referenced this pull request Feb 6, 2024
* NODE-79, bifrost pallets improvements (#34)

* NODE-79, feature: migrate to standard storage version for bfc-staking

* NODE-79, feature: migrate to use new standard storage version for `bfc-offences`, `bfc-utility`, `relay-manager`.

* NODE-79, refactor: replace `OrderedSet` with `BTreeMap` & `BTreeSet`

* NODE-79, refactor: calculate translate weight info

* NODE-79, refactor: Remove redundant code

* NODE-79, refactor: Remove panic point in `bfc-staking` as much as possible

* NODE-79, refactor: use btree set in `SelectedCandidates`, `SelectedFullCandidates`, `SelectedBasicCandidates`, `CachedSelectedCandidates`

* NODE-79, refactor: remove unnecessary path prefix

* NODE-79, refactor: remove unnecessary reverse

* NODE-79, refactor: migrate `CandidatePool` to use BoundedBTreeMap

* NODE-79, refactor: kill storage `MinTotalSelected`

* NODE-79, refactor: remove unnecessary path prefix

* NODE-79, fix: typo

* NODE-79, refactor: use iter_mut

* NODE-79, chore: remove deadcode

* NODE-79, refactor: use mutate

* NODE-79, refactor: clone in small range

* NODE-79, refactor: no need to be complicate

* NODE-79, refactor: use getter

* NODE-79, fix: should use take instead get

* NODE-79, refactor: remove dead code

* NODE-79, refactor: no need to be complicated

* NODE-79, refactor: use getter

* NODE-79, refactor: `relay-manager`

* NODE-79, refactor: .

* NODE-79, refactor: remove redundant

* NODE-79, fix: revert message

* NODE-79, refactor: `bfc-staking`

* NODE-79, refactor: `relay-manager`

* NODE-79, refactor: move under util methods

* NODE-79, refactor: impl From<Offence> for EvmOffence

* NODE-79, refactor: reduce getter call

* NODE-79, refactor: remove unnecessary clone

* NODE-79, refactor: `Nominator.initial_nominations` type to BTreeMap

* NODE-79, refactor: .

* NODE-79, chore: remove dead code

* NODE-79, fix:

* NODE-79, fix:

* NODE-79, test: fit into new storage format

* NODE-79, fix: modify if exists else insert

* NODE-79, refactor: remove dead code

* NODE-79, fix: condition check on OnRuntimeUpgrade

* NODE-79, chore: comment

* NODE-79, fix: remove duplicate translate in migrations

* NODE-65, deps: polkadot sdk migration (#36)

* NODE-64, deps: upgrade to bifrost-polkadot-v1.3.0

* NODE-64, chore: use

* NODE-64, chore: remove precompile utils

* NODE-64, chore: replace to

* NODE-64, chore: move  to

* NODE-65, chore: apply block number prelude to precompiles

* NODE-65, chore: add hold/freeze reasons to

* NODE-65, chore: remove hold identifier from

* NODE-65, chore: add  to

* NODE-65, chore: add AllowMultipleBlocksPerSlot to pallet_aura

* NODE-65, chore: add new types to pallet_treasury

* NODE-65, chore: make pallet_preimage use Consideration

* NODE-65, chore: add missing generic type to GenesisConfig

* NODE-65, chore: update pallet_preimage

* NODE-65, chore: add IdentityInformation to pallet_identity

* NODE-65, chore: remove MaxPeerDataEncodingSize from pallet_im_online

* NODE-65, chore: add SuicideQuickClearLimit to pallet_evm

* NODE-65, feat: implement GenesisBuilder runtime api

* NODE-65, chore: rename Index to Nonce

* NODE-65, chore: specify txpool feature to fc_rpc

* NODE-65, fix: pending runtime api for pending state

* NODE-65, chore: Removal of execution strategies

* NODE-65, chore: Set StateBackend::Transaction to PrefixedMemoryDB

* NODE-65, chore: Modular block request handler

* NODE-65, chore: implement eth_call state override

* NODE-65, fix: resolve service.rs compile errors

* NODE-65, fix: replace to RuntimeGenesisConfig in chain_spec

* NODE-65, chore: add missing clone()

* NODE-65, chore: remove native runtime version api

* NODE-65, fix: replace to fp-account

* NODE-65, fix: remove RuntimeFreezeReason and sort imports

* NODE-65, chore: remove unneccessary self imports

* NODE-65, fix: rollback cherry-picked EthereumRuntimeRPCApi changes

* NODE-65, fix: add missing evm features

* NODE-65, deps: release v1.3.0

* NODE-65, fix: remove unused params

* NODE-65, fix: use correct crate features

* NODE-65, fix: remove std feature on pallet GenesisConfig Default impl

* NODE-65, test: replace deprecated storage

* NODE-65, test: estimated gas should be correct

* NODE-65, test: split runtime tests

* NODE-65, test: check balance consistancy

* NODE-65, test: check balance consistancy (2)

* NODE-65, feat: Only use substrate-wasm-builder when std feature is enabled

* NODE-65, deps: update Cargo.lock

* NODE-65, fix: resolve imports

* NODE-65, fix: update runtime tests

* NODE-65, fix: handle runtime test failures

* NODE-65, deps: update node packages

* NODE-65, deps: update Cargo.lock

* NODE-65, fix: remove test config

* NODE-84, chore: bifrost-frontier/pull/12 (#37)

* NODE-65, test: bifrost-frontier/pull/12 test code

---------

Co-authored-by: Min-seong Kwon <kwonarseus@gmail.com>

* NODE-78, fix: delayed relayer address update (#38)

* NODE-64, deps: upgrade to bifrost-polkadot-v1.3.0

* NODE-65, fix: pending runtime api for pending state

* NODE-65, chore: implement eth_call state override

* NODE-65, test: split runtime tests

* NODE-65, fix: update runtime tests

* NODE-65, fix: handle runtime test failures

* NODE-65, fix: remove test config

* NODE-78, feat: use delayed relayer sets

* NODE-78, feat: handle relayer sets on round update

* NODE-78, fix: add verifications on scheduling leaves

* NODE-78, test: add basic set relayer tests

* NODE-78, test: add advanced tests

* NODE-78, feat: add constraints to set_controller

* NODE-78, feat: add constraints to set_validator_commission

* NODE-78, chore: expect replacement will always succeed

* NODE-78, chore: add missing string docs

* NODE-78, fix: round update must be priorly set

* NODE-78, chore: add missing string docs

* NODE-78, fix: remove redundant state checks

* deps: increase runtime version

* test: update live runtime tests

---------

Co-authored-by: Min-seong Kwon <kwonarseus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Working incorrectly

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.