Skip to content

Commit cc27fc5

Browse files
committed
Merge branch 'dev' into backporting-vm2-fixes
2 parents fcb925a + 0a5d075 commit cc27fc5

27 files changed

Lines changed: 1687 additions & 157 deletions

File tree

execution_engine/CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ All notable changes to this project will be documented in this file. The format
99
[comment]: <> (Fixed: any bug fixes)
1010
[comment]: <> (Security: in case of vulnerabilities)
1111

12+
## 9.0.0
1213

14+
### Added
1315

14-
## [Unreleased] (node 2.0)
16+
* Added `RewardsHandling` support to the execution engine
17+
* Added `RewardsHandling` field to the struct `EngineConfig`
1518

16-
## [Unreleased] (node 2.0)
19+
## 8.0.0
1720

1821
### Added
1922

execution_engine_testing/test_support/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ All notable changes to this project will be documented in this file. The format
99
[comment]: <> (Fixed: any bug fixes)
1010
[comment]: <> (Security: in case of vulnerabilities)
1111

12+
## 9.0.0
1213

14+
### Added
15+
16+
* Added support for `RewardsHandling` to the execution engine testing crate
17+
* Added support for `minimum_delegation_rate` to the execution engine testing crate
1318

1419
## 7.0.1
1520

execution_engine_testing/test_support/src/wasm_test_builder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,9 @@ where
954954
self
955955
}
956956

957-
/// Executes a request to call the system auction contract.
957+
/// This ONLY executes the run_auction logic of the auction. If you are testing
958+
/// specifically that function, this is sufficient. However, to match the standard
959+
/// end of era auction behavior the comprehensive `step` function should be used instead.
958960
pub fn run_auction(
959961
&mut self,
960962
era_end_timestamp_millis: u64,
@@ -974,7 +976,7 @@ where
974976
self.exec(exec_request).expect_success().commit()
975977
}
976978

977-
/// Increments engine state.
979+
/// Increments engine state at end of era (rewards, auction, unbond, etc.).
978980
pub fn step(&mut self, step_request: StepRequest) -> StepResult {
979981
let step_result = self.data_access_layer.step(step_request);
980982

execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3784,9 +3784,7 @@ fn should_not_restake_after_full_unbond() {
37843784

37853785
let withdraws = builder.get_unbonds();
37863786
let unbond_kind = UnbondKind::DelegatedPublicKey(DELEGATOR_1.clone());
3787-
let unbond = withdraws
3788-
.get(&unbond_kind)
3789-
.expect("should have validator entry");
3787+
let unbond = withdraws.get(&unbond_kind).expect("should have entry");
37903788
let delegator_unbond_amount = unbond[0].eras().first().expect("should be era").amount();
37913789

37923790
assert_eq!(

node/src/components/block_synchronizer.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ mod block_acquisition_action;
33
mod block_builder;
44
mod block_synchronizer_progress;
55
mod config;
6-
mod deploy_acquisition;
76
mod error;
87
mod event;
98
mod execution_results_acquisition;
@@ -12,6 +11,7 @@ mod metrics;
1211
mod need_next;
1312
mod peer_list;
1413
mod signature_acquisition;
14+
mod transaction_acquisition;
1515
mod trie_accumulator;
1616

1717
#[cfg(test)]
@@ -588,7 +588,7 @@ impl BlockSynchronizer {
588588
node_id,
589589
Box::new(EmptyValidationMetadata),
590590
)
591-
.event(move |result| Event::DeployFetched {
591+
.event(move |result| Event::TransactionFetched {
592592
block_hash,
593593
result: Either::Left(result),
594594
})
@@ -603,7 +603,7 @@ impl BlockSynchronizer {
603603
node_id,
604604
Box::new(EmptyValidationMetadata),
605605
)
606-
.event(move |result| Event::DeployFetched {
606+
.event(move |result| Event::TransactionFetched {
607607
block_hash,
608608
result: Either::Right(result),
609609
})
@@ -1186,8 +1186,8 @@ impl BlockSynchronizer {
11861186
};
11871187

11881188
if let Some(builder) = self.get_builder(block_hash, false) {
1189-
if let Err(error) = builder.register_deploy(txn.fetch_id(), maybe_peer) {
1190-
error!(%block_hash, %error, "BlockSynchronizer: failed to apply deploy");
1189+
if let Err(error) = builder.register_transaction(txn.fetch_id(), maybe_peer) {
1190+
error!(%block_hash, %error, "BlockSynchronizer: failed to apply transaction");
11911191
}
11921192
}
11931193
}
@@ -1362,7 +1362,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
13621362
| Event::SyncLeapFetched(_)
13631363
| Event::GlobalStateSynced { .. }
13641364
| Event::GotExecutionResultsChecksum { .. }
1365-
| Event::DeployFetched { .. }
1365+
| Event::TransactionFetched { .. }
13661366
| Event::ExecutionResultsFetched { .. }
13671367
| Event::ExecutionResultsStored(_)
13681368
| Event::AccumulatedPeers(_, _)
@@ -1513,7 +1513,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15131513
self.need_next(effect_builder, rng)
15141514
}
15151515
// for both historical and forward sync, post-1.4 blocks track approvals hashes
1516-
// for the deploys they contain
1516+
// for the transactions they contain
15171517
Event::ApprovalsHashesFetched(result) => {
15181518
self.approvals_hashes_fetched(result);
15191519
self.need_next(effect_builder, rng)
@@ -1545,9 +1545,10 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15451545
self.execution_results_stored(block_hash);
15461546
self.need_next(effect_builder, rng)
15471547
}
1548-
// for pre-1.5 blocks we use the legacy deploy fetcher, otherwise we use the deploy
1549-
// fetcher but the results of both are forwarded to this handler
1550-
Event::DeployFetched { block_hash, result } => {
1548+
// for pre-1.5 blocks we use the legacy deploy fetcher, otherwise we use the
1549+
// transaction fetcher but the results of both are forwarded to this
1550+
// handler
1551+
Event::TransactionFetched { block_hash, result } => {
15511552
match result {
15521553
Either::Left(Ok(fetched_legacy_deploy)) => {
15531554
let deploy_id = fetched_legacy_deploy.id();
@@ -1561,7 +1562,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15611562
}
15621563
Either::Left(Err(error)) => {
15631564
if let Some(builder) = self.get_builder(block_hash, false) {
1564-
if builder.waiting_for_deploys() {
1565+
if builder.waiting_for_transactions() {
15651566
builder.latch_decrement();
15661567
}
15671568
}
@@ -1570,12 +1571,12 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15701571
}
15711572
Either::Right(Err(error)) => {
15721573
if let Some(builder) = self.get_builder(block_hash, false) {
1573-
if builder.waiting_for_deploys() {
1574+
if builder.waiting_for_transactions() {
15741575
builder.latch_decrement();
15751576
}
15761577
}
15771578

1578-
debug!(%error, "BlockSynchronizer: failed to fetch deploy");
1579+
debug!(%error, "BlockSynchronizer: failed to fetch transaction");
15791580
}
15801581
};
15811582
self.need_next(effect_builder, rng)

0 commit comments

Comments
 (0)