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

go/consensus: add GasUsed to transaction results and Size to block header #5761

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Jul 6, 2024

No description provided.

Copy link

netlify bot commented Jul 6, 2024

Deploy Preview for oasisprotocol-oasis-core canceled.

Name Link
🔨 Latest commit 90fa3ab
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-oasis-core/deploys/668fb601232c28000962c031

@kostko kostko linked an issue Jul 8, 2024 that may be closed by this pull request
@ptrus ptrus force-pushed the ptrus/feature/tx-gas-used branch from 1c17caf to 2b1d7a0 Compare July 8, 2024 09:49
@ptrus ptrus changed the title go/consensus: add GasUsed to transaction results go/consensus: add GasUsed to transaction results and Size to block header Jul 8, 2024
@ptrus ptrus linked an issue Jul 8, 2024 that may be closed by this pull request
@ptrus ptrus force-pushed the ptrus/feature/tx-gas-used branch 3 times, most recently from ff637b0 to 4492b2a Compare July 8, 2024 14:35
@ptrus ptrus marked this pull request as ready for review July 8, 2024 14:36
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.87%. Comparing base (8812ba2) to head (b394fea).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5761      +/-   ##
==========================================
- Coverage   64.95%   64.87%   -0.09%     
==========================================
  Files         620      620              
  Lines       63330    63339       +9     
==========================================
- Hits        41138    41093      -45     
- Misses      17346    17377      +31     
- Partials     4846     4869      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -44,6 +44,7 @@ func ConsensusImplementationTests(t *testing.T, backend consensus.ClientBackend)
require.NoError(err, "GetBlock")
require.NotNil(blk, "returned block should not be nil")
require.True(blk.Height > 0, "block height should be greater than zero")
require.True(blk.Size > 0, "block size should be greater than zero")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
require.True(blk.Size > 0, "block size should be greater than zero")
require.EqualValues(blk.Size, uint64(1178), "block size should match")

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this will be deterministic as it depends on what transactions are in the "latest" block?

@@ -44,6 +44,7 @@ func ConsensusImplementationTests(t *testing.T, backend consensus.ClientBackend)
require.NoError(err, "GetBlock")
require.NotNil(blk, "returned block should not be nil")
require.True(blk.Height > 0, "block height should be greater than zero")
require.True(blk.Size > 0, "block size should be greater than zero")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
require.True(blk.Size > 0, "block size should be greater than zero")
require.EqualValues(blk.Size, uint64(1178), "block size should match")

@ptrus ptrus force-pushed the ptrus/feature/tx-gas-used branch 2 times, most recently from 8ce5f78 to b394fea Compare July 11, 2024 09:22
@ptrus ptrus force-pushed the ptrus/feature/tx-gas-used branch from b394fea to 90fa3ab Compare July 11, 2024 10:37
@ptrus ptrus enabled auto-merge July 11, 2024 11:27
@ptrus ptrus merged commit 0fa7e30 into master Jul 11, 2024
5 checks passed
@ptrus ptrus deleted the ptrus/feature/tx-gas-used branch July 11, 2024 11:37
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.

Add Gas Used to consensusAPI.TransactionsWithResults Add block size (in bytes) to the block Header
3 participants