elective-stereophonic
elective-stereophonic
How to calculate fee for Smart Contract execution
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client: Nxt 1.11.15

Pages: 1 [2]  All

Author Topic: How to calculate fee for Smart Contract execution  (Read 6308 times)

colin012

  • Hero Member
  • *****
  • Karma: +65/-18
  • Offline Offline
  • Posts: 851
  • NXTOrganization Marketing
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #20 on: August 12, 2014, 03:36:30 pm »

As far as collusion goes, if the majority of nodes colluded, then Smart Contracts are the least of our worries as the entire blockchain could be rewritten.

U forgot 90% attack protection. But we'll indeed have problems with colluded nodes if ask them to measure SC execution time, coz they may report time that is 100 times lower and in the result we'll get stalled network.

I see your point. :/
Logged
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬  ▄▀▀▀▀▀▀▀▀▄  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●  nimirum  ●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬ ◖ENDING CENSORSHIP ONLINE◗  ◖ ICO OPEN NOW◗ ▬▬▬

ChuckOne

  • Hero Member
  • *****
  • Karma: +293/-17
  • Offline Offline
  • Posts: 3450
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #21 on: August 12, 2014, 04:32:51 pm »

hmmm..., what if 'heavy' contracts are needed to solve complex problems and the majority nodes are tiny and therefore skipping
them without any manual correction to prevent this? moreover, 'heavy' is relative/individual for each node with different hardware.
not sure an general skip mechanism provides the scaling-margin and flexibility needed to run complex contracts which we can't
anticipate now (or do you mean the absolute execution time per contract or per node in sum?)

A big SC can be splitted into smaller parts. Also main contract of a smart contract is not to solve complex problems.

I think that is a very important statement here. That should be made a guideline for SC development.
Logged

nexern

  • Sr. Member
  • ****
  • Karma: +83/-11
  • Offline Offline
  • Posts: 496
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #22 on: August 12, 2014, 05:08:21 pm »

could be. as long you can ensure atomic operations over those splits, to prevent leaving your cascaded queries->resultsets/triggers inconsistent.
while transactions->commmits/rollbacks are used to solve this on a central rdbms, i am not sure this can be easily mapped with a decentralized
standard db, where the db is just a simple datasink (from nodeview)

iirc erlang (mnesia) is solving this with locks on temporary tables and callbacks, wrapped into a multiphase commit protocol.
but well, since i have no concrete idea how this sql based sc will looks like there i a good chance i am approaching this much too complicated.
Logged

ChuckOne

  • Hero Member
  • *****
  • Karma: +293/-17
  • Offline Offline
  • Posts: 3450
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #23 on: August 13, 2014, 10:14:17 am »

could be. as long you can ensure atomic operations over those splits, to prevent leaving your cascaded queries->resultsets/triggers inconsistent.
while transactions->commmits/rollbacks are used to solve this on a central rdbms, i am not sure this can be easily mapped with a decentralized
standard db, where the db is just a simple datasink (from nodeview)

iirc erlang (mnesia) is solving this with locks on temporary tables and callbacks, wrapped into a multiphase commit protocol.
but well, since i have no concrete idea how this sql based sc will looks like there i a good chance i am approaching this much too complicated.

SQL SELECT will simply create new transactions. Each row in the result table is a new transaction that gets handled like regular ones.
Logged

ChuckOne

  • Hero Member
  • *****
  • Karma: +293/-17
  • Offline Offline
  • Posts: 3450
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #24 on: August 13, 2014, 10:20:20 am »

About costs:

Should not input size, runtime and output size be considered when determining how much to pay for an SC execution?
Logged

nexern

  • Sr. Member
  • ****
  • Karma: +83/-11
  • Offline Offline
  • Posts: 496
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #25 on: August 13, 2014, 11:11:11 am »


SQL SELECT will simply create new transactions. Each row in the result table is a new transaction that gets handled like regular ones.

hm...a select doesn't create any new transaction, don't understand what you mean here.
i am talking about to wrap several atomic write operations (splitted contract->select->update/insert) 
into one commited sql transaction. don't mix the sql transaction with a blockchain transaction.
Logged

wesley

  • Ex-Staff Member
  • Hero Member
  • *****
  • Karma: +204/-3
  • Offline Offline
  • Posts: 1159
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #26 on: August 13, 2014, 11:12:27 am »

The SELECT returns the transactions to be created.
Logged

nexern

  • Sr. Member
  • ****
  • Karma: +83/-11
  • Offline Offline
  • Posts: 496
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #27 on: August 13, 2014, 11:17:55 am »

The SELECT returns the transactions to be created.

a select simple returns DATA which can be used to CREATE a new blockchain transaction
and this create process is the point, not the data fetching.
Logged

ChuckOne

  • Hero Member
  • *****
  • Karma: +293/-17
  • Offline Offline
  • Posts: 3450
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #28 on: August 13, 2014, 10:29:33 pm »

a select simple returns DATA which can be used to CREATE a new blockchain transaction
and this create process is the point, not the data fetching.

What is the issue? CfB's idea mirrors SPARQL's construct statement http://www.w3.org/TR/rdf-sparql-query/#construct

So, what is the point?
Logged

nexern

  • Sr. Member
  • ****
  • Karma: +83/-11
  • Offline Offline
  • Posts: 496
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #29 on: August 13, 2014, 11:03:45 pm »

a select simple returns DATA which can be used to CREATE a new blockchain transaction
and this create process is the point, not the data fetching.

What is the issue? CfB's idea mirrors SPARQL's construct statement http://www.w3.org/TR/rdf-sparql-query/#construct

So, what is the point?

interesting i thought i had read cfb is using/mapping plain SQL 92.
anyway, the point is - spliting contracts could breaks atomicity, because they are running serial and isolated and not within a single call and bounded scope.
don't know if SPARQL provides a rollback for uncompleted inserts or updates sequences but if not, the point is still valid.
Logged

ChuckOne

  • Hero Member
  • *****
  • Karma: +293/-17
  • Offline Offline
  • Posts: 3450
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #30 on: August 14, 2014, 07:15:22 am »

a select simple returns DATA which can be used to CREATE a new blockchain transaction
and this create process is the point, not the data fetching.

What is the issue? CfB's idea mirrors SPARQL's construct statement http://www.w3.org/TR/rdf-sparql-query/#construct

So, what is the point?

interesting i thought i had read cfb is using/mapping plain SQL 92.
anyway, the point is - spliting contracts could breaks atomicity, because they are running serial and isolated and not within a single call and bounded scope.
don't know if SPARQL provides a rollback for uncompleted inserts or updates sequences but if not, the point is still valid.

Well, first it is LIKE SPARQL CONSTRUCT. I thought CfB, though, strive for basic SQL syntax.

Second, yes atomicity is important. Issue here (https://nxtforum.org/smart-contracts/transactions-without-signature/msg81191/#msg81191) goes hand in hand with your question.

When there is no materialization how to check where the execution of an SC ended AND therefore prevent execution of subsequent SCs? I think CfB will need to think about that.
Logged
Pages: 1 [2]  All
 

elective-stereophonic
elective-stereophonic
assembly
assembly