Skip to content

Commit

Permalink
Fixed start and end era (#430)
Browse files Browse the repository at this point in the history
## Description
<!-- Describe what change this PR is implementing -->

## Types of Changes
Please select the branch type you are merging and fill in the relevant
template.
<!--- Check the following box with an x if the following applies: -->
- [ ] Hotfix
- [ ] Release
- [ ] Fix or Feature

## Fix or Feature
<!--- Check the following box with an x if the following applies: -->

### Types of Changes
<!--- What types of changes does your code introduce? -->
- [ ] Tech Debt (Code improvements)
- [ ] 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 change)
- [ ] Dependency upgrade (A change in substrate or any 3rd party crate
version)

### Migrations and Hooks
<!--- Check the following box with an x if the following applies: -->
- [ ] This change requires a runtime migration.
- [ ] Modifies `on_initialize`
- [ ] Modifies `on_finalize`

### Checklist for Fix or Feature
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [ ] Change has been tested locally.
- [ ] Change adds / updates tests if applicable.
- [ ] Changelog doc updated.
- [ ] `spec_version` has been incremented.
- [ ] `network-relayer`'s
[events](https://github.com/Cerebellum-Network/network-relayer/blob/dev-cere/shared/substrate/events.go)
have been updated according to the blockchain events if applicable.
- [ ] All CI checks have been passed successfully

## Checklist for Hotfix
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [ ] Change has been deployed to Testnet.
- [ ] Change has been tested in Testnet.
- [ ] Changelog has been updated.
- [ ] Crate version has been updated.
- [ ] `spec_version` has been incremented.
- [ ] Transaction version has been updated if required.
- [ ] Pull Request to `dev` has been created.
- [ ] Pull Request to `staging` has been created.
- [ ] `network-relayer`'s
[events](https://github.com/Cerebellum-Network/network-relayer/blob/dev-cere/shared/substrate/events.go)
have been updated according to the blockchain events if applicable.
- [ ] All CI checks have been passed successfully

## Checklist for Release
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [ ] Change has been deployed to Devnet.
- [ ] Change has been tested in Devnet.
- [ ] Change has been deployed to Qanet.
- [ ] Change has been tested in Qanet.
- [ ] Change has been deployed to Testnet.
- [ ] Change has been tested in Testnet.
- [ ] Changelog has been updated.
- [ ] Crate version has been updated.
- [ ] Spec version has been updated.
- [ ] Transaction version has been updated if required.
- [ ] All CI checks have been passed successfully
  • Loading branch information
ayushmishra2005 authored Sep 19, 2024
1 parent 5ae6d1b commit 7e421cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
27 changes: 4 additions & 23 deletions pallets/ddc-verification/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,22 +769,8 @@ pub mod pallet {
let batch_size = T::MAX_PAYOUT_BATCH_SIZE;
let mut errors: Vec<OCWError> = Vec::new();

let validated_era =
Self::get_era_for_payout(&cluster_id, EraValidationStatus::ValidatingData);

let era_activity = if let Some((id, start, end)) = validated_era {
Some(EraActivity { id, start, end })
} else {
None
};

let processed_dac_data = Self::process_dac_data(
&cluster_id,
era_activity,
&dac_nodes,
min_nodes,
batch_size.into(),
);
let processed_dac_data =
Self::process_dac_data(&cluster_id, None, &dac_nodes, min_nodes, batch_size.into());

match processed_dac_data {
Ok(Some((
Expand Down Expand Up @@ -2914,13 +2900,8 @@ pub mod pallet {
.entry((payers_merkle_root_hash, payees_merkle_root_hash))
.or_insert_with(Vec::new);

// todo! Uncomment below code once we process unprocessed era on Devnet
// ensure!(!signed_validators.contains(&caller.clone()), Error::<T>::AlreadySignedEra);
// signed_validators.push(caller.clone());
// todo! Remove below code once we process unprocessed era on Devnet
if !signed_validators.contains(&caller.clone()) {
signed_validators.push(caller.clone());
}
ensure!(!signed_validators.contains(&caller.clone()), Error::<T>::AlreadySignedEra);
signed_validators.push(caller.clone());

let percent = Percent::from_percent(T::MAJORITY);
let threshold = percent * <ValidatorSet<T>>::get().len();
Expand Down
2 changes: 1 addition & 1 deletion runtime/cere-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 54122,
spec_version: 54123,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 19,
Expand Down
2 changes: 1 addition & 1 deletion runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 54122,
spec_version: 54123,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 19,
Expand Down

0 comments on commit 7e421cf

Please sign in to comment.