File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,7 @@ pub fn initialize_contract(
406
406
} ) ?;
407
407
let mut store = Store :: new ( & engine, init_context) ;
408
408
let mut linker = Linker :: new ( & engine) ;
409
+
409
410
// Link in the host interface functions.
410
411
link_host_functions ( & mut linker) ?;
411
412
@@ -499,6 +500,7 @@ pub fn call_function<'a>(
499
500
500
501
// Link in the host interface functions.
501
502
link_host_functions ( & mut linker) ?;
503
+
502
504
let instance = linker
503
505
. instantiate ( & mut store, & module)
504
506
. map_err ( |e| Error :: Wasm ( WasmError :: UnableToLoadModule ( e) ) ) ?;
Original file line number Diff line number Diff line change @@ -827,14 +827,8 @@ fn replay_block(
827
827
block_am. weight ( ) ,
828
828
true ,
829
829
) {
830
- Ok ( ( receipt, _, _) ) => {
831
- if receipt. anchored_block_cost != cost {
832
- println ! ( "Failed processing block! block = {block_id}. Unexpected cost. expected = {cost}, evaluated = {}" ,
833
- receipt. anchored_block_cost) ;
834
- process:: exit ( 1 ) ;
835
- }
836
-
837
- info ! ( "Block processed successfully! block = {block_id}" ) ;
830
+ Ok ( ( _, _, _) ) => {
831
+ info ! ( "Cost check skipped. Block processed successfully! block = {block_id}" ) ;
838
832
}
839
833
Err ( e) => {
840
834
println ! ( "Failed processing block! block = {block_id}, error = {e:?}" ) ;
@@ -1146,15 +1140,6 @@ fn replay_block_nakamoto(
1146
1140
Err ( e) => ( None , Some ( e) ) ,
1147
1141
} ;
1148
1142
1149
- if let Some ( receipt) = ok_opt {
1150
- // check the cost
1151
- let evaluated_cost = receipt. anchored_block_cost . clone ( ) ;
1152
- if evaluated_cost != expected_cost {
1153
- println ! ( "Failed processing block! block = {block_id}. Unexpected cost. expected = {expected_cost}, evaluated = {evaluated_cost}" ) ;
1154
- process:: exit ( 1 ) ;
1155
- }
1156
- }
1157
-
1158
1143
if let Some ( e) = err_opt {
1159
1144
// force rollback
1160
1145
drop ( chainstate_tx) ;
You can’t perform that action at this time.
0 commit comments