이번 RC 도입은 상당히 일반유저에게 임팩트를 줬습니다.
이것이 장기적으로 어떤 영향을 미치는지 확인해보기 위해서 구현을 확인하면서,
계산에 참조되는 상수값, 함수등을 정리해보고 있는데 내용들은 간간히 공유해보겠습니다.
정리노트
비용 계산 실행 예시
글 작성 (comment_operation)
void operator()( const comment_operation& op )const
{
state_bytes_count +=
_w.comment_object_base_size
+ _w.comment_object_permlink_char_size * op.permlink.size()
+ _w.comment_object_parent_permlink_char_size * op.parent_permlink.size();
execution_time_count += _e.comment_operation_exec_time;
}
- 상태 용량 비용(state_bytes_count)
- comment_object_base_size: 글/댓글 기본 용량 201 * 10000
- 2010000
- comment_object_permlink_char_size: 글/댓글 permlink 1 * 10000
- 10000 * 글자 수
- comment_object_parent_permlink_char_size: 글/댓글 parent_permlink 2 * 10000
- 20000 * 글자 수
- comment_object_base_size: 글/댓글 기본 용량 201 * 10000
- 실행 비용(execution_time_count)
- comment_operation_exec_time
- 114100
- comment_operation_exec_time
글 옵션 설정 (comment_options_operation)
void operator()( const comment_options_operation& op )const
{
for( const comment_options_extension& e : op.extensions )
{
e.visit( *this );
}
execution_time_count += _e.comment_options_operation_exec_time;
}
void operator()( const comment_payout_beneficiaries& bens )const
{
state_bytes_count += _w.comment_object_beneficiaries_member_size * bens.beneficiaries.size();
}
- 상태 용량 비용(state_bytes_count)
- 없음
- 실행 비용(execution_time_count)
- comment_options_operation_exec_time
- 13200
- comment_options_operation_exec_time
- extensions // beneficiaries과 같은 extension을 의미합니다.
- comment_payout_beneficiaries
- comment_object_beneficiaries_member_size: 지정된 beneficiaries 수 18 * 10000
- 180000 * 계정 수
- comment_object_beneficiaries_member_size: 지정된 beneficiaries 수 18 * 10000
- comment_payout_beneficiaries
계정이 보유한 RC
약 15 SP를 기준으로 했습니다.
- 30000 VESTS
계산된 OPS 비용
permlink는 30자 이내, beneficiaries는 1로 가정했습니다.
- 글 작성 상태 용량 비용 : 2010000 + (10000* 30) + (20000 * 30) = 2910000
- 글 작성 실행 비용 : 114100
- 글 옵션 상태 용량 비용 : 180000
- 글 옵션 실행 비용 : 13200
- 총 상태 용량 비용 : 3090000
- 총 실행 비용 : 127300
계산된 트랜잭션 비용
- ? OPS 비용과 RC Params 비용을 계산해야함.
RC POOL 사용 (compute_rc_cost_of_resource)
계산된 비용의 처리 (use_account_rcs)
정리
- 영향을 미치는 요인은 무엇인가?
- 사용 가능한 스팀 파워
- 트랜잭션 내용에 따라 계산된 비용
- RC Param 값
- RC Pool 상태
정보 감사드립니다. :)
우와 정리해주셔서 감사합니다.