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

contract: Fix ability to reorganize contracts #1934

Merged

Conversation

cyrossignol
Copy link
Member

A user observed that contextual contract validation can prevent nodes from reorganizing when a conflict occurs for contract transactions since both chains can confirm the same transaction. The original validation occurred before disconnecting the tip of the stale chain and reverting the context examined for the checks. This moves the offending code to ConnectBlock() so that a node disconnects the conflicting state before the validation.

Contextual contract validation can prevent nodes from reorganizing
when a conflict occurs for contracts since both chains can confirm
the same contract transaction. Original validation occurred before
disconnecting the tip of the stale chain and reverting the context
examined for the checks.
@cyrossignol cyrossignol changed the title Fix ability to reorganize contracts contract: Fix ability to reorganize contracts Oct 17, 2020
@jamescowens jamescowens self-requested a review October 17, 2020 14:02
@jamescowens jamescowens added this to the Gladys milestone Oct 17, 2020
@jamescowens jamescowens merged commit 263035a into gridcoin-community:development Oct 17, 2020
@cyrossignol cyrossignol deleted the contract-reorg branch October 17, 2020 20:27
jamescowens added a commit that referenced this pull request Nov 1, 2020
Added
 - rpc: Add out-of-sync status to "getinfo" and "getblockchaininfo" #1925 (@cyrossignol)
 - gui: add autocomplete to rpc console #1927 (@Pythonix)
 - consensus: Add checkpoint post block v11 transition #1919 (@cyrossignol)
 - researcher: Add -forcecpid configuration option #1935 (@cyrossignol)
 - gui: Adds detection if version is below last mandatory #1939 (@jamescowens)
 - contract: Reimplement legacy administrative contract validation #1943 (@cyrossignol)
 - voting: Add poll choices to "gettransaction" RPC contract output #1948 (@cyrossignol)

Changed
 - doc: Fix link in build-openbsd.md #1924 (@Pythonix)
 - voting: Decrease poll duration to 90 days #1936 (@cyrossignol)
 - refactor: Revert init order to fix rejected net messages @1941 (@cyrossignol)
 - refactor: port amount.h #1937 (@div72)
 - refactor: Normalize boost::filesystem to fs namespace #1942 (@cyrossignol)
 - accrual: Apply accrual for new CPIDs from existing snapshots #1944 (@cyrossignol)
 - accrual: Reset research account when disconnecting first block #1947 (@cyrossignol)

Removed
 - refactor: Clean up transitional code for block version 11 #1933 (@cyrossignol)

Fixed
 - Modify depends packages for openSUSE and other Redhat like distributions and fix mingw bdb53 compile #1932 (@jamescowens)
 - contract: Fix ability to reorganize contracts #1934 (@cyrossignol)
 - accrual: Fix snapshot accrual for new CPIDs #1931 (@cyrossignol)
 - rpc: Clean up getblockstats #1938 (@jamescowens)
 - scraper, rpc: Correct missing mScraperStats initialization in ConvergedScraperStats (@jamescowens)
jamescowens added a commit that referenced this pull request Nov 1, 2020
Added
 - rpc: Add out-of-sync status to "getinfo" and "getblockchaininfo" #1925 (@cyrossignol)
 - gui: add autocomplete to rpc console #1927 (@Pythonix)
 - consensus: Add checkpoint post block v11 transition #1919 (@cyrossignol)
 - researcher: Add -forcecpid configuration option #1935 (@cyrossignol)
 - gui: Adds detection if version is below last mandatory #1939 (@jamescowens)
 - contract: Reimplement legacy administrative contract validation #1943 (@cyrossignol)
 - voting: Add poll choices to "gettransaction" RPC contract output #1948 (@cyrossignol)

Changed
 - doc: Fix link in build-openbsd.md #1924 (@Pythonix)
 - voting: Decrease poll duration to 90 days #1936 (@cyrossignol)
 - refactor: Revert init order to fix rejected net messages #1941 (@cyrossignol)
 - refactor: port amount.h #1937 (@div72)
 - refactor: Normalize boost::filesystem to fs namespace #1942 (@cyrossignol)
 - accrual: Apply accrual for new CPIDs from existing snapshots #1944 (@cyrossignol)
 - accrual: Reset research account when disconnecting first block #1947 (@cyrossignol)

Removed
 - refactor: Clean up transitional code for block version 11 #1933 (@cyrossignol)

Fixed
 - Modify depends packages for openSUSE and other Redhat like distributions and fix mingw bdb53 compile #1932 (@jamescowens)
 - contract: Fix ability to reorganize contracts #1934 (@cyrossignol)
 - accrual: Fix snapshot accrual for new CPIDs #1931 (@cyrossignol)
 - rpc: Clean up getblockstats #1938 (@jamescowens)
 - scraper, rpc: Correct missing mScraperStats initialization in ConvergedScraperStats (@jamescowens)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants