Skip to content

Use actual blocktime when storing TX.#560

Merged
Bushstar merged 1 commit into
masterfrom
fix/anchor-use-actual-time
Jun 25, 2021
Merged

Use actual blocktime when storing TX.#560
Bushstar merged 1 commit into
masterfrom
fix/anchor-use-actual-time

Conversation

@Bushstar

@Bushstar Bushstar commented Jun 23, 2021

Copy link
Copy Markdown
Contributor

Anchors can end up with time too new error as TX time is mostly set as half the current block time plus half the previous block time. Taking the following error, the block time is 1624342316 however the actual block time is 1624342948.

2021-06-22T06:25:57Z Anchor too new. DeFi: 1624332030 Bitcoin: 1624342316 Anchor: bceb153c5b0e15e931365f936c95167b06ffaf2a3222c152969c8d17466f0a8f

However if we take half the time of the previous block and half the time of the block the TX is in we get...

(1624342948÷2)+(1624341684÷2) = 1624342316

1624342316 is the time shown in the log. The update here uses the actual block time, I can only guess that they were trying to set the time of the TX as being somewhere between the current and previous block which is problematic for the time base rules added to the anchoring system.

Resolves #550

@defichain-bot

Copy link
Copy Markdown
Member

@Bushstar: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind fix
  • /kind chore
  • /kind docs
  • /kind refactor
  • /kind dependencies
Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@Bushstar Bushstar merged commit 977b34d into master Jun 25, 2021
@Bushstar Bushstar deleted the fix/anchor-use-actual-time branch June 25, 2021 06:33
prasannavl pushed a commit that referenced this pull request Oct 30, 2021
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.

Anchor Bug - anchors not detected OR Creation of invalid anchors

3 participants