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

Transaction expiration calculation -> change times to only block time #1060

Closed
kristjank opened this issue Oct 4, 2018 · 3 comments
Closed
Assignees

Comments

@kristjank
Copy link
Contributor

kristjank commented Oct 4, 2018

Is your feature request related to a problem? Please describe.
Now it is possible to set transaction expiration in two ways (block-time and also normal time-to-live before expiration).

Describe the solution you'd like
The only true and measurable time is block height and so in this case also transaction expiration should be set, in explicit value of block height when it should expires.transaction: {

 expiration: 5980000
}

For usability the client applications would still calculate this in a time-spam, so we can show more friendly information to the user sending the transaction. The clients can also suggest like 10 blocks, 2 rounds and then the explicit block expiration height is calculated in the background.

@kristjank kristjank added this to the 2.0.0 mainnet milestone Oct 24, 2018
@kristjank
Copy link
Contributor Author

@vasild did you manage to check into this

@vasild
Copy link
Contributor

vasild commented Oct 31, 2018

No, but I have a rough idea:

  1. Rename transaction.expiration -> transaction.expirationSecondsSinceGenesis
  2. Introduce new transaction.expirationHeight
    If 2. is set then override/ignore 1. and expire based on blocks, if 2. is not set then do as the current code does (expire by seconds).
  3. Get the user-facing apps to set 2.
  4. Delete 1. from the code as it will be unused after 3.

IMO the user-facing apps should present the user time-based expiration dialogs, like "expire after N hours approximately" or "expire at 14:56 on Nov 1 2018 approximately" and convert into block number under the hood. Then maybe have some advanced, geeks-only option to set/view expiration block number directly.

@faustbrian faustbrian modified the milestones: 2.0.0 mainnet, 2.1.0 Nov 7, 2018
@faustbrian faustbrian added AIP11 and removed priority labels Nov 8, 2018
@faustbrian faustbrian modified the milestones: 2.1.0, 2.3.0 Dec 19, 2018
@faustbrian faustbrian modified the milestones: 2.3.0, 2.4.0 Jan 30, 2019
@faustbrian faustbrian removed this from the 2.4.0 milestone Feb 19, 2019
@faustbrian faustbrian added this to the 2.5.0 milestone Feb 19, 2019
@faustbrian faustbrian modified the milestones: 2.7.0, 2.6.0 Apr 3, 2019
@vasild vasild modified the milestones: 2.6.0, 2.4.0 Apr 23, 2019
vasild added a commit that referenced this issue Apr 23, 2019
Switch from calculating transactions' expiration in "number of seconds
since genesis block" to "chain height".

Notice: this change alters the semantic of the maxTransactionAge beyond
just the units (seconds vs height). Before the change we would use the
user-defined transaction.timestamp and add maxTransactionAge (seconds)
to it. After the change we use the current chain height when we have
received the transaction (which is not user-defined and not necessary
the same as when the transaction was created by the user) and add
maxTransactionAge (height) to it.

Resolves #1060
vasild added a commit that referenced this issue Apr 23, 2019
Switch from calculating transactions' expiration in "number of seconds
since genesis block" to "chain height".

Notice: this change alters the semantic of the maxTransactionAge beyond
just the units (seconds vs height). Before the change we would use the
user-defined transaction.timestamp and add maxTransactionAge (seconds)
to it. After the change we use the current chain height when we have
received the transaction (which is not user-defined and not necessary
the same as when the transaction was created by the user) and add
maxTransactionAge (height) to it.

Resolves #1060
@vasild
Copy link
Contributor

vasild commented Apr 26, 2019

Implemented in #2461

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

No branches or pull requests

3 participants