Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OVMi Part2 AtomicPredicates #154

Merged
merged 19 commits into from
May 15, 2020
Merged

OVMi Part2 AtomicPredicates #154

merged 19 commits into from
May 15, 2020

Conversation

satellitex
Copy link
Contributor

@satellitex satellitex commented May 10, 2020

#153

Implement about BaseAtomicPredicates.
without using signature.(verify_inclusion and is_valid_sginature)

Dependencies

Signatures are handled in a separate PR, as there is a dependency PR here.
paritytech/substrate#6029

Checklist

  • all tests passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • (option)

Affected core subsystem(s)

Description of change


@satellitex satellitex changed the base branch from master to dusty May 10, 2020 11:27
@satellitex satellitex marked this pull request as ready for review May 13, 2020 10:20
@satellitex satellitex requested a review from akru May 13, 2020 12:37
Copy link

@syuhei176 syuhei176 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@akru akru left a comment

Choose a reason for hiding this comment

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

Looks good, I just have one question around external call structure lifetime, is it really needed? Could you check it in comments please.


impl<'a, Ext: ExternalCall> AtomicPredicateInterface<AddressOf<Ext>> for EqualPredicate<'a, Ext> {
fn decide(&self, inputs: Vec<Vec<u8>>) -> ExecResult<AddressOf<Ext>> {
println!(
Copy link
Contributor

Choose a reason for hiding this comment

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

Better use log::debug here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh..
That's a mistake to remove.

use crate::Range;

pub struct IsLessThanPredicate<'a, Ext: ExternalCall> {
pub ext: &'a Ext,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's about to use Arc here instead of a specified lifetime? In my view 'a makes interface a bit dirty.

use crate::Range;

pub struct IsValidSignaturePredicate<'a, Ext: ExternalCall> {
pub ext: &'a Ext,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here too.

@satellitex
Copy link
Contributor Author

@akru
Lifetime annotation prevents the lifetime of each Predicate from being longer than the lifetime of the ext that it has.
Also, since the use of reference counters is costly, I would not like to adopt the above method as long as there is no logic problem with the using lifetime annotation method.

Please let me know if you have any problems.

@akru
Copy link
Contributor

akru commented May 15, 2020

@satellitex Ok, what's about https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/the-anonymous-lifetime.html?

Copy link
Contributor

@akru akru left a comment

Choose a reason for hiding this comment

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

LGTM

@satellitex satellitex merged commit 4db6488 into dusty May 15, 2020
satellitex added a commit that referenced this pull request Jul 8, 2020
* Dusty chainspec upgrade (#155)

* Plasm Network mainnet (#149)

* Plasm Network mainnet genesis

* Bump frame modules

* Added mainnet genesis into subkey

* Added bootnodes

* Bump version in README

* Create feature_task.md (#150)

* Create feature_task.md

* Rename feature_task.md to future_task.md

* Update future_task.md

* Update feature_request.md

* Update feature_request.md

* Update future_task.md

* Update chainspec: dusty2

* fix fmt

Co-authored-by: satellitex <[email protected]>

* update reward functionality

* apply formatting

* use mutate

* separate claim into two methods

* modify tests

* fix overflow

* check if era is valid

* add doc comments

* OVMi Part2 AtomicPredicates (#154)

* WIP: or decidable

* add or

* ovm ext_call is not needed mut

* add all logical and deciable predicates

* WIP: eq

* add AtomicPredicates

* fmt and add lock

* add from_address to executable predicate

* add predicate mock

* fmt

* add tests

* add from_address to executable predicate

* upd lock

* tmp

* fix name

* WIP: is valid signature

* lifetime

* fix lifetime 2

* add staking amounts for each operator

* Plasm lockdrop oracle requests refactoring (#158)

* Using localhost oracle for lockdrop module

* Added small https proxy helper

* Disable lockdrop oracle by default

* Fix fmt

* Add claim into subkey (#164)

* add claim into subkey
g

* use inspect

* fix use v

* reverse use plasm

* Plasma module Part1 (#162)

* WIP: plasma module

* build passed template

* add submit root

* add deploy and first test

* success submit_root test

* passed build commitment

* add rpc call for plasma

* fix for plasm hashing

* add describe plapps_hash

* Upgrade Plasm Node up to substrate 2.0-rc2 (#170)

* Upgrade to substrate 2.0-rc2

* Fix unused imports

* enable dapps staking

* Feature plasma deposit (#171)

* add deposit

* passed build

* add finalize_checkpoint

* WIP: bare_finalize_exit

* WIP deserializer

* WIP: add modules

* WIP

* pssed build

* WIP: fix weight

* fix ovm and plasma

* passed deposit test

* WIP: plasm-deposit

* WIP fix range

* passed until xxx

* assed without finalized

* fix passed test

* fix docker builder (#176)

* Dusty release 1.1.0 (#174)

* Bump version, fix chain specs

* Added legacy storage runtime interface

* Using default child for legacy calls

* Fix compilation & format

* Bump subkey version

* [CI]: bump nix actions version

* Fix implementation name

Co-authored-by: satellitex <[email protected]>
Co-authored-by: t8m8 <[email protected]>
@satellitex satellitex deleted the feature/ovmi-2 branch July 21, 2020 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants