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

Add payment support for kv storage #9298

Merged
merged 7 commits into from
Aug 11, 2020
Merged

Conversation

huangminghuang
Copy link
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

Copy link
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

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
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
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
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

@@ -50,6 +50,32 @@ apply_context::apply_context(controller& con, transaction_context& trx_ctx, uint
context_free = trace.context_free;
}

template <typename Excpetion>
Copy link
Contributor

Choose a reason for hiding this comment

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

Exception

counter = 0;
}
if (entry.delta > 0 && entry.account != receiver) {
EOS_ASSERT(not_in_notify_context, Excpetion,
Copy link
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

"${account}",
("resource", resource)
("account", entry.account));
EOS_ASSERT(has_authorization(entry.account), Excpetion,
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

# 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