Skip to content

Commit ca880b2

Browse files
tac0turtletac0turtle
andauthored
fix!: header & data namespace DA (#2560)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview This makes the diff action fail when there is a diff compared to upstream and pins it to a version since upstream has been changed to 128 this pr also fixes header and data namespace issue where it was empty. closes #2559 --------- Co-authored-by: tac0turtle <[email protected]>
1 parent 6bdc919 commit ca880b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1697
-176
lines changed

.github/workflows/check_consts_drift.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Fetch Celestia App Consts
1818
id: fetch_celestia_consts
1919
run: |
20-
curl -sSL https://raw.githubusercontent.com/celestiaorg/celestia-app/main/pkg/appconsts/initial_consts.go -o /tmp/celestia_initial_consts.go
20+
curl -sSL https://raw.githubusercontent.com/celestiaorg/celestia-app/refs/tags/v5.0.1/pkg/appconsts/app_consts.go -o /tmp/celestia_initial_consts.go
2121
if [ $? -ne 0 ]; then
2222
echo "Failed to download Celestia app consts file."
2323
exit 1
@@ -60,29 +60,30 @@ jobs:
6060
6161
# Perform the diff and handle its exit code robustly
6262
diff_command_output=""
63-
if ! diff_command_output=$(diff -u "$LOCAL_FILE_TMP" "$CELESTIA_FILE_TMP"); then
64-
# diff exited with non-zero status
65-
diff_exit_code=$?
66-
if [ $diff_exit_code -eq 1 ]; then
67-
# Exit code 1 means files are different
68-
echo "Files are different (excluding last line)."
69-
echo "diff_output<<EOF" >> $GITHUB_OUTPUT
70-
echo "$diff_command_output" >> $GITHUB_OUTPUT
71-
echo "EOF" >> $GITHUB_OUTPUT
72-
echo "files_differ=true" >> $GITHUB_OUTPUT
73-
exit 1 # Fail the step
74-
else
75-
# Exit code > 1 means diff encountered an error
76-
echo "Error: diff command failed with exit code $diff_exit_code."
77-
echo "Diff command output/error: $diff_command_output"
78-
# Output error information for the issue
79-
echo "diff_output<<EOF" >> $GITHUB_OUTPUT
80-
echo "Diff command error (exit code $diff_exit_code):" >> $GITHUB_OUTPUT
81-
echo "$diff_command_output" >> $GITHUB_OUTPUT
82-
echo "EOF" >> $GITHUB_OUTPUT
83-
echo "files_differ=true" >> $GITHUB_OUTPUT # Treat as a difference to create an issue
84-
exit $diff_exit_code
85-
fi
63+
diff_exit_code=0
64+
diff_command_output=$(diff -u "$LOCAL_FILE_TMP" "$CELESTIA_FILE_TMP") || diff_exit_code=$?
65+
66+
if [ $diff_exit_code -eq 1 ]; then
67+
# Exit code 1 means files are different
68+
echo "Files are different (excluding last line)."
69+
echo "diff_output<<EOF" >> $GITHUB_OUTPUT
70+
echo "$diff_command_output" >> $GITHUB_OUTPUT
71+
echo "EOF" >> $GITHUB_OUTPUT
72+
echo "files_differ=true" >> $GITHUB_OUTPUT
73+
echo "::error::Celestia app consts have drifted. Please update da/jsonrpc/internal/consts.go"
74+
exit 1 # Fail the step
75+
elif [ $diff_exit_code -gt 1 ]; then
76+
# Exit code > 1 means diff encountered an error
77+
echo "Error: diff command failed with exit code $diff_exit_code."
78+
echo "Diff command output/error: $diff_command_output"
79+
# Output error information for the issue
80+
echo "diff_output<<EOF" >> $GITHUB_OUTPUT
81+
echo "Diff command error (exit code $diff_exit_code):" >> $GITHUB_OUTPUT
82+
echo "$diff_command_output" >> $GITHUB_OUTPUT
83+
echo "EOF" >> $GITHUB_OUTPUT
84+
echo "files_differ=true" >> $GITHUB_OUTPUT # Treat as a difference to create an issue
85+
echo "::error::Failed to compare files due to diff error"
86+
exit $diff_exit_code
8687
else
8788
# diff exited with 0, files are identical
8889
echo "Files are identical (excluding last line)."

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535
### Fixed
3636

3737
<!-- Bug fixes -->
38-
-
38+
- Pass correct namespaces for header and data to the da layer for posting ([#2560](https://github.com/evstack/ev-node/pull/2560))
3939

4040
### Security
4141

apps/evm/single/cmd/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package cmd
22

33
import (
44
"context"
5+
"encoding/hex"
56
"fmt"
67
"path/filepath"
78

9+
"github.com/evstack/ev-node/core/da"
810
"github.com/evstack/ev-node/da/jsonrpc"
911
"github.com/evstack/ev-node/node"
1012
"github.com/evstack/ev-node/sequencers/single"
@@ -40,7 +42,12 @@ var RunCmd = &cobra.Command{
4042

4143
logger := rollcmd.SetupLogger(nodeConfig.Log)
4244

43-
daJrpc, err := jsonrpc.NewClient(context.Background(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.Namespace)
45+
headerNamespace := da.PrepareNamespace([]byte(nodeConfig.DA.HeaderNamespace))
46+
dataNamespace := da.PrepareNamespace([]byte(nodeConfig.DA.DataNamespace))
47+
48+
logger.Info().Str("headerNamespace", hex.EncodeToString(headerNamespace)).Str("dataNamespace", hex.EncodeToString(dataNamespace)).Msg("namespaces")
49+
50+
daJrpc, err := jsonrpc.NewClient(context.Background(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier)
4451
if err != nil {
4552
return err
4653
}

apps/evm/single/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ require (
5454
github.com/buger/goterm v1.0.4 // indirect
5555
github.com/celestiaorg/go-header v0.6.6 // indirect
5656
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
57-
github.com/celestiaorg/go-square/v2 v2.2.0 // indirect
5857
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
5958
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6059
github.com/compose-spec/compose-go/v2 v2.6.0 // indirect

apps/evm/single/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ github.com/celestiaorg/go-header v0.6.6 h1:17GvSXU/w8L1YWHZP4pYm9/4YHA8iy5Ku2wTE
107107
github.com/celestiaorg/go-header v0.6.6/go.mod h1:RdnlTmsyuNerztNiJiQE5G/EGEH+cErhQ83xNjuGcaQ=
108108
github.com/celestiaorg/go-libp2p-messenger v0.2.2 h1:osoUfqjss7vWTIZrrDSy953RjQz+ps/vBFE7bychLEc=
109109
github.com/celestiaorg/go-libp2p-messenger v0.2.2/go.mod h1:oTCRV5TfdO7V/k6nkx7QjQzGrWuJbupv+0o1cgnY2i4=
110-
github.com/celestiaorg/go-square/v2 v2.2.0 h1:zJnUxCYc65S8FgUfVpyG/osDcsnjzo/JSXw/Uwn8zp4=
111-
github.com/celestiaorg/go-square/v2 v2.2.0/go.mod h1:j8kQUqJLYtcvCQMQV6QjEhUdaF7rBTXF74g8LbkR0Co=
112110
github.com/celestiaorg/utils v0.1.0 h1:WsP3O8jF7jKRgLNFmlDCwdThwOFMFxg0MnqhkLFVxPo=
113111
github.com/celestiaorg/utils v0.1.0/go.mod h1:vQTh7MHnvpIeCQZ2/Ph+w7K1R2UerDheZbgJEJD2hSU=
114112
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=

apps/grpc/single/cmd/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package cmd
22

33
import (
4+
"encoding/hex"
45
"fmt"
56
"path/filepath"
67

78
"github.com/spf13/cobra"
89

10+
coreda "github.com/evstack/ev-node/core/da"
911
"github.com/evstack/ev-node/core/execution"
1012
"github.com/evstack/ev-node/da/jsonrpc"
1113
executiongrpc "github.com/evstack/ev-node/execution/grpc"
@@ -45,8 +47,13 @@ The execution client must implement the Evolve execution gRPC interface.`,
4547

4648
logger := rollcmd.SetupLogger(nodeConfig.Log)
4749

50+
headerNamespace := coreda.PrepareNamespace([]byte(nodeConfig.DA.HeaderNamespace))
51+
dataNamespace := coreda.PrepareNamespace([]byte(nodeConfig.DA.DataNamespace))
52+
53+
logger.Info().Str("headerNamespace", hex.EncodeToString(headerNamespace)).Str("dataNamespace", hex.EncodeToString(dataNamespace)).Msg("namespaces")
54+
4855
// Create DA client
49-
daJrpc, err := jsonrpc.NewClient(cmd.Context(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.Namespace)
56+
daJrpc, err := jsonrpc.NewClient(cmd.Context(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier)
5057
if err != nil {
5158
return err
5259
}

apps/grpc/single/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ require (
2020
github.com/beorn7/perks v1.0.1 // indirect
2121
github.com/celestiaorg/go-header v0.6.6 // indirect
2222
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
23-
github.com/celestiaorg/go-square/v2 v2.2.0 // indirect
2423
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2524
github.com/containerd/cgroups v1.1.0 // indirect
2625
github.com/coreos/go-systemd/v22 v22.5.0 // indirect

apps/grpc/single/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ github.com/celestiaorg/go-header v0.6.6 h1:17GvSXU/w8L1YWHZP4pYm9/4YHA8iy5Ku2wTE
2727
github.com/celestiaorg/go-header v0.6.6/go.mod h1:RdnlTmsyuNerztNiJiQE5G/EGEH+cErhQ83xNjuGcaQ=
2828
github.com/celestiaorg/go-libp2p-messenger v0.2.2 h1:osoUfqjss7vWTIZrrDSy953RjQz+ps/vBFE7bychLEc=
2929
github.com/celestiaorg/go-libp2p-messenger v0.2.2/go.mod h1:oTCRV5TfdO7V/k6nkx7QjQzGrWuJbupv+0o1cgnY2i4=
30-
github.com/celestiaorg/go-square/v2 v2.2.0 h1:zJnUxCYc65S8FgUfVpyG/osDcsnjzo/JSXw/Uwn8zp4=
31-
github.com/celestiaorg/go-square/v2 v2.2.0/go.mod h1:j8kQUqJLYtcvCQMQV6QjEhUdaF7rBTXF74g8LbkR0Co=
3230
github.com/celestiaorg/utils v0.1.0 h1:WsP3O8jF7jKRgLNFmlDCwdThwOFMFxg0MnqhkLFVxPo=
3331
github.com/celestiaorg/utils v0.1.0/go.mod h1:vQTh7MHnvpIeCQZ2/Ph+w7K1R2UerDheZbgJEJD2hSU=
3432
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=

apps/testapp/cmd/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package cmd
22

33
import (
44
"context"
5+
"encoding/hex"
56
"fmt"
67
"path/filepath"
78

89
"github.com/spf13/cobra"
910

1011
kvexecutor "github.com/evstack/ev-node/apps/testapp/kv"
12+
"github.com/evstack/ev-node/core/da"
1113
"github.com/evstack/ev-node/da/jsonrpc"
1214
"github.com/evstack/ev-node/node"
1315
rollcmd "github.com/evstack/ev-node/pkg/cmd"
@@ -45,7 +47,12 @@ var RunCmd = &cobra.Command{
4547
ctx, cancel := context.WithCancel(context.Background())
4648
defer cancel()
4749

48-
daJrpc, err := jsonrpc.NewClient(ctx, logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.Namespace)
50+
headerNamespace := da.PrepareNamespace([]byte(nodeConfig.DA.HeaderNamespace))
51+
dataNamespace := da.PrepareNamespace([]byte(nodeConfig.DA.DataNamespace))
52+
53+
logger.Info().Str("headerNamespace", hex.EncodeToString(headerNamespace)).Str("dataNamespace", hex.EncodeToString(dataNamespace)).Msg("namespaces")
54+
55+
daJrpc, err := jsonrpc.NewClient(ctx, logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier)
4956
if err != nil {
5057
return err
5158
}

apps/testapp/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ replace (
1111

1212
require (
1313
github.com/evstack/ev-node v0.0.0-00010101000000-000000000000
14+
github.com/evstack/ev-node/core v0.0.0-20250312114929-104787ba1a4c
1415
github.com/evstack/ev-node/da v0.0.0-00010101000000-000000000000
1516
github.com/evstack/ev-node/sequencers/single v0.0.0-00010101000000-000000000000
1617
github.com/ipfs/go-datastore v0.8.2
@@ -25,7 +26,6 @@ require (
2526
github.com/beorn7/perks v1.0.1 // indirect
2627
github.com/celestiaorg/go-header v0.6.6 // indirect
2728
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
28-
github.com/celestiaorg/go-square/v2 v2.2.0 // indirect
2929
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3030
github.com/containerd/cgroups v1.1.0 // indirect
3131
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
@@ -37,7 +37,6 @@ require (
3737
github.com/docker/go-units v0.5.0 // indirect
3838
github.com/dustin/go-humanize v1.0.1 // indirect
3939
github.com/elastic/gosigar v0.14.3 // indirect
40-
github.com/evstack/ev-node/core v0.0.0-20250312114929-104787ba1a4c // indirect
4140
github.com/filecoin-project/go-jsonrpc v0.7.1 // indirect
4241
github.com/flynn/noise v1.1.0 // indirect
4342
github.com/francoispqt/gojay v1.2.13 // indirect

0 commit comments

Comments
 (0)