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: implement reconciliation onchain #956

Merged
merged 16 commits into from
Jul 6, 2023

Conversation

forcodedancing
Copy link
Contributor

@forcodedancing forcodedancing commented May 26, 2023

Description

This pr will

  1. implements reconciliation on chain

Rationale

Security Enhancement

Example

NA

Changes

Notable changes:

  • panic when reconciliation error

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • integration tests passed (make integration_test)
  • manual transaction test passed (cli invoke)

Already reviewed by

...

Related issues

... reference related issue #'s here ...

@forcodedancing forcodedancing marked this pull request as draft May 26, 2023 06:26
@codecov-commenter
Copy link

codecov-commenter commented May 26, 2023

Codecov Report

Patch coverage: 10.93% and project coverage change: -0.39 ⚠️

Comparison is base (600ede1) 49.46% compared to head (4142622) 49.08%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #956      +/-   ##
===========================================
- Coverage    49.46%   49.08%   -0.39%     
===========================================
  Files          126      127       +1     
  Lines        12570    12698     +128     
===========================================
+ Hits          6218     6233      +15     
- Misses        5932     6042     +110     
- Partials       420      423       +3     
Impacted Files Coverage Δ
app/config/config.go 34.46% <0.00%> (-0.17%) ⬇️
app/reconciliation.go 0.00% <0.00%> (ø)
app/app.go 73.91% <60.86%> (-0.30%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@forcodedancing forcodedancing force-pushed the feat/sec_enhancement branch 5 times, most recently from 0eac8a5 to d4c0cf0 Compare May 31, 2023 03:29
@forcodedancing forcodedancing marked this pull request as ready for review May 31, 2023 03:37
@forcodedancing forcodedancing added the r4r ready for review label Jun 5, 2023
preCoins = preCoins.Plus(nacc2.GetLockedCoins())
}
}
iavlStore.ResetDiff()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we reset diff outside this function, it would be better this function is just a view function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored the codes

app/reconciliation.go Outdated Show resolved Hide resolved
revert some changes
@forcodedancing forcodedancing marked this pull request as draft July 4, 2023 08:10
@forcodedancing
Copy link
Contributor Author

forcodedancing commented Jul 5, 2023

State Sync can work.

[2023-07-05|07:16:15.801] failed to load immutable tree                module=statesync err="version does not exist" store="KVStoreKey{0xc0004d5ea0, acc}"
I[2023-07-05|07:16:15.801] added a peer to state sync reactor           module=statesync peer=0fd066de431d13e5613aba53b3ed25c5a7a0b67c
I[2023-07-05|07:16:15.807] added a peer to state sync reactor           module=statesync peer=98579505572cc85488caa403bebb62e5b61d68e0
E[2023-07-05|07:16:15.917] dialing failed (attempts: 1): dial tcp 3.82.70.135:27146: connect: connection refused module=pex [email protected]:27146
E[2023-07-05|07:16:15.919] dialing failed (attempts: 1): dial tcp 3.82.70.135:27146: connect: connection refused module=pex [email protected]:27146
E[2023-07-05|07:16:15.919] dialing failed (attempts: 1): dial tcp 3.82.70.135:27146: connect: connection refused module=pex [email protected]:27146
E[2023-07-05|07:16:15.932] dialing failed (attempts: 1): dial tcp 35.169.158.175:27146: connect: connection refused module=pex [email protected]:27146
E[2023-07-05|07:16:16.042] dialing failed (attempts: 1): dial tcp 85.206.161.59:27146: connect: connection refused module=pex [email protected]:27146
I[2023-07-05|07:16:16.235] added a peer to state sync reactor           module=statesync peer=ca1245471ff1f2224e1076dfd94d7d2d66077cf5
E[2023-07-05|07:16:16.775] dialing failed (attempts: 1): dial tcp 187.90.185.195:27146: i/o timeout module=pex [email protected]:27146
I[2023-07-05|07:16:25.771] decided not init pool                        module=statesync manifests=0 tried=1
I[2023-07-05|07:16:25.771] broadcast state status request               module=statesync
I[2023-07-05|07:16:25.790] added manifest                               module=statesync peer=0fd066de431d13e5613aba53b3ed25c5a7a0b67c manifestHash=0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9da
cc3027b
I[2023-07-05|07:16:25.793] added manifest                               module=statesync peer=98579505572cc85488caa403bebb62e5b61d68e0 manifestHash=0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9da
cc3027b
I[2023-07-05|07:16:26.077] added manifest                               module=statesync peer=ca1245471ff1f2224e1076dfd94d7d2d66077cf5 manifestHash=0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9da
cc3027b
I[2023-07-05|07:16:35.772] decided not init pool                        module=statesync manifests=1 tried=2
I[2023-07-05|07:16:35.772] hash: 0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9dacc3027b, peers: map[0fd066de431d13e5613aba53b3ed25c5a7a0b67c:{} 98579505572cc85488caa403bebb62e5b61d68e0:{} ca12454
71ff1f2224e1076dfd94d7d2d66077cf5:{}] module=statesync
I[2023-07-05|07:16:35.772] broadcast state status request               module=statesync
I[2023-07-05|07:16:35.793] added manifest                               module=statesync peer=98579505572cc85488caa403bebb62e5b61d68e0 manifestHash=0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9da
cc3027b
I[2023-07-05|07:16:35.796] added manifest                               module=statesync peer=0fd066de431d13e5613aba53b3ed25c5a7a0b67c manifestHash=0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9da
cc3027b
I[2023-07-05|07:16:35.942] added manifest                               module=statesync peer=ca1245471ff1f2224e1076dfd94d7d2d66077cf5 manifestHash=0c77d7412f37b212987b72cf9f97f264b5f75214419eb32b432fae9da
cc3027b

@forcodedancing forcodedancing marked this pull request as ready for review July 6, 2023 02:08
@unclezoro unclezoro merged commit a2be24e into bnb-chain:develop Jul 6, 2023
forcodedancing added a commit to forcodedancing/node that referenced this pull request Jul 7, 2023
forcodedancing added a commit to forcodedancing/node that referenced this pull request Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r4r ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants