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

Add StateUpdate payload #345

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

zhengq1
Copy link
Contributor

@zhengq1 zhengq1 commented Jul 10, 2017

support store a value use Namespace and key as index.

Signed-off-by: zhengq1 [email protected]


findflag := false
for k := 0; k < len(stateUpdater); k++ {
log.Trace(fmt.Sprintf("StateUpdate updaterPublickey %d: %x %x", k, stateUpdater[k].X, stateUpdater[k].Y))
Copy link
Contributor

Choose a reason for hiding this comment

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

use Tracef, Debugf, Warnf... method instead. see #332 for more details.

// stateKey
statePrefix := []byte{byte(ST_STATES)}
stateKey := append(statePrefix, namespace...)
stateKey = append(stateKey, key...)
Copy link
Contributor

Choose a reason for hiding this comment

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

this desgin may have problem since we can not figure out namespace and key from the stateKey.
case: namespace: dna, key: node3, and namespace:dnanode, key:3 will share the same underlying data。
recommendation: Use len(namespace) + namespace + key schema to construct the stateKey

@gasby88
Copy link
Contributor

gasby88 commented Jul 11, 2017

approve

Copy link
Collaborator

@dreamfly281 dreamfly281 left a comment

Choose a reason for hiding this comment

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

Suggest verify in user specify branch before official be merged into main branch

@zhengq1
Copy link
Contributor Author

zhengq1 commented Jul 28, 2017

this payload already verified in user case.

support store a value use Namespace and key as index.

Signed-off-by: zhengq1 <[email protected]>

(cherry picked from commit 5223bd3)
Signed-off-by: zhengq1 <[email protected]>
Honglei-Cong pushed a commit to Honglei-Cong/DNA that referenced this pull request Nov 27, 2019
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.

4 participants