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

feat: Time lock integration #118

Merged
merged 6 commits into from
Mar 14, 2024

Conversation

aszepieniec
Copy link
Contributor

  • Use and enforce time-lock logic for UTXOs that come with time-locks. Specifically:
    • Before release, the transaction is invalid.
    • After release the transaction is valid (or at least, not invalidated by the time-lock).
    • No effect on UTXOs that are not time-locked.
  • Time-lock premine allocations for six months following launch.
  • Convenience methods for computing available and time-locked balances.
  • User-facing methods for reporting on available and time-locked balances and UTXOs.
  • Drop support for partially proven transactions. This is a headache to work with. Better to add back later.
  • Revise consensus logic abstractions. I'm still not happy with these though but this will be addressed in a later PR.

Closes #111.

Also:
 - Add convenience function for checking time-dependent spendability
   of UTXOs.
 - Dependency-inject time into block and transaction validity
   checkers. Do not rely on `SystemTime::now` except in `peer_loop`.
 - Refactor consensus logic abstractions. (<-- This needs another
   refactor though.)
 - Drop support for partially-proven transactions. Headache. Add
   back later.
 - Derandomize tests. Easier to track flaky tests.

This commit is a merger of 20 commits, mostly non-compiling works-in-
progress.

wip: Fix premine test

wip: Add test for `can_spend_at`

This function is a convenience function for UTXOs, to test
whether they are spendable at a given point in time.

wip: Reduce redundancies in consensus logic abstractions

wip: Refactor validation AST

wip: Refactor AST away from traits

wip: Make compile

wip: Fix warnings

wip: Add debug `println!`s

wip: Fall back on rust shadow

wip: Add simple failing test

wip: Add unit test

wip: Drop double wallet synchronization to genesi

wip: Percolate time dependency-injection

wip: Fix tests

wip: Track stack overflow error

wip: Fix stack overflow error

It resulted from BField-encoding a `TransactionValidationLogic`
object. Not sure why. Problem is avoided by ignoring this field.
It is temporary anyway.

wip: Support merging transactions

wip: Make always failing test pass sometimes

wip: Derandomize mock blocks

test: Fix all tests

Woop woop woop. Woop woop woop. Woop woop woop. Woop woop woop. Woop
woop woop. Woop woop woop. Woop woop woop. Woop woop woop. Woop woop
woop. Woop woop woop. Woop woop woop. Woop woop woop. Woop woop woop.
```
$> neptune-cli list-coins
```
@aszepieniec aszepieniec merged commit e240f96 into master Mar 14, 2024
3 checks passed
@Sword-Smith Sword-Smith deleted the aszepieniec/#111-time-lock-integration branch August 27, 2024 10:55
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.

integrate time locks
1 participant