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

TTL Implementation #261

Merged
merged 37 commits into from
Dec 2, 2019
Merged

TTL Implementation #261

merged 37 commits into from
Dec 2, 2019

Conversation

yeastplume
Copy link
Member

@yeastplume yeastplume commented Nov 28, 2019

This provides the implementation of TTL functionality within the wallet API. Note that this PR doesn't yet add the TTL to the command line client or add any default values (which likely need a bit of further discussion).

Changes Are:

  • TTL Field as it appears in the slate is now an Option, meant to specify the block height at which a transaction should not be further processed.
  • All functions that process a transaction, recieve_tx, finalize etc now do a check for the TTL value before continuing processing. Note the wallet uses the stored last confirmed height for this value as opposed to calling out to the server to get the value (so as not to create a dependency on a node running in order to transact)
  • The wallet update process now cancels all transactions for which the TTL has expired (this check is actually done against a running node)
  • InitTxParams now has a ttl_blocks field specifying the number of blocks from current to set slate's TTL.

@@ -64,8 +64,8 @@ fn check_middleware(
}
if let Some(s) = slate {
if s.version_info.version < CURRENT_SLATE_VERSION
|| (bhv == 2 && s.version_info.block_header_version != 2)
|| (bhv > 2 && s.version_info.block_header_version < GRIN_BLOCK_HEADER_VERSION)
|| (bhv == 3 && s.version_info.block_header_version != 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since txns from block header 2 are compatible with those from block header version 3, you can just remove line 67. We only needed that logic because of the bulletproof serialization changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@yeastplume yeastplume changed the title [WIP] TTL Implementation TTL Implementation Dec 1, 2019
@yeastplume yeastplume merged commit 4548039 into mimblewimble:master Dec 2, 2019
@yeastplume yeastplume deleted the ttl_respect branch January 6, 2020 09:57
yyangli pushed a commit to mwcproject/mwc-wallet that referenced this pull request May 13, 2020
* refactor address generation code into libwallet, bool to flag whether to include proof, add sender address in init_send_tx

* rustfmt

* require payment proof addr as part of init_tx

* rustfmt

* store payment proof on sender transaction side

* rustfmt

* change sig to ed25519 sig

* rustfmt

* add message creation and signature

* rustfmt

* add payment proof verification function

* rustfmt

* validate proof on sender side, store proof

* rustfmt

* fix json tests

* fixes and updates to tests

* added API functions for converting and retrieving proof addresses

* rustfmt

* add payment proof to init_send_tx example

* rustfmt

* incorrect comment

* add commands for requesting payment proofs

* rustfmt

* wire up payment proofs into command line

* rustfmt

* add address command

* rustfmt

* added tor sending from owner api

* rustfmt

* add TTL to slate, transaction log

* ttl cutoff tests

* add ttl check to recieve functions, add tests, modify doctests

* rustfmt

* fixes from upstream changes and test fixes

* rustfmt

* remove unnecessary block header version check
antiochp pushed a commit to antiochp/grin-wallet that referenced this pull request Aug 7, 2020
* refactor address generation code into libwallet, bool to flag whether to include proof, add sender address in init_send_tx

* rustfmt

* require payment proof addr as part of init_tx

* rustfmt

* store payment proof on sender transaction side

* rustfmt

* change sig to ed25519 sig

* rustfmt

* add message creation and signature

* rustfmt

* add payment proof verification function

* rustfmt

* validate proof on sender side, store proof

* rustfmt

* fix json tests

* fixes and updates to tests

* added API functions for converting and retrieving proof addresses

* rustfmt

* add payment proof to init_send_tx example

* rustfmt

* incorrect comment

* add commands for requesting payment proofs

* rustfmt

* wire up payment proofs into command line

* rustfmt

* add address command

* rustfmt

* added tor sending from owner api

* rustfmt

* add TTL to slate, transaction log

* ttl cutoff tests

* add ttl check to recieve functions, add tests, modify doctests

* rustfmt

* fixes from upstream changes and test fixes

* rustfmt

* remove unnecessary block header version check
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.

2 participants