Skip to content

Commit

Permalink
Hardfork at block 32323342
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewAR2 committed Sep 20, 2024
1 parent 04b445e commit 8061825
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 176 deletions.
88 changes: 1 addition & 87 deletions crates/ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,90 +257,6 @@ pub struct Client {
importer: Importer,
}

fn is_hardfork(
number: u64,
) -> bool {
if number >= 32323342 && number <= 32504329 {
if number >= 32323342 && number <= 32326760 {
return true;
}

if 32325019 == number {
return true;
}
if 32328177 == number {
return true;
}
if 32328573 == number {
return true;
}
if 32331477 == number {
return true;
}
if 32342549 == number {
return true;
}
if 32346141 == number {
return true;
}
if 32347300 == number {
return true;
}
if 32348294 == number {
return true;
}
if 32353623 == number {
return true;
}
if 32353995 == number {
return true;
}
if 32355703 == number {
return true;
}
if 32356753 == number {
return true;
}
if 32361383 == number {
return true;
}
if 32362537 == number {
return true;
}
if 32364520 == number {
return true;
}
if 32376286 == number {
return true;
}
if 32382124 == number {
return true;
}
if 32383379 == number {
return true;
}
if 32387386 == number {
return true;
}
if 32400451 == number {
return true;
}
if 32413500 == number {
return true;
}
if 32414179 == number {
return true;
}
if 32482796 == number {
return true;
}
if 32504329 == number {
return true;
}
}
false
}

impl Importer {
pub fn new(
config: &ClientConfig,
Expand Down Expand Up @@ -654,9 +570,7 @@ impl Importer {
.verify_block_final(&header, &locked_block.header)
{
warn!(target: "client", "Stage 5 block verification failed for #{} ({})\nError: {:?}", header.number(), header.hash(), e);
if !is_hardfork(header.number()) {
bail!(e);
}
bail!(e);
}

let pending = self.check_epoch_end_signal(
Expand Down
94 changes: 5 additions & 89 deletions crates/ethcore/src/engines/authority_round/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,89 +907,6 @@ fn is_step_proposer(
step_proposer(validators, bh, step) == *address
}

fn is_hardfork(
step: u64,
) -> bool {
if step >= 345004322 && step <= 345210547 {
if step >= 345004322 && step <= 345008721 {
return true;
}
if 345006479 == step {
return true;
}
if 345010530 == step {
return true;
}
if 345011042 == step {
return true;
}
if 345014618 == step {
return true;
}
if 345028464 == step {
return true;
}
if 345032947 == step {
return true;
}
if 345034391 == step {
return true;
}
if 345035640 == step {
return true;
}
if 345042156 == step {
return true;
}
if 345042642 == step {
return true;
}
if 345044761 == step {
return true;
}
if 345046064 == step {
return true;
}
if 345051830 == step {
return true;
}
if 345053240 == step {
return true;
}
if 345055684 == step {
return true;
}
if 345068949 == step {
return true;
}
if 345075721 == step {
return true;
}
if 345077182 == step {
return true;
}
if 345081711 == step {
return true;
}
if 345096161 == step {
return true;
}
if 345111427 == step {
return true;
}
if 345112243 == step {
return true;
}
if 345187046 == step {
return true;
}
if 345210547 == step {
return true;
}
}
false
}

fn verify_timestamp(step: &Step, header_step: u64) -> Result<(), BlockError> {
match step.check_future(header_step) {
Err(None) => {
Expand Down Expand Up @@ -1024,9 +941,8 @@ fn verify_external(
empty_steps_transition: u64,
) -> Result<(), Error> {
let header_step = header_step(header, empty_steps_transition)?;
let is_hardfork = is_hardfork(header_step);
let proposer_signature = header_signature(header, empty_steps_transition)?;
let correct_proposer = if is_hardfork { *header.author() } else { validators.get(header.parent_hash(), header_step as usize) };
let correct_proposer = validators.get(header.parent_hash(), header_step as usize);
let is_invalid_proposer = *header.author() != correct_proposer || {
let empty_steps_rlp = if header.number() >= empty_steps_transition {
Some(header_empty_steps_raw(header))
Expand All @@ -1038,10 +954,6 @@ fn verify_external(
!publickey::verify_address(&correct_proposer, &proposer_signature, &header_seal_hash)?
};

if is_hardfork {
info!(target: "engine", "Hardfork at step {}.", header_step);
}

if is_invalid_proposer {
info!(target: "engine", "verify_block_external: bad proposer for step: {}", header_step);
Err(EngineError::NotProposer(Mismatch {
Expand Down Expand Up @@ -2453,6 +2365,10 @@ impl Engine<EthereumMachine> for AuthorityRound {
};

let signal_number = finalized_header.number();
if signal_number == 32323259 {
info!(target: "engine", "Skipping validator set change signalled at block {}", signal_number);
return None;
}
info!(target: "engine", "Applying validator set change signalled at block {}", signal_number);

finality_proof.push(finalized_header);
Expand Down

0 comments on commit 8061825

Please sign in to comment.