Skip to content

fix(gnoweb): Fix status.json height and version, add chain_id - #6448

Open
jefft0 wants to merge 7 commits into
gnolang:masterfrom
jefft0:fix/gnoweb-status-json-height
Open

jefft0 wants to merge 7 commits into
gnolang:masterfrom
jefft0:fix/gnoweb-status-json-height

Conversation

@jefft0

@jefft0 jefft0 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The gnoweb path status.json includes the height and version. For example, we run gnoweb with mainnet gnoweb -remote https://rpc.gno.land . The height is always 0 and the version is a hard-coded value as "dev":

image

It needs to get the height by calling ABCIInfo. And it can get the version from the RPC status. This PR updates handlerStatusJSON to do this. The RPC status also has the remote's chain_id, so we also show this. With these fixes it shows correct height and version, and includes the correct chain_id:

image

NOTE: gnoweb can be started with the default chain-id "dev" or any other value. (This is shown in the gnokey commands on the Actions page.) Usually this matches the chain_id of the remote, but status.json always shows the value from the remote.

Signed-off-by: Jeff Thompson <jeff@thefirst.org>
@jefft0
jefft0 marked this pull request as ready for review November 3, 2026 10:24
@github-actions github-actions Bot added 📦 ⛰️ gno.land Issues or PRs gno.land package related 🌍 gnoweb Issues & PRs related to gnoweb and render labels Nov 3, 2026
@Gno2D2
Gno2D2 requested review from alexiscolin and gfanton November 3, 2026 10:24
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 3, 2026
@Gno2D2

Gno2D2 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🟢 Changes related to gnoweb must be reviewed by its codeowners
🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: jefft0/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Changes related to gnoweb must be reviewed by its codeowners

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 A changed file matches this pattern: ^gno.land/pkg/gnoweb/ (filename: gno.land/pkg/gnoweb/app_test.go)

Then

🟢 Requirement satisfied
└── 🟢 Or
    ├── 🔴 Or
    │   ├── 🔴 And
    │   │   ├── 🔴 Pull request author is user: alexiscolin
    │   │   └── 🟢 This user reviewed pull request: gfanton (with state "APPROVED")
    │   └── 🔴 And
    │       ├── 🔴 Pull request author is user: gfanton
    │       └── 🔴 This user reviewed pull request: alexiscolin (with state "APPROVED")
    └── 🟢 And
        ├── 🟢 Not (🔴 Pull request author is user: alexiscolin)
        ├── 🟢 Not (🔴 Pull request author is user: gfanton)
        └── 🟢 Or
            ├── 🔴 This user reviewed pull request: alexiscolin (with state "APPROVED")
            └── 🟢 This user reviewed pull request: gfanton (with state "APPROVED")

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [aronpark1007 davd-gzl jefft0 notJoon omarsy MikaelVallenet] (with state "APPROVED")
    │       ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🔴 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

@jefft0 jefft0 moved this to Other in review in 🤝🏻 Partner: Berty Nov 3, 2026
@jefft0 jefft0 changed the title fix(gnoweb): status.json should get the height from ABCIInfo fix(gnoweb): Make status.json height and version, add chain_id Nov 3, 2026
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
@jefft0 jefft0 changed the title fix(gnoweb): Make status.json height and version, add chain_id fix(gnoweb): Fix status.json height and version, add chain_id Nov 3, 2026

@gfanton gfanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Height and chain_id come out right now, but version still isn't the release the node runs: it reads the BFT protocol version, so against mainnet status.json shows v1.0.0-rc.0 where the node is on v1.7.0. That one needs a change, and the comment has a one-click suggestion.

The other two are optional:

  • Taking the height from the same Status call drops the second RPC on every status.json hit and 22 lines.
  • Nothing tests status.json yet. This subtest, next to /ready in the healthy part of TestHealthEndpoints, fails on master (height 0, no chain_id, dev) and here on the version, and passes with the fix. It needs the encoding/json and tm2/pkg/version imports:
t.Run("status.json should report the node", func(t *testing.T) {
	request := httptest.NewRequest(http.MethodGet, "/status.json", nil)
	response := httptest.NewRecorder()
	router.ServeHTTP(response, request)

	var status struct {
		Gnoland struct {
			Height  int64  `json:"height"`
			Version string `json:"version"`
			ChainID string `json:"chain_id"`
		} `json:"gnoland"`
	}
	require.NoError(t, json.Unmarshal(response.Body.Bytes(), &status))
	assert.Greater(t, status.Gnoland.Height, int64(0))
	assert.Equal(t, "tendermint_test", status.Gnoland.ChainID)
	assert.Equal(t, version.Version, status.Gnoland.Version)
})

Comment thread gno.land/pkg/gnoweb/status.go Resolved
Comment thread gno.land/pkg/gnoweb/status.go Resolved
@Gno2D2 Gno2D2 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 5, 2026
jefft0 and others added 3 commits November 5, 2026 15:49
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: Jeff Thompson <jeff@thefirst.org>
@jefft0

jefft0 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Height and chain_id come out right now, but version still isn't the release the node runs: it reads the BFT protocol version, so against mainnet status.json shows v1.0.0-rc.0 where the node is on v1.7.0. That one needs a change, and the comment has a one-click suggestion.

The other two are optional:

  • Taking the height from the same Status call drops the second RPC on every status.json hit and 22 lines.
  • Nothing tests status.json yet. This subtest, next to /ready in the healthy part of TestHealthEndpoints, fails on master (height 0, no chain_id, dev) and here on the version, and passes with the fix. It needs the encoding/json and tm2/pkg/version imports.

@gfanton,

  • I accepted the change to use BuildVersion
  • See my comment to keep the separate call to ABCIInfo for the block height
  • I added the extra status.json test to TestHealthEndpoints

@gfanton gfanton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌍 gnoweb Issues & PRs related to gnoweb and render 📦 ⛰️ gno.land Issues or PRs gno.land package related

Projects

Status: Other in review

Development

Successfully merging this pull request may close these issues.

3 participants