BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
proposal_evaluator.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
27 #include <graphene/chain/hardfork.hpp>
28 
29 namespace graphene { namespace chain {
30 
31 namespace detail {
32  void check_asset_options_hf_1774(const fc::time_point_sec& block_time, const asset_options& options);
33 
34  void check_asset_options_hf_bsip_48_75(const fc::time_point_sec& block_time, const asset_options& options);
35  void check_bitasset_options_hf_bsip_48_75(const fc::time_point_sec& block_time, const bitasset_options& options);
37  const asset_update_operation::ext& extensions );
38 
40  const asset_publish_feed_operation::ext& extensions );
41  void check_bitasset_options_hf_bsip77(const fc::time_point_sec& block_time, const bitasset_options& options);
42 
44  const bitasset_options& options); // HF_REMOVABLE
45 
46  void check_asset_options_hf_bsip81(const fc::time_point_sec& block_time, const asset_options& options);
47 
49  const bitasset_options& options); // HF_REMOVABLE
50 
52  const asset_claim_fees_operation& op); // HF_REMOVABLE
53 
54  void check_asset_options_hf_core2281(const fc::time_point_sec& next_maint_time, const asset_options& options);
55  void check_asset_options_hf_core2467(const fc::time_point_sec& next_maint_time, const asset_options& options);
56  void check_bitasset_opts_hf_core2467(const fc::time_point_sec& next_maint_time, const bitasset_options& options);
57 }
58 
60 {
61  typedef void result_type;
62  const database& db;
65 
67  : db( _db ), block_time(bt), next_maintenance_time( db.get_dynamic_global_properties().next_maintenance_time ) {}
68 
69  template<typename T>
70  void operator()(const T &v) const {}
71 
72  // TODO review and cleanup code below after hard fork
73  // hf_1604
75  FC_ASSERT( HARDFORK_CORE_1604_PASSED(block_time), "Operation is not enabled yet" );
76  }
77 
78  // hf_2535
80  if( !HARDFORK_CORE_2535_PASSED(block_time) ) {
81  FC_ASSERT( !op.extensions.value.on_fill.valid(),
82  "The on_fill extension is not allowed until the core-2535 hardfork");
83  }
84  }
85 
92  if( v.bitasset_opts.valid() ) {
98  }
99 
100  // TODO move as many validations as possible to validate() if not triggered before hardfork
101  if( HARDFORK_CORE_2281_PASSED( next_maintenance_time ) )
102  {
104  }
105  else if( HARDFORK_BSIP_48_75_PASSED( block_time ) )
106  {
107  // do not allow the 'disable_collateral_bidding' bit
108  v.common_options.validate_flags( v.bitasset_opts.valid(), false );
109  }
110  }
111 
118 
120 
121  // TODO move as many validations as possible to validate() if not triggered before hardfork
122  if( HARDFORK_CORE_2281_PASSED( next_maintenance_time ) )
123  {
124  v.new_options.validate_flags( true );
125  }
126  else if( HARDFORK_BSIP_48_75_PASSED( block_time ) )
127  {
128  // do not allow the 'disable_collateral_bidding' bit
129  v.new_options.validate_flags( true, false );
130  }
131 
132  }
133 
140  }
141 
144  }
145 
147 
149 
150  }
151 
153  if (block_time < HARDFORK_CORE_1468_TIME) {
154  FC_ASSERT(!op.new_parameters.extensions.value.updatable_htlc_options.valid(),
155  "Unable to set HTLC options before hardfork 1468");
159  }
160  if (!HARDFORK_CORE_1604_PASSED(block_time)) {
162  "Cannot set fees for limit_order_update_operation before its hardfork time");
163  }
164  if (!HARDFORK_BSIP_40_PASSED(block_time)) {
165  FC_ASSERT(!op.new_parameters.extensions.value.custom_authority_options.valid(),
166  "Unable to set Custom Authority Options before hardfork BSIP 40");
168  "Unable to define fees for custom authority operations prior to hardfork BSIP 40");
170  "Unable to define fees for custom authority operations prior to hardfork BSIP 40");
172  "Unable to define fees for custom authority operations prior to hardfork BSIP 40");
173  }
174  if (!HARDFORK_BSIP_85_PASSED(block_time)) {
175  FC_ASSERT(!op.new_parameters.extensions.value.maker_fee_discount_percent.valid(),
176  "Unable to set maker_fee_discount_percent before hardfork BSIP 85");
177  }
178  if (!HARDFORK_BSIP_86_PASSED(block_time)) {
179  FC_ASSERT(!op.new_parameters.extensions.value.market_fee_network_percent.valid(),
180  "Unable to set market_fee_network_percent before hardfork BSIP 86");
181  }
182  if (!HARDFORK_CORE_2103_PASSED(block_time)) {
184  "Unable to define fees for ticket operations prior to hardfork 2103");
186  "Unable to define fees for ticket operations prior to hardfork 2103");
187  }
188  if (!HARDFORK_LIQUIDITY_POOL_PASSED(block_time)) {
190  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
192  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
194  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
196  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
198  "Unable to define fees for liquidity pool operations prior to the LP hardfork");
199  }
200  if (!HARDFORK_CORE_2351_PASSED(block_time)) {
202  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
204  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
206  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
208  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
210  "Unable to define fees for samet fund operations prior to the core-2351 hardfork");
211  }
212  if (!HARDFORK_CORE_2362_PASSED(block_time)) {
214  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
216  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
218  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
220  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
222  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
224  "Unable to define fees for credit offer operations prior to the core-2362 hardfork");
225  }
226  if (!HARDFORK_CORE_2595_PASSED(block_time)) {
228  "Unable to define fees for credit deal update operation prior to the core-2595 hardfork");
229  }
230  if (!HARDFORK_CORE_2604_PASSED(block_time)) {
232  "Unable to define fees for liquidity pool update operation prior to the core-2604 hardfork");
233  }
234  }
236  FC_ASSERT( block_time >= HARDFORK_CORE_1468_TIME, "Not allowed until hardfork 1468" );
237  if (block_time < HARDFORK_CORE_BSIP64_TIME)
238  {
239  // memo field added at harfork BSIP64
240  // NOTE: both of these checks can be removed after hardfork time
241  FC_ASSERT( !op.extensions.value.memo.valid(),
242  "Memo unavailable until after HARDFORK BSIP64");
243  // HASH160 added at hardfork BSIP64
245  "HASH160 unavailable until after HARDFORK BSIP64" );
246  }
247  }
249  FC_ASSERT( block_time >= HARDFORK_CORE_1468_TIME, "Not allowed until hardfork 1468" );
250  }
252  FC_ASSERT( block_time >= HARDFORK_CORE_1468_TIME, "Not allowed until hardfork 1468" );
253  }
255  FC_ASSERT( HARDFORK_BSIP_40_PASSED(block_time), "Not allowed until hardfork BSIP 40" );
256  }
258  FC_ASSERT( HARDFORK_BSIP_40_PASSED(block_time), "Not allowed until hardfork BSIP 40" );
259  }
261  FC_ASSERT( HARDFORK_BSIP_40_PASSED(block_time), "Not allowed until hardfork BSIP 40" );
262  }
264  FC_ASSERT( HARDFORK_CORE_2103_PASSED(block_time), "Not allowed until hardfork 2103" );
265  }
267  FC_ASSERT( HARDFORK_CORE_2103_PASSED(block_time), "Not allowed until hardfork 2103" );
268  }
270  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
271  }
273  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
274  }
276  FC_ASSERT( HARDFORK_CORE_2604_PASSED(block_time), "Not allowed until the core-2604 hardfork" );
277  }
279  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
280  }
282  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
283  }
285  FC_ASSERT( HARDFORK_LIQUIDITY_POOL_PASSED(block_time), "Not allowed until the LP hardfork" );
286  }
288  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
289  }
291  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
292  }
294  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
295  }
297  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
298  }
300  FC_ASSERT( HARDFORK_CORE_2351_PASSED(block_time), "Not allowed until the core-2351 hardfork" );
301  }
303  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
304  }
306  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
307  }
309  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
310  }
312  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
313  if( !HARDFORK_CORE_2595_PASSED(block_time) ) {
314  FC_ASSERT( !op.extensions.value.auto_repay.valid(),
315  "auto_repay unavailable until the core-2595 hardfork");
316  }
317  }
319  FC_ASSERT( HARDFORK_CORE_2362_PASSED(block_time), "Not allowed until the core-2362 hardfork" );
320  }
321  // Note: credit_deal_expired_operation is a virtual operation thus no need to add code here
323  FC_ASSERT( HARDFORK_CORE_2595_PASSED(block_time), "Not allowed until the core-2595 hardfork" );
324  }
325 
326  // loop and self visit in proposals
328  bool already_contains_proposal_update = false;
329 
330  for (const op_wrapper &op : v.proposed_ops)
331  {
332  op.op.visit(*this);
333  // Do not allow more than 1 proposal_update in a proposal
335  {
336  FC_ASSERT( !already_contains_proposal_update,
337  "At most one proposal update can be nested in a proposal!" );
338  already_contains_proposal_update = true;
339  }
340  }
341  }
342 };
343 
344 struct hardfork_visitor_214 // non-recursive proposal visitor
345 {
346  typedef void result_type;
347 
348  template<typename T>
349  void operator()(const T &v) const {}
350 
351  void operator()(const proposal_update_operation &v) const {
352  FC_ASSERT(false, "Not allowed until hardfork 214");
353  }
354 };
355 
357 {
358  if( nested_update_count == 0 || v.proposal.instance.value > max_update_instance )
359  max_update_instance = v.proposal.instance.value;
361 }
362 
364 {
365  if( nested_update_count == 0 || v.proposal.instance.value > max_update_instance )
366  max_update_instance = v.proposal.instance.value;
368 }
369 
370 // loop and self visit in proposals
372 {
373  for (const op_wrapper &op : v.proposed_ops)
374  op.op.visit(*this);
375 }
376 
378 { try {
379  const database& d = db();
380 
381  // Calling the proposal hardfork visitor
382  const fc::time_point_sec block_time = d.head_block_time();
383  proposal_operation_hardfork_visitor vtor( d, block_time );
384  vtor( o );
385  if( block_time < HARDFORK_CORE_214_TIME )
386  {
387  // cannot be removed after hf, unfortunately
388  hardfork_visitor_214 hf214;
389  for( const op_wrapper &op : o.proposed_ops )
390  op.op.visit( hf214 );
391  }
392  vtor_1479( o );
393 
394  const auto& global_parameters = d.get_global_properties().parameters;
395 
396  FC_ASSERT( o.expiration_time > block_time, "Proposal has already expired on creation." );
397  FC_ASSERT( o.expiration_time <= block_time + global_parameters.maximum_proposal_lifetime,
398  "Proposal expiration time is too far in the future." );
400  fc::seconds( *o.review_period_seconds ) < ( o.expiration_time - block_time ),
401  "Proposal review period must be less than its overall lifetime." );
402 
403  // Find all authorities required by the proposed operations
404  flat_set<account_id_type> tmp_required_active_auths;
405  vector<authority> other;
406  for( auto& op : o.proposed_ops )
407  {
408  operation_get_required_authorities( op.op, tmp_required_active_auths, _required_owner_auths, other,
409  MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( block_time ) );
410  }
411  // All accounts which must provide both owner and active authority should be omitted from the
412  // active authority set; owner authority approval implies active authority approval.
413  std::set_difference( tmp_required_active_auths.begin(), tmp_required_active_auths.end(),
415  std::inserter( _required_active_auths, _required_active_auths.begin() ) );
416 
417  // TODO: what about other???
418  FC_ASSERT ( other.empty(),
419  "Proposals containing operations requiring non-account authorities are not yet implemented." );
420 
421  // If we're dealing with the committee authority, make sure this transaction has a sufficient review period.
424  {
426  proposal_create_review_period_required,
427  "Review period not given, but at least ${min} required",
428  ("min", global_parameters.committee_proposal_review_period) );
429  GRAPHENE_ASSERT( *o.review_period_seconds >= global_parameters.committee_proposal_review_period,
430  proposal_create_review_period_insufficient,
431  "Review period of ${t} specified, but at least ${min} required",
432  ("t", *o.review_period_seconds)
433  ("min", global_parameters.committee_proposal_review_period) );
434  }
435 
436  for( const op_wrapper& op : o.proposed_ops )
437  _proposed_trx.operations.push_back( op.op );
438 
440 
441  return void_result();
442 } FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE
443 
445 { try {
446  database& d = db();
447  auto chain_time = d.head_block_time();
448 
449  const proposal_object& proposal = d.create<proposal_object>( [&o, this, chain_time](proposal_object& proposal) {
452  proposal.expiration_time = o.expiration_time;
453  proposal.proposer = o.fee_paying_account;
454  if( o.review_period_seconds )
455  proposal.review_period_time = o.expiration_time - *o.review_period_seconds;
456 
457  //Populate the required approval sets
458  proposal.required_owner_approvals.insert( _required_owner_auths.begin(), _required_owner_auths.end() );
460 
461  if( chain_time > HARDFORK_CORE_1479_TIME )
463  "Cannot update/delete a proposal with a future id!" );
464  else if( vtor_1479.nested_update_count > 0 && proposal.id.instance() <= vtor_1479.max_update_instance )
465  {
466  // Note: This happened on mainnet, proposal 1.10.17503
467  // prevent approval
468  transfer_operation top;
472  proposal.proposed_transaction.operations.emplace_back( top );
473  }
474  });
475 
476  return proposal.id;
477 } FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE
478 
480 { try {
481  database& d = db();
482 
483  _proposal = &o.proposal(d);
484 
487  "This proposal is in its review period. No new approvals may be added." );
488 
489  for( account_id_type id : o.active_approvals_to_remove )
490  {
492  "", ("id", id)("available", _proposal->available_active_approvals) );
493  }
494  for( account_id_type id : o.owner_approvals_to_remove )
495  {
497  "", ("id", id)("available", _proposal->available_owner_approvals) );
498  }
499 
500  return void_result();
501 } FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE
502 
504 { try {
505  database& d = db();
506 
507  // Potential optimization: if _executed_proposal is true, we can skip the modify step and make push_proposal
508  // skip signature checks. This isn't done now because I just wrote all the proposals code, and I'm not yet
509  // 100% sure the required approvals are sufficient to authorize the transaction.
510  d.modify(*_proposal, [&o](proposal_object& p) {
513  for( account_id_type id : o.active_approvals_to_remove )
514  p.available_active_approvals.erase(id);
515  for( account_id_type id : o.owner_approvals_to_remove )
516  p.available_owner_approvals.erase(id);
517  for( const auto& id : o.key_approvals_to_add )
518  p.available_key_approvals.insert(id);
519  for( const auto& id : o.key_approvals_to_remove )
520  p.available_key_approvals.erase(id);
521  });
522 
523  // If the proposal has a review period, don't bother attempting to authorize/execute it.
524  // Proposals with a review period may never be executed except at their expiration.
526  return void_result();
527 
529  {
530  // All required approvals are satisfied. Execute!
531  _executed_proposal = true;
532  try {
534  } catch(fc::exception& e) {
535  d.modify(*_proposal, [&e](proposal_object& p) {
537  });
538  wlog("Proposed transaction ${id} failed to apply once approved with exception:\n"
539  "----\n${reason}\n----\nWill try again when it expires.",
540  ("id", o.proposal)("reason", e.to_detail_string()));
541  _proposal_failed = true;
542  }
543  }
544 
545  return void_result();
546 } FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE
547 
549 { try {
550  database& d = db();
551 
552  _proposal = &o.proposal(d);
553 
554  auto required_approvals = o.using_owner_authority? &_proposal->required_owner_approvals
556  FC_ASSERT( required_approvals->find(o.fee_paying_account) != required_approvals->end(),
557  "Provided authority is not authoritative for this proposal.",
558  ("provided", o.fee_paying_account)("required", *required_approvals));
559 
560  return void_result();
561 } FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE
562 
564 { try {
565  db().remove(*_proposal);
566 
567  return void_result();
568 } FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE
569 
570 
571 } } // graphene::chain
GRAPHENE_MAX_SHARE_SUPPLY
constexpr int64_t GRAPHENE_MAX_SHARE_SUPPLY(1000000000000000LL)
graphene::chain::proposal_operation_hardfork_visitor::block_time
const fc::time_point_sec block_time
Definition: proposal_evaluator.cpp:63
graphene::chain::proposal_delete_evaluator::do_apply
void_result do_apply(const proposal_delete_operation &)
Definition: proposal_evaluator.cpp:563
graphene::protocol::transaction::operations
vector< operation > operations
Definition: transaction.hpp:89
graphene::protocol::proposal_update_operation
The proposal_update_operation updates an existing transaction proposal.
Definition: proposal.hpp:119
FC_CAPTURE_AND_RETHROW
#define FC_CAPTURE_AND_RETHROW(...)
Definition: exception.hpp:479
graphene::protocol::credit_offer_accept_operation::extensions
extension< ext > extensions
Extensions.
Definition: credit_offer.hpp:153
graphene::protocol::proposal_update_operation::key_approvals_to_remove
flat_set< public_key_type > key_approvals_to_remove
Definition: proposal.hpp:134
graphene::db::object::id
object_id_type id
Definition: object.hpp:69
graphene::chain::proposal_delete_evaluator::_proposal
const proposal_object * _proposal
Definition: proposal_evaluator.hpp:87
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::proposal_create_operation &v) const
Definition: proposal_evaluator.cpp:327
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::asset_update_bitasset_operation &v) const
Definition: proposal_evaluator.cpp:134
graphene::chain::detail::check_bitasset_options_hf_bsip77
void check_bitasset_options_hf_bsip77(const fc::time_point_sec &block_time, const bitasset_options &options)
Definition: asset_evaluator.cpp:121
GRAPHENE_RELAXED_COMMITTEE_ACCOUNT
#define GRAPHENE_RELAXED_COMMITTEE_ACCOUNT
Represents the current committee members.
Definition: config.hpp:144
graphene::chain::proposal_update_evaluator::do_evaluate
void_result do_evaluate(const proposal_update_operation &o)
Definition: proposal_evaluator.cpp:479
graphene::protocol::transfer_operation::amount
asset amount
The amount of asset to transfer from from to to.
Definition: transfer.hpp:58
graphene::chain::database
tracks the blockchain state in an extensible manner
Definition: database.hpp:70
graphene::chain::proposal_object::available_owner_approvals
flat_set< account_id_type > available_owner_approvals
Definition: proposal_object.hpp:49
graphene::chain::detail::check_asset_options_hf_core2467
void check_asset_options_hf_core2467(const fc::time_point_sec &next_maint_time, const asset_options &options)
Definition: asset_evaluator.cpp:161
graphene::protocol::samet_fund_delete_operation
Delete a SameT Fund object.
Definition: samet_fund.hpp:56
wlog
#define wlog(FORMAT,...)
Definition: logger.hpp:123
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::htlc_redeem_operation &) const
Definition: proposal_evaluator.cpp:248
graphene::chain::detail::check_bitasset_options_hf_bsip87
void check_bitasset_options_hf_bsip87(const fc::time_point_sec &block_time, const bitasset_options &options)
Definition: asset_evaluator.cpp:130
graphene::chain::detail::check_asset_update_extensions_hf_bsip_48_75
void check_asset_update_extensions_hf_bsip_48_75(const fc::time_point_sec &block_time, const asset_update_operation::ext &extensions)
Definition: asset_evaluator.cpp:95
graphene::protocol::proposal_delete_operation::proposal
proposal_id_type proposal
Definition: proposal.hpp:163
fc::exception
Used to generate a useful error report when an exception is thrown.
Definition: exception.hpp:56
fc::log_level::all
@ all
Definition: log_message.hpp:34
graphene::chain::database::head_block_time
time_point_sec head_block_time() const
Definition: db_getter.cpp:67
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::credit_deal_repay_operation &) const
Definition: proposal_evaluator.cpp:318
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const T &v) const
Definition: proposal_evaluator.cpp:70
graphene::chain::hardfork_visitor_214
Definition: proposal_evaluator.cpp:344
graphene::protocol::ticket_create_operation
Creates a new ticket.
Definition: ticket.hpp:47
graphene::chain::detail::check_asset_claim_fees_hardfork_87_74_collatfee
void check_asset_claim_fees_hardfork_87_74_collatfee(const fc::time_point_sec &block_time, const asset_claim_fees_operation &op)
Definition: asset_evaluator.cpp:138
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::custom_authority_update_operation &) const
Definition: proposal_evaluator.cpp:257
graphene::chain::proposal_update_evaluator::_processed_transaction
processed_transaction _processed_transaction
Definition: proposal_evaluator.hpp:74
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::asset_publish_feed_operation &v) const
Definition: proposal_evaluator.cpp:146
database.hpp
graphene::protocol::credit_deal_repay_operation
Repay a credit deal.
Definition: credit_offer.hpp:163
graphene::chain::proposal_object::expiration_time
time_point_sec expiration_time
Definition: proposal_object.hpp:43
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::samet_fund_create_operation &) const
Definition: proposal_evaluator.cpp:287
graphene::protocol::credit_offer_create_operation
Create a new credit offer.
Definition: credit_offer.hpp:36
graphene::protocol::htlc_redeem_operation
Definition: htlc.hpp:90
proposal_evaluator.hpp
graphene::chain::detail::check_asset_options_hf_core2281
void check_asset_options_hf_core2281(const fc::time_point_sec &next_maint_time, const asset_options &options)
Definition: asset_evaluator.cpp:147
graphene::protocol::custom_authority_create_operation
Create a new custom authority.
Definition: custom_authority.hpp:36
graphene::protocol::liquidity_pool_exchange_operation
Exchange with a liquidity pool.
Definition: liquidity_pool.hpp:138
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::asset_create_operation &v) const
Definition: proposal_evaluator.cpp:86
graphene::chain::proposal_create_evaluator::_required_active_auths
flat_set< account_id_type > _required_active_auths
Definition: proposal_evaluator.hpp:59
graphene::chain::global_property_object::parameters
chain_parameters parameters
Definition: global_property_object.hpp:44
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::liquidity_pool_create_operation &) const
Definition: proposal_evaluator.cpp:269
graphene::protocol::asset_claim_fees_operation
used to transfer accumulated fees back to the issuer's balance.
Definition: asset_ops.hpp:529
graphene::chain::proposal_create_evaluator::do_evaluate
void_result do_evaluate(const proposal_create_operation &o)
Definition: proposal_evaluator.cpp:377
graphene::chain::proposal_operation_hardfork_visitor::result_type
void result_type
Definition: proposal_evaluator.cpp:61
graphene::protocol::asset_create_operation::bitasset_opts
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued.
Definition: asset_ops.hpp:217
graphene::protocol::transaction::expiration
fc::time_point_sec expiration
Definition: transaction.hpp:87
graphene::chain::hardfork_visitor_214::operator()
void operator()(const proposal_update_operation &v) const
Definition: proposal_evaluator.cpp:351
graphene::db::object_database::create
const T & create(F &&constructor)
Definition: object_database.hpp:63
graphene::chain::proposal_create_evaluator::_required_owner_auths
flat_set< account_id_type > _required_owner_auths
Definition: proposal_evaluator.hpp:60
graphene::chain::proposal_update_evaluator::do_apply
void_result do_apply(const proposal_update_operation &o)
Definition: proposal_evaluator.cpp:503
graphene::protocol::credit_offer_delete_operation
Delete a credit offer.
Definition: credit_offer.hpp:70
graphene::protocol::liquidity_pool_create_operation
Create a new liquidity pool.
Definition: liquidity_pool.hpp:34
graphene::chain::database::push_proposal
processed_transaction push_proposal(const proposal_object &proposal)
Definition: db_block.cpp:336
proposal_object.hpp
graphene::protocol::proposal_update_operation::owner_approvals_to_add
flat_set< account_id_type > owner_approvals_to_add
Definition: proposal.hpp:131
graphene::chain::detail::check_asset_options_hf_bsip81
void check_asset_options_hf_bsip81(const fc::time_point_sec &block_time, const asset_options &options)
Definition: asset_evaluator.cpp:58
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::credit_offer_accept_operation &op) const
Definition: proposal_evaluator.cpp:311
graphene::chain::proposal_object::proposed_transaction
transaction proposed_transaction
Definition: proposal_object.hpp:45
fc::seconds
microseconds seconds(int64_t s)
Definition: time.hpp:34
graphene::protocol::asset_update_operation::extensions
extension< ext > extensions
Definition: asset_ops.hpp:377
graphene::chain::proposal_object::proposer
account_id_type proposer
Definition: proposal_object.hpp:51
graphene::chain::hardfork_visitor_1479::operator()
void operator()(const T &v) const
Definition: proposal_evaluator.hpp:40
graphene::protocol::samet_fund_borrow_operation
Borrow from a SameT Fund.
Definition: samet_fund.hpp:94
graphene::chain::proposal_object::available_key_approvals
flat_set< public_key_type > available_key_approvals
Definition: proposal_object.hpp:50
graphene::protocol::proposal_update_operation::key_approvals_to_add
flat_set< public_key_type > key_approvals_to_add
Definition: proposal.hpp:133
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::samet_fund_borrow_operation &) const
Definition: proposal_evaluator.cpp:296
graphene::protocol::samet_fund_create_operation
Create a new SameT Fund object.
Definition: samet_fund.hpp:36
graphene::protocol::samet_fund_update_operation
Update a SameT Fund object.
Definition: samet_fund.hpp:74
graphene::protocol::op_wrapper::op
operation op
Definition: operations.hpp:156
graphene::protocol::htlc_create_operation
Definition: htlc.hpp:45
graphene::protocol::liquidity_pool_withdraw_operation
Withdraw from a liquidity pool.
Definition: liquidity_pool.hpp:114
graphene::protocol::custom_authority_delete_operation
Delete a custom authority.
Definition: custom_authority.hpp:107
graphene::protocol::asset_publish_feed_operation::extensions
extension< ext > extensions
Definition: asset_ops.hpp:476
graphene::db::object_id_type::instance
uint64_t instance() const
Definition: object_id.hpp:49
graphene::chain::proposal_object::is_authorized_to_execute
bool is_authorized_to_execute(database &db) const
Definition: proposal_object.cpp:34
graphene::chain::proposal_operation_hardfork_visitor::next_maintenance_time
const fc::time_point_sec next_maintenance_time
Definition: proposal_evaluator.cpp:64
graphene::protocol::asset_update_bitasset_operation::new_options
bitasset_options new_options
Definition: asset_ops.hpp:406
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::htlc_extend_operation &) const
Definition: proposal_evaluator.cpp:251
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::credit_offer_update_operation &) const
Definition: proposal_evaluator.cpp:308
graphene::chain::detail::check_bitasset_options_hf_bsip_48_75
void check_bitasset_options_hf_bsip_48_75(const fc::time_point_sec &block_time, const bitasset_options &options)
Definition: asset_evaluator.cpp:80
graphene::protocol::limit_order_create_operation::extensions
extensions_type extensions
Definition: market.hpp:100
graphene::protocol::asset_update_operation
Update options common to all assets.
Definition: asset_ops.hpp:351
graphene::chain::proposal_update_evaluator::_executed_proposal
bool _executed_proposal
Definition: proposal_evaluator.hpp:75
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::ticket_create_operation &) const
Definition: proposal_evaluator.cpp:263
fc::optional::valid
bool valid() const
Definition: optional.hpp:186
graphene::protocol::chain_parameters::extensions
extension< ext > extensions
Definition: chain_parameters.hpp:90
graphene::protocol::ticket_update_operation
Updates an existing ticket.
Definition: ticket.hpp:66
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::asset_update_operation &v) const
Definition: proposal_evaluator.cpp:112
graphene::protocol::limit_order_update_operation
Definition: market.hpp:117
graphene::protocol::credit_offer_accept_operation
Accept a credit offer, thereby creating a credit deal.
Definition: credit_offer.hpp:135
fc::time_point_sec
Definition: time.hpp:74
graphene::chain::detail::check_asset_publish_feed_extensions_hf_bsip77
void check_asset_publish_feed_extensions_hf_bsip77(const fc::time_point_sec &block_time, const asset_publish_feed_operation::ext &extensions)
Definition: asset_evaluator.cpp:109
graphene::chain::detail::check_asset_options_hf_bsip_48_75
void check_asset_options_hf_bsip_48_75(const fc::time_point_sec &block_time, const asset_options &options)
Definition: asset_evaluator.cpp:68
fc::exception::to_string
std::string to_string(log_level ll=log_level::info) const
Definition: exception.cpp:227
graphene::protocol::transfer_operation
Transfers an amount of one asset from one account to another.
Definition: transfer.hpp:45
graphene::chain::proposal_operation_hardfork_visitor::db
const database & db
Definition: proposal_evaluator.cpp:62
graphene::chain::proposal_update_evaluator::_proposal_failed
bool _proposal_failed
Definition: proposal_evaluator.hpp:76
graphene::protocol::liquidity_pool_deposit_operation
Deposit to a liquidity pool.
Definition: liquidity_pool.hpp:94
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::liquidity_pool_deposit_operation &) const
Definition: proposal_evaluator.cpp:278
graphene::protocol::committee_member_update_global_parameters_operation::new_parameters
chain_parameters new_parameters
Definition: committee_member.hpp:89
graphene::protocol::custom_authority_update_operation
Update a custom authority.
Definition: custom_authority.hpp:70
fc::exception::to_detail_string
std::string to_detail_string(log_level ll=log_level::all) const
Definition: exception.cpp:183
graphene::protocol::asset_update_bitasset_operation
Update options specific to BitAssets.
Definition: asset_ops.hpp:398
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::asset_claim_fees_operation &v) const
Definition: proposal_evaluator.cpp:142
graphene::chain::proposal_update_evaluator::_proposal
const proposal_object * _proposal
Definition: proposal_evaluator.hpp:73
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::samet_fund_delete_operation &) const
Definition: proposal_evaluator.cpp:290
graphene::protocol::transfer_operation::to
account_id_type to
Account to transfer asset to.
Definition: transfer.hpp:56
graphene::protocol::asset_publish_feed_operation
Publish price feeds for market-issued assets.
Definition: asset_ops.hpp:462
graphene::protocol::proposal_update_operation::active_approvals_to_add
flat_set< account_id_type > active_approvals_to_add
Definition: proposal.hpp:129
graphene::protocol::proposal_create_operation::expiration_time
time_point_sec expiration_time
Definition: proposal.hpp:80
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::ticket_update_operation &) const
Definition: proposal_evaluator.cpp:266
GRAPHENE_COMMITTEE_ACCOUNT
#define GRAPHENE_COMMITTEE_ACCOUNT
Definition: config.hpp:140
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::samet_fund_repay_operation &) const
Definition: proposal_evaluator.cpp:299
graphene::chain::proposal_create_evaluator::do_apply
object_id_type do_apply(const proposal_create_operation &o)
Definition: proposal_evaluator.cpp:444
graphene::protocol::transfer_operation::from
account_id_type from
Account to transfer asset from.
Definition: transfer.hpp:54
graphene::chain::proposal_operation_hardfork_visitor::proposal_operation_hardfork_visitor
proposal_operation_hardfork_visitor(const database &_db, const fc::time_point_sec bt)
Definition: proposal_evaluator.cpp:66
graphene::chain::generic_evaluator::db
database & db() const
Definition: evaluator.cpp:39
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::custom_authority_delete_operation &) const
Definition: proposal_evaluator.cpp:260
graphene::chain::detail::check_asset_options_hf_1774
void check_asset_options_hf_1774(const fc::time_point_sec &block_time, const asset_options &options)
Definition: asset_evaluator.cpp:39
graphene::protocol::proposal_delete_operation
The proposal_delete_operation deletes an existing transaction proposal.
Definition: proposal.hpp:156
graphene::protocol::operation_get_required_authorities
void operation_get_required_authorities(const operation &op, flat_set< account_id_type > &active, flat_set< account_id_type > &owner, vector< authority > &other, bool ignore_custom_operation_required_auths)
Definition: operations.cpp:103
graphene::protocol::committee_member_update_global_parameters_operation
Used by committee_members to update the global parameters of the blockchain.
Definition: committee_member.hpp:84
graphene::protocol::htlc_create_operation::preimage_hash
htlc_hash preimage_hash
Definition: htlc.hpp:61
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::credit_offer_create_operation &) const
Definition: proposal_evaluator.cpp:302
graphene::protocol::asset_update_operation::new_options
asset_options new_options
Definition: asset_ops.hpp:376
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::liquidity_pool_withdraw_operation &) const
Definition: proposal_evaluator.cpp:281
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::limit_order_update_operation &) const
Definition: proposal_evaluator.cpp:74
graphene::protocol::proposal_delete_operation::using_owner_authority
bool using_owner_authority
Definition: proposal.hpp:161
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::limit_order_create_operation &op) const
Definition: proposal_evaluator.cpp:79
graphene::protocol::liquidity_pool_update_operation
Update a liquidity pool.
Definition: liquidity_pool.hpp:74
graphene::protocol::transaction::validate
virtual void validate() const
Definition: transaction.cpp:58
graphene::protocol::chain_parameters::current_fees
std::shared_ptr< const fee_schedule > current_fees
current schedule of fees
Definition: chain_parameters.hpp:49
fc::static_variant::is_type
bool is_type() const
Definition: static_variant.hpp:332
graphene::protocol::asset_options::validate_flags
void validate_flags(bool is_market_issued, bool allow_disable_collateral_bid=true) const
Definition: asset_ops.cpp:312
graphene::chain::proposal_delete_evaluator::do_evaluate
void_result do_evaluate(const proposal_delete_operation &o)
Definition: proposal_evaluator.cpp:548
graphene::protocol::proposal_delete_operation::fee_paying_account
account_id_type fee_paying_account
Definition: proposal.hpp:160
graphene::protocol::asset_create_operation::common_options
asset_options common_options
Definition: asset_ops.hpp:215
graphene::db::object_id_type
Definition: object_id.hpp:30
graphene::protocol::credit_deal_update_operation
Update a credit deal.
Definition: credit_offer.hpp:215
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::committee_member_update_global_parameters_operation &op) const
Definition: proposal_evaluator.cpp:152
graphene::protocol::liquidity_pool_delete_operation
Delete a liquidity pool.
Definition: liquidity_pool.hpp:56
graphene::protocol::credit_deal_expired_operation
A credit deal expired without being fully repaid.
Definition: credit_offer.hpp:184
graphene::protocol::proposal_update_operation::owner_approvals_to_remove
flat_set< account_id_type > owner_approvals_to_remove
Definition: proposal.hpp:132
graphene::chain::hardfork_visitor_1479::nested_update_count
uint64_t nested_update_count
Definition: proposal_evaluator.hpp:37
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::samet_fund_update_operation &) const
Definition: proposal_evaluator.cpp:293
graphene::chain::proposal_create_evaluator::_proposed_trx
transaction _proposed_trx
Definition: proposal_evaluator.hpp:58
graphene::chain::proposal_object::required_active_approvals
flat_set< account_id_type > required_active_approvals
Definition: proposal_object.hpp:46
graphene::protocol::op_wrapper
necessary to support nested operations inside the proposal_create_operation
Definition: operations.hpp:153
graphene::chain::proposal_object::required_owner_approvals
flat_set< account_id_type > required_owner_approvals
Definition: proposal_object.hpp:48
graphene::protocol::proposal_update_operation::active_approvals_to_remove
flat_set< account_id_type > active_approvals_to_remove
Definition: proposal.hpp:130
graphene::protocol::htlc_extend_operation
Definition: htlc.hpp:153
graphene::protocol::limit_order_create_operation
instructs the blockchain to attempt to sell one asset for another
Definition: market.hpp:72
graphene::protocol::samet_fund_repay_operation
Repay to a SameT Fund.
Definition: samet_fund.hpp:113
GRAPHENE_NULL_ACCOUNT
#define GRAPHENE_NULL_ACCOUNT
Represents the canonical account with NO authority (nobody can access funds in null account)
Definition: config.hpp:146
fc::log_level
Definition: log_message.hpp:23
graphene::protocol::proposal_create_operation::review_period_seconds
optional< uint32_t > review_period_seconds
Definition: proposal.hpp:81
fc::static_variant::visit
visitor::result_type visit(visitor &v)
Definition: static_variant.hpp:256
graphene::chain::database::get_global_properties
const global_property_object & get_global_properties() const
Definition: db_getter.cpp:47
graphene::protocol::proposal_update_operation::proposal
proposal_id_type proposal
Definition: proposal.hpp:128
graphene::chain::proposal_object::available_active_approvals
flat_set< account_id_type > available_active_approvals
Definition: proposal_object.hpp:47
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::credit_offer_delete_operation &) const
Definition: proposal_evaluator.cpp:305
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::liquidity_pool_update_operation &) const
Definition: proposal_evaluator.cpp:275
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::liquidity_pool_delete_operation &) const
Definition: proposal_evaluator.cpp:272
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::htlc_create_operation &op) const
Definition: proposal_evaluator.cpp:235
graphene::protocol::proposal_create_operation::proposed_ops
vector< op_wrapper > proposed_ops
Definition: proposal.hpp:79
graphene::chain::hardfork_visitor_1479::max_update_instance
uint64_t max_update_instance
Definition: proposal_evaluator.hpp:36
fc::hash160
Definition: hash160.hpp:32
graphene::protocol::asset
Definition: asset.hpp:31
GRAPHENE_ASSERT
#define GRAPHENE_ASSERT(expr, exc_type, FORMAT,...)
Definition: exceptions.hpp:28
graphene::protocol::void_result
Definition: base.hpp:86
graphene::db::object_database::remove
void remove(const object &obj)
Definition: object_database.hpp:97
graphene::protocol::proposal_create_operation
The proposal_create_operation creates a transaction proposal, for use in multi-sig scenarios.
Definition: proposal.hpp:70
graphene::chain::detail::check_bitasset_options_hf_bsip74
void check_bitasset_options_hf_bsip74(const fc::time_point_sec &block_time, const bitasset_options &options)
Definition: asset_evaluator.cpp:49
graphene::chain::proposal_object
tracks the approval of a partially approved transaction
Definition: proposal_object.hpp:40
graphene::protocol::htlc_create_operation::extensions
extension< additional_options_type > extensions
Definition: htlc.hpp:72
graphene::chain::proposal_object::review_period_time
optional< time_point_sec > review_period_time
Definition: proposal_object.hpp:44
graphene::chain::proposal_object::fail_reason
std::string fail_reason
Definition: proposal_object.hpp:52
graphene::chain::hardfork_visitor_214::result_type
void result_type
Definition: proposal_evaluator.cpp:346
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::credit_deal_update_operation &) const
Definition: proposal_evaluator.cpp:322
graphene::protocol::credit_offer_update_operation
Update a credit offer.
Definition: credit_offer.hpp:88
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::custom_authority_create_operation &) const
Definition: proposal_evaluator.cpp:254
graphene::chain::proposal_operation_hardfork_visitor
Definition: proposal_evaluator.cpp:59
graphene::chain::proposal_operation_hardfork_visitor::operator()
void operator()(const graphene::chain::liquidity_pool_exchange_operation &) const
Definition: proposal_evaluator.cpp:284
graphene
Definition: api.cpp:48
graphene::chain::proposal_create_evaluator::vtor_1479
hardfork_visitor_1479 vtor_1479
Definition: proposal_evaluator.hpp:62
graphene::chain::hardfork_visitor_214::operator()
void operator()(const T &v) const
Definition: proposal_evaluator.cpp:349
graphene::protocol::extension::value
T value
Definition: ext.hpp:40
graphene::protocol::asset_create_operation
Definition: asset_ops.hpp:192
graphene::db::object_database::modify
void modify(const T &obj, const Lambda &m)
Definition: object_database.hpp:99
graphene::chain::detail::check_bitasset_opts_hf_core2467
void check_bitasset_opts_hf_core2467(const fc::time_point_sec &next_maint_time, const bitasset_options &options)
Definition: asset_evaluator.cpp:173