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 6305 times)

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
How to calculate fee for Smart Contract execution
« on: August 10, 2014, 10:36:52 am »

The original idea of calculation of SC execution fee says that the amount is higher if a contract uses more data. This way is not very handy for SC developers coz every day more and more data will be added into the blockchain requiring more and more to pay. At some moment SC may even become non-profitable thus "freezing" itself.

I have another idea. The original approach gives advantage to smart contracts which will be executed anyway, while transactions initiated by humans can be filtered by forgers. What if we go the same route for SCs? Forgers will decide what contracts can be processed. The fee will be fixed per execution, if at some moment it will need more resources for SC execution then forgers will stop processing until the owner of the SC increases the fee.

Important note: forgers will be forced to execute the contracts, they couldn't just include a lot of long-running contract into a block and get a big amount of fees. Every block will contain a hash of SC execution result, this requires extra 40 bytes per contract.

Advantages of my proposal:
- Fixed fee for execution which simplifies logic of money handling
- Smart contracts get no advantages over manually crafted transactions

Disadvantages:
- Theoretically someone could create a contract that will eat a lot of resources, practically it will be filtered by forgers (I'm going to add into NRS the code that will measure time required for execution)

Any feedback?

Edit: One more advantage has come to my mind - a smart contract code will become a single SELECT statement, which in turn will simplify its development and speed up execution (by allowing the RDBMS to create the most optimal execution plan).
« Last Edit: August 10, 2014, 10:51:31 am by Come-from-Beyond »
Logged

semibaron

  • Sr. Member
  • ****
  • Karma: +16/-7
  • Offline Offline
  • Posts: 333
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #1 on: August 10, 2014, 11:08:37 am »

Original approach:

Would the initial fees to start SCs always be the same?
Afterwards each SC will be generating variable costs depending on how much data processed?
Will the variable costs/fees applied every block?


Your approach:

How can forgers decide to not process a SC if they are forced to?
Fees to start a SC will be for all SCs the same?
There would be no variable costs that apply after every block?
If SC takes to much resources forgers can decide to stop processing the SC until higher fees are paid?
Logged

nexern

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

sounds good. having a reference execution time for each contract, or better a realtime node based used resources measurement,
a node/forger could calculate the resource/fee ratio. a node could set his individual min. ratio (based on his hardware capacity) to
filter contracts respectively allow all contracts with a high ratio, means moderate resource usage by fair/profitable execution fee.
in case an expensive and therefore not executed contract is lowering the fee the treshold will snap without any manual action needed.
there should be also something like a white/blacklist, to allow/block specifics contracts in general, in combination with
the above mentioned ratio threshold, contracts could be managed easy without time consuming setups or further maintenance.

so, an api, listing besides general contract infos also the execution fee + execution time + cpu/mem usage for each contract, would be perfect
to calculate this ratio for each node by first call. cpu/mem usage is important also because some nodes could specialize later (with volume) to
contracts with e.g. high i/o usage because they are providing ssd disk, or others nodes could process many high cpu (with tiny execution time)
usage, because due to a massiv multicore node and so on.

just some first thoughts.
Logged

abctc

  • Hero Member
  • *****
  • Karma: +148/-13
  • Offline Offline
  • Posts: 1396
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #3 on: August 10, 2014, 01:33:45 pm »

@ C-f-B
.. transactions initiated by humans can be filtered by forgers.
- in the real life transactions are filtered by Nxt core (for the benefit of current forger). So SC will be filtered by Nxt core too. What rules they will be filtered with?
Продолжение здесь, because I can read in English all texts and books, but can't write good enough.
Logged
Welcome to the Nxt generation of crypto!   Magis quam Moneta (More than a Coin)
"Do not worry, it is an attack" (c) Jean-Luc

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #4 on: August 10, 2014, 06:29:09 pm »

Original approach:

Would the initial fees to start SCs always be the same? -- Yes
Afterwards each SC will be generating variable costs depending on how much data processed? -- Yes
Will the variable costs/fees applied every block? -- Yes


Your approach:

How can forgers decide to not process a SC if they are forced to? -- Yes, er... Forgers r not forced, they can ignore any SC.
Fees to start a SC will be for all SCs the same? -- Yes, minimum fee
There would be no variable costs that apply after every block? -- No
If SC takes to much resources forgers can decide to stop processing the SC until higher fees are paid? -- Yes
Logged

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #5 on: August 10, 2014, 06:40:31 pm »

- in the real life transactions are filtered by Nxt core (for the benefit of current forger). So SC will be filtered by Nxt core too. What rules they will be filtered with?
Продолжение здесь, because I can read in English all texts and books, but can't write good enough.

SCs will be filtered similar to transactions. I'm planning to do it in the following manner:

1. Sort non-blacklisted SCs according to their execution fee in descending order.
2. Execute these SCs one by one.
3. If execution of a particular SC took too much time (could be tuned via user settings) then blacklist it.
4. If more than some amount of time (tuneable) elapsed then stop execution of awaiting SCs.
5. Include SCs that were processed without blacklisting.

Pay attention that it's more profitable to include even those SCs that were executed and blacklisted, but it means that other peers may spend too much time on block validation. This is bad coz forgers that send too resource-consuming blocks will likely be blacklisted and their blocks ignored.
Logged

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #6 on: August 10, 2014, 07:36:12 pm »

After thinking more about situation when a forger may include a lot of "heavy" smart contracts, I see that this issue can be resolved automatically by the anti 90% attack mechanism. If block validation requires too much time the block will be ignored by majority of forgers and another block will replace it.
Logged

nexern

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

After thinking more about situation when a forger may include a lot of "heavy" smart contracts, I see that this issue can be resolved automatically by the anti 90% attack mechanism. If block validation requires too much time the block will be ignored by majority of forgers and another block will replace it.

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?)
Logged

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #8 on: August 10, 2014, 09:04:11 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.
Logged

nexern

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

ok, so an absolute approach and then triggered/cascaded.
do you add some 'resources measurement' now or later for each contract as mentioned above to calculate the ideal avg. and max. load for a node?
Logged

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #10 on: August 10, 2014, 09:27:15 pm »

ok, so an absolute approach and then triggered/cascaded.
do you add some 'resources measurement' now or later for each contract as mentioned above to calculate the ideal avg. and max. load for a node?

Now.
Logged

nexern

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

ok, so an absolute approach and then triggered/cascaded.
do you add some 'resources measurement' now or later for each contract as mentioned above to calculate the ideal avg. and max. load for a node?

Now.

excellent.
Logged

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #12 on: August 11, 2014, 02:45:37 pm »

If the fee was based on data used, how would you measure this data anyway? The number of rows returned by the SELECT? This is not a good measure of how much work the database actually did (and how many records it scanned) to get that result.

The fixed fee approach is simpler in that part at least. Then the challenge is how to come up with a good measure of resource consumption. Not only forgers are more likely to be systems with more memory and faster CPUs and disk, but in the future they may run a different database - PostgreSQL, maybe even on a separate machine, unlike small nodes which will stay with the embedded H2. Then what is fast for the forger may not be fast for the small nodes (which still have to run and validate the SC), and more importantly this difference in speed will not be linear, one SC may be faster than another when executed by PostgreSQL but slower when executed by H2. A very recent example, when trying to optimize the getTransactions query, H2 is able to use the existing index when the query is written using UNION, but not when using OR. If the PostgreSQL query optimizer is smarter, a forger may genuinely believe a given SC contract is fast to execute, while nodes using H2 will have a hard time running it and will blacklist that forger. This may lead to forks forming even in the absence of malicious forgers. And such differences may occur even if using the same database - if the forger has more available memory, and a complex query needs a temporary table which fits in the memory cache on the forger, but gets swapped to disk on a smaller node, again you will see order of magnitude difference between the two.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #13 on: August 11, 2014, 03:02:24 pm »

If the fee was based on data used, how would you measure this data anyway? The number of rows returned by the SELECT? This is not a good measure of how much work the database actually did (and how many records it scanned) to get that result.

Number of rows in a table used by that SELECT. Or multiplication of number of rows for multiple tables.


The fixed fee approach is simpler in that part at least. Then the challenge is how to come up with a good measure of resource consumption. Not only forgers are more likely to be systems with more memory and faster CPUs and disk, but in the future they may run a different database - PostgreSQL, maybe even on a separate machine, unlike small nodes which will stay with the embedded H2. Then what is fast for the forger may not be fast for the small nodes (which still have to run and validate the SC), and more importantly this difference in speed will not be linear, one SC may be faster than another when executed by PostgreSQL but slower when executed by H2. A very recent example, when trying to optimize the getTransactions query, H2 is able to use the existing index when the query is written using UNION, but not when using OR. If the PostgreSQL query optimizer is smarter, a forger may genuinely believe a given SC contract is fast to execute, while nodes using H2 will have a hard time running it and will blacklist that forger. This may lead to forks forming even in the absence of malicious forgers. And such differences may occur even if using the same database - if the forger has more available memory, and a complex query needs a temporary table which fits in the memory cache on the forger, but gets swapped to disk on a smaller node, again you will see order of magnitude difference between the two.

I planned to measure only time required for contract execution. We need to find good balance for current version of NRS, if someone wants to use another RDBMS then they will check that it's not worse than H2 on typical tasks. Also, as time passes, hardware becomes faster and faster, so we can expect that in a year the situation won't become worse.

Transparent Forging requires to increase probability of forks. It was planned to be done via accepting blocks from at least 2 forgers, if Smart Contracts lead to the same effect then we won't need to make forging more complicated.
Logged

colin012

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

Why not give the SC dev the option of choosing to use H2 or a different RDBMS? Or is that what you are saying and I am just not understanding?

Why not make SC fees based on the average speed they execute at on nodes? This would make it so they become MORE profitable as technology develops because they will take less time to execute. This would encourage people to write more efficient Smart Contracts that take up less resources on the nodes.

Or, perhaps this method can be combined with the method of how much data they use so that the fee is balanced? I am sure that it is possible to write an equation that balances the speed at which they will execute as technology develops with the amount of data they use so that the fee will stay balanced over time. This combination of methods adds stability to the price of implementing a Smart Contract while discouraging malicious use of SCs to bloat the blockchain and encouraging SC devs to write SCs that are easy for nodes to handle.
Logged
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬  ▄▀▀▀▀▀▀▀▀▄  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●  nimirum  ●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬ ◖ENDING CENSORSHIP ONLINE◗  ◖ ICO OPEN NOW◗ ▬▬▬

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #15 on: August 11, 2014, 08:49:56 pm »

Why not give the SC dev the option of choosing to use H2 or a different RDBMS? Or is that what you are saying and I am just not understanding?

SC language will work on any RDBMS that support SQL-92 standard.


Why not make SC fees based on the average speed they execute at on nodes?

This speed can't be measured reliably.
Logged

colin012

  • Hero Member
  • *****
  • Karma: +65/-18
  • Offline Offline
  • Posts: 851
  • NXTOrganization Marketing
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #16 on: August 11, 2014, 09:40:17 pm »

Why not give the SC dev the option of choosing to use H2 or a different RDBMS? Or is that what you are saying and I am just not understanding?

SC language will work on any RDBMS that support SQL-92 standard.


Why not make SC fees based on the average speed they execute at on nodes?

This speed can't be measured reliably.

Sure it can, send it to a random sampling nodes to test it. Lets say 60 nodes out of 239 average nodes we have. Given the number of public nodes there are, this sample size will be an provide the average speed the SC runs on a node plus or minus 10.97% which I think is accurate enough. I got the percentage using this calculator: http://americanresearchgroup.com/moe.html
Logged
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬  ▄▀▀▀▀▀▀▀▀▄  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●  nimirum  ●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬ ◖ENDING CENSORSHIP ONLINE◗  ◖ ICO OPEN NOW◗ ▬▬▬

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #17 on: August 11, 2014, 10:09:33 pm »

Sure it can, send it to a random sampling nodes to test it. Lets say 60 nodes out of 239 average nodes we have. Given the number of public nodes there are, this sample size will be an provide the average speed the SC runs on a node plus or minus 10.97% which I think is accurate enough. I got the percentage using this calculator: http://americanresearchgroup.com/moe.html

What if one of the nodes returns value that 10 times less/greater? What if majority of the nodes colluded?
Logged

colin012

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

Sure it can, send it to a random sampling nodes to test it. Lets say 60 nodes out of 239 average nodes we have. Given the number of public nodes there are, this sample size will be an provide the average speed the SC runs on a node plus or minus 10.97% which I think is accurate enough. I got the percentage using this calculator: http://americanresearchgroup.com/moe.html

What if one of the nodes returns value that 10 times less/greater? What if majority of the nodes colluded?

If one is 10 times faster or slower it still stays in that 10% margin of error. And chances are that you won't get all the slowest nodes or all the fastest nodes in one test. Should that happen, it isn't a big deal because whenever the average speed is recalculated it isn't a big deal.

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.
Logged
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬  ▄▀▀▀▀▀▀▀▀▄  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●  nimirum  ●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬ ◖ENDING CENSORSHIP ONLINE◗  ◖ ICO OPEN NOW◗ ▬▬▬

Come-from-Beyond

  • Hero Member
  • *****
  • Karma: +794/-671
  • Offline Offline
  • Posts: 4013
    • View Profile
Re: How to calculate fee for Smart Contract execution
« Reply #19 on: August 12, 2014, 05:47:19 am »

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

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