@@ -917,7 +917,8 @@ void LiteQuery::continue_getLibraries(Ref<ton::validator::MasterchainState> mc_s
917917 mc_state_ = Ref<MasterchainStateQ>(std::move (mc_state));
918918 CHECK (mc_state_.not_null ());
919919
920- auto rconfig = block::ConfigInfo::extract_config (mc_state_->root_cell (), block::ConfigInfo::needLibraries);
920+ auto rconfig = block::ConfigInfo::extract_config (mc_state_->root_cell (), mc_state_->get_block_id (),
921+ block::ConfigInfo::needLibraries);
921922 if (rconfig.is_error ()) {
922923 fatal_error (" cannot extract library list block configuration from masterchain state" );
923924 return ;
@@ -1251,9 +1252,10 @@ bool LiteQuery::make_shard_info_proof(Ref<vm::Cell>& proof, BlockIdExt& blkid, A
12511252 return true ;
12521253}
12531254
1254- bool LiteQuery::make_ancestor_block_proof (Ref<vm::Cell>& proof, Ref<vm::Cell> state_root, const BlockIdExt& old_blkid) {
1255- vm::MerkleProofBuilder mpb{std::move (state_root)};
1256- auto rconfig = block::ConfigInfo::extract_config (mpb.root (), block::ConfigInfo::needPrevBlocks);
1255+ bool LiteQuery::make_ancestor_block_proof (Ref<vm::Cell>& proof, Ref<MasterchainState> mc_state, const BlockIdExt& old_blkid) {
1256+ vm::MerkleProofBuilder mpb{mc_state->root_cell ()};
1257+ auto rconfig =
1258+ block::ConfigInfo::extract_config (mpb.root (), mc_state->get_block_id (), block::ConfigInfo::needPrevBlocks);
12571259 if (rconfig.is_error ()) {
12581260 return fatal_error (
12591261 " cannot extract previous block configuration from masterchain state while constructing Merkle proof for " s +
@@ -1319,13 +1321,12 @@ void LiteQuery::finish_getAccountState(td::BufferSlice shard_proof) {
13191321 vm::AugmentedDictionary accounts_dict{vm::load_cell_slice_ref (sstate.accounts ), 256 , block::tlb::aug_ShardAccounts};
13201322 auto acc_csr = accounts_dict.lookup (acc_addr_);
13211323 if (mode_ & 0x80000000 ) {
1322- auto config = block::ConfigInfo::extract_config (mc_state_->root_cell (), 0xFFFF );
1324+ auto config = block::ConfigInfo::extract_config (mc_state_->root_cell (), mc_state_-> get_block_id (), 0xFFFF );
13231325 if (config.is_error ()) {
13241326 fatal_error (config.move_as_error ());
13251327 return ;
13261328 }
13271329 auto rconfig = config.move_as_ok ();
1328- rconfig->set_block_id_ext (mc_state_->get_block_id ());
13291330 acc_state_promise_.set_value (std::make_tuple (
13301331 std::move (acc_csr), sstate.gen_utime , sstate.gen_lt , std::move (rconfig)
13311332 ));
@@ -1502,7 +1503,7 @@ void LiteQuery::finish_runSmcMethod(td::BufferSlice shard_proof, td::BufferSlice
15021503 LOG (DEBUG) << " creating VM with gas limit " << gas_limit;
15031504 // **** INIT VM ****
15041505 auto r_config = block::ConfigInfo::extract_config (
1505- mc_state_->root_cell (),
1506+ mc_state_->root_cell (), mc_state_-> get_block_id (),
15061507 block::ConfigInfo::needLibraries | block::ConfigInfo::needCapabilities | block::ConfigInfo::needPrevBlocks);
15071508 if (r_config.is_error ()) {
15081509 fatal_error (r_config.move_as_error ());
@@ -1905,7 +1906,7 @@ void LiteQuery::continue_getConfigParams(int mode, std::vector<int> param_list)
19051906 if (mode & block::ConfigInfo::needPrevBlocks) {
19061907 mode |= block::ConfigInfo::needCapabilities;
19071908 }
1908- auto res = block::ConfigInfo::extract_config (mpb.root (), mode);
1909+ auto res = block::ConfigInfo::extract_config (mpb.root (), keyblk ? base_blk_id_ : mc_state_-> get_block_id (), mode);
19091910 if (res.is_error ()) {
19101911 fatal_error (res.move_as_error ());
19111912 return ;
@@ -3045,7 +3046,7 @@ bool LiteQuery::construct_proof_link_back_cont(ton::BlockIdExt cur, ton::BlockId
30453046 return fatal_error (" cannot construct proof for state of masterchain block " s + cur.to_str ());
30463047 }
30473048 // construct proof that `next` is listed in OldMcBlocksInfo of `mc_state_`
3048- if (!make_ancestor_block_proof (state_proof, mc_state_-> root_cell () , next)) {
3049+ if (!make_ancestor_block_proof (state_proof, mc_state_, next)) {
30493050 return fatal_error (" cannot prove that " s + next.to_str () +
30503051 " is in the previous block set of the masterchain state of " + cur.to_str ());
30513052 }
0 commit comments