Skip to content

Conversation

@tolikzinovyev
Copy link
Contributor

No description provided.

@tolikzinovyev tolikzinovyev changed the title Return an error in DecodeSignedTxn() if consensus protocol is unknown. Return an error in EncodeSignedTxn() and DecodeSignedTxn() if consensus protocol is unknown. Aug 6, 2021
@tolikzinovyev tolikzinovyev self-assigned this Aug 6, 2021
@tolikzinovyev tolikzinovyev marked this pull request as ready for review August 6, 2021 21:40
@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2021

Codecov Report

Merging #2708 (bb90709) into master (39be0c7) will decrease coverage by 0.01%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2708      +/-   ##
==========================================
- Coverage   47.07%   47.05%   -0.02%     
==========================================
  Files         349      349              
  Lines       55858    55864       +6     
==========================================
- Hits        26294    26287       -7     
- Misses      26617    26623       +6     
- Partials     2947     2954       +7     
Impacted Files Coverage Δ
data/bookkeeping/block.go 49.81% <25.00%> (-2.30%) ⬇️
ledger/blockqueue.go 82.18% <0.00%> (-2.88%) ⬇️
network/wsPeer.go 72.14% <0.00%> (-2.23%) ⬇️
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
network/wsNetwork.go 60.92% <0.00%> (ø)
ledger/acctupdates.go 62.63% <0.00%> (+0.33%) ⬆️
catchup/service.go 69.35% <0.00%> (+0.77%) ⬆️
network/requestTracker.go 71.12% <0.00%> (+0.86%) ⬆️
cmd/tealdbg/debugger.go 73.86% <0.00%> (+1.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39be0c7...bb90709. Read the comment docs.

Comment on lines 37 to 39
const genesisID string = "foo"

var genesisHash crypto.Digest
Copy link
Contributor

Choose a reason for hiding this comment

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

rename these to testGenesisID and testGenesisHash.
The testGenesisHash can be defined here as

var testGenesisHash = crypto.Digest{0x1, 0x2, 0x3..}

which is abit cleaner than defining it here and initializing it in init

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 287 to 288
blk.BlockHeader.GenesisID = "foo"
blk.BlockHeader.GenesisHash[0] = 3
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why you need to make the GenesisID/GenesisHash.. but there is nothing wrong with these changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

it would generally be better if you were to pick a genesisHash that is really pseudo-random, i.e. crypto.Hash([]byte{1,2,3,4})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GenesisID and GenesisHash must the same in transactions and block header. Why is pseudo-random better?

Copy link
Contributor

Choose a reason for hiding this comment

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

a true random means that the result of the test might be random.. and we don't want that.
filling up only selected bytes doesn't guarantee that the comparison was testing all the bytes.
(i.e. both me and you knows it does.. but we want to ensure we test that )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done.

Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

looks good; one request for renaming global test variable names.

@tsachiherman tsachiherman merged commit 23e51ca into algorand:master Aug 10, 2021
@tolikzinovyev tolikzinovyev deleted the decode-stxn-error branch January 6, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants