Skip to content

Commit

Permalink
add: replicator address in config to hash during signing root
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrynenko committed Dec 6, 2024
1 parent 1b996b2 commit 85b0631
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pinger:
max_abnormal_period: 10s

replicator:
address: 0x10f370A6d8782E0e0E85ba948be6DA2465Aab4E2
source_smt: 0xc1534912902BBe8C54626e2D69288C76a843bc0E
root_prefix: Rarimo root

Expand Down
1 change: 1 addition & 0 deletions internal/config/replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (
)

type Replicator struct {
Address common.Address `fig:"address,required"`
SourceSMT common.Address `fig:"source_smt,required"`
RootPrefix string `fig:"root_prefix,required"`
}
Expand Down
3 changes: 1 addition & 2 deletions internal/service/api/handlers/get_signed_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/http"

"github.com/ethereum/go-ethereum/crypto"
"github.com/rarimo/proof-verification-relayer/internal/config"
"github.com/rarimo/proof-verification-relayer/internal/data"
"github.com/rarimo/proof-verification-relayer/internal/service/api/requests"
"github.com/rarimo/proof-verification-relayer/resources"
Expand Down Expand Up @@ -80,7 +79,7 @@ func signState(state data.State, r *http.Request) ([]byte, error) {
digest := crypto.Keccak256(
[]byte(Config(r).Replicator().RootPrefix),
Config(r).Replicator().SourceSMT.Bytes(),
Config(r).ContractsConfig()[config.SMTReplicator].Address.Bytes(),
Config(r).Replicator().Address.Bytes(),
rootBytes,
new(big.Int).SetUint64(state.Timestamp).Bytes(),
)
Expand Down

0 comments on commit 85b0631

Please sign in to comment.