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

Policy lists via UTXO: lists updated before block confirmation. #59

Closed
lawlawlaw opened this issue Jan 28, 2019 · 8 comments
Closed

Policy lists via UTXO: lists updated before block confirmation. #59

lawlawlaw opened this issue Jan 28, 2019 · 8 comments

Comments

@lawlawlaw
Copy link

This currently applies to the utxolists branch.

In validation.cpp, in ConnectBlock. The policy lists are updated from the transactions in the block before the block is fully validated; ConnectBlock could later return "false" with CValidationState other than "MODE_VALID".

@nkostoulas
Copy link

Is this still a problem?

@lawlawlaw
Copy link
Author

Potentially, yes. Ideally, the policy lists etc. should be updated just before the "return true". However, this could affect transactions within the same block that depend on policy.

@nkostoulas
Copy link

Ok this sounds serious. Affect how do you mean?

@lawlawlaw
Copy link
Author

For example, an address is added to the freeze list in a policy transaction. In a later transaction, in the same block, the asset from the frozen address is spent. So in this case the earlier transaction invalidates the later transaction.

@lawlawlaw
Copy link
Author

Unless we want policy list changes only to take effect in the next block.

@nkostoulas
Copy link

I think this part is fine since policy lists are used for mempool rejection. Still we shouldn't be updating them until the block is fully validated.

@lawlawlaw
Copy link
Author

I'll push a fix for this in a moment.
Another possible issue is if e.g. DisconnectBlock is called, the policy lists wont be updated.
This also affects AssetMap and FreezeHistory.

@nkostoulas
Copy link

partly resolved. relevant issue open #128

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

2 participants