Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Add payment support for kv storage#9298

Merged
huangminghuang merged 7 commits into
developfrom
huangminghuang/kv-pay
Aug 11, 2020
Merged

Add payment support for kv storage#9298
huangminghuang merged 7 commits into
developfrom
huangminghuang/kv-pay

Conversation

@huangminghuang
Copy link
Copy Markdown
Contributor

Change Description

Allow application developers to choose who pays for resources (feature parity with multi-index table functionality).

EPE-218

Change Type

Select ONE

  • Documentation
  • Stability bug fix
  • Other - special case

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Comment thread libraries/chain/kv_context.cpp Outdated
Comment thread libraries/chain/kv_context.cpp
Copy link
Copy Markdown
Contributor

@jeffreyssmith2nd jeffreyssmith2nd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem to be causing unit test failures

Comment thread libraries/chain/apply_context.cpp Outdated
Comment thread libraries/chain/apply_context.cpp Outdated
void apply_context::update_disk_usage( account_name account, int64_t disk_delta, const storage_usage_trace& trace ) {

if (disk_delta > 0 && !privileged) {
EOS_ASSERT(receiver == act->account, subjective_block_production_exception,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a subjective failure. The similar check in update_db_usage is a subjective mitigation for before RAM_RESTRICTIONS is activated. Since DISK in new, we don't need subjective mitigations and can always apply the restriction. The actual check that you should copy is in exec_one.

Copy link
Copy Markdown
Contributor

@swatanabe-b1 swatanabe-b1 Jul 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behaviour of the check in exec_one is slightly different from the subjective check in update_db_usage. Unless we've decided that that was a mistake it would be better to change exec_one, so the behaviour of DISK matches RAM.

Copy link
Copy Markdown
Contributor

@jeffreyssmith2nd jeffreyssmith2nd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an updated kv_test.wasm file

Comment thread libraries/chain/apply_context.cpp Outdated
context_free = trace.context_free;
}

template <typename Excpetion>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception

Comment thread libraries/chain/apply_context.cpp Outdated
counter = 0;
}
if (entry.delta > 0 && entry.account != receiver) {
EOS_ASSERT(not_in_notify_context, Excpetion,
Copy link
Copy Markdown
Contributor

@jeffreyssmith2nd jeffreyssmith2nd Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Comment thread libraries/chain/apply_context.cpp Outdated
"${account}",
("resource", resource)
("account", entry.account));
EOS_ASSERT(has_authorization(entry.account), Excpetion,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Comment thread libraries/chain/apply_context.cpp
Comment thread libraries/chain/apply_context.cpp
# Conflicts:
#	libraries/chain/include/eosio/chain/exceptions.hpp
@huangminghuang huangminghuang merged commit 2c7e8bf into develop Aug 11, 2020
@huangminghuang huangminghuang deleted the huangminghuang/kv-pay branch August 24, 2020 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants