Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Simplify contract language#66

Merged
garious merged 5 commits intosolana-labs:masterfrom
garious:conditional-plan
Mar 19, 2018
Merged

Simplify contract language#66
garious merged 5 commits intosolana-labs:masterfrom
garious:conditional-plan

Conversation

@garious
Copy link
Copy Markdown
Contributor

@garious garious commented Mar 18, 2018

With these patches, we drop support for transactions of generic assets and instead focus only on tokens. The difference is basically that if you add two tokens, you get another token, whereas if you add two generic assets, you get a set of two assets. Maintaining that subtle difference (unique assets vs anonymous assets) turns out to be more painful than anticipated. I wrote it that way to show off the generality of proof-of-history, but we don't actually need anything that general in the near-term.

garious added 4 commits March 17, 2018 19:56
Proof-of-history is generic, but now that we're using it entirely
for tokens, we can specialize the type and start doing more interesting
things than just Eq and Serialize operations.
And boot recursive spending plans. That path required heap allocations.
Since we don't have a need for this generality right now, reduce the
language to the smallest one that can pass our test suite.
@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 18, 2018

Codecov Report

Merging #66 into master will increase coverage by 0.39%.
The diff coverage is 99.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage   92.65%   93.04%   +0.39%     
==========================================
  Files          14       15       +1     
  Lines        1171     1194      +23     
==========================================
+ Hits         1085     1111      +26     
+ Misses         86       83       -3
Impacted Files Coverage Δ
src/lib.rs 100% <ø> (ø) ⬆️
src/accountant.rs 94.95% <100%> (-0.1%) ⬇️
src/transaction.rs 100% <100%> (+2.22%) ⬆️
src/accountant_skel.rs 92.13% <100%> (ø) ⬆️
src/event.rs 32.14% <100%> (ø) ⬆️
src/accountant_stub.rs 88.42% <100%> (ø) ⬆️
src/plan.rs 99.11% <99.11%> (ø)
src/logger.rs 94.59% <0%> (-0.28%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e054238...434f321. Read the comment docs.

@garious
Copy link
Copy Markdown
Contributor Author

garious commented Mar 18, 2018

Also, the simpler contract language here has fewer edge cases to worry about. You can see in that first commit that I started to go down the route of allowing a spending plan to make multiple payments. That opened up the ability to create a Race spending plan that will pay out on both branches until one completes (that's bad!) I closed that hole by changing the Race instruction to race two Conditions instead of two Plans. It's now safe to add back an instruction for multiple payments, but that's not done here because we don't yet have a hard requirement for that.

@garious garious requested a review from aeyakovenko March 18, 2018 21:36
@garious garious merged commit 4f09e5d into solana-labs:master Mar 19, 2018
bw-solana pushed a commit to bw-solana/solana that referenced this pull request May 13, 2022
steviez pushed a commit to steviez/solana that referenced this pull request Mar 5, 2024
segfaultdoc added a commit to jito-labs/solana that referenced this pull request Aug 7, 2024
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.

2 participants