-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 97f83f0 Author: jeff <[email protected]> Date: Tue Dec 12 18:19:35 2023 -0800 feat(guardian-prover-health-check): Guardian prover metrics (#15377) commit 975c882 Author: jeff <[email protected]> Date: Tue Dec 12 06:06:50 2023 -0800 feat(guardian-prover-health-check): Guardian prover rework (#15375) commit 7dfc298 Author: Daniel Wang <[email protected]> Date: Tue Dec 12 16:46:17 2023 +0800 add links in solidity files commit 0ece27d Author: Korbinian <[email protected]> Date: Mon Dec 11 21:59:02 2023 +0100 chore(bridge-ui-v2): update and fix typescript-linting (#15372) commit 9ef2dd2 Author: Daniel Wang <[email protected]> Date: Mon Dec 11 19:47:30 2023 +0800 refactor(protocol): use Bridge to send cross-chain owned contract transactions (#15368) Co-authored-by: David <[email protected]> commit 5e06cd9 Author: xiaodino <[email protected]> Date: Mon Dec 11 00:35:00 2023 -0800 feat(bridge-ui-v2): Update encoded signal proof in BridgeProver.ts (#15348) Co-authored-by: David <[email protected]> Co-authored-by: Daniel Wang <[email protected]> commit 8edcb3c Author: Daniel Wang <[email protected]> Date: Mon Dec 11 15:17:52 2023 +0800 chore(protocol): move eip1559_util.py to script/ (#15367) commit 161f4c6 Author: Daniel Wang <[email protected]> Date: Fri Dec 8 16:47:54 2023 +0800 feat(protocol): Use taikoL2's address as the treasury address in circuits (#15350) Co-authored-by: David <[email protected]> commit d50b276 Author: David <[email protected]> Date: Fri Dec 8 13:51:32 2023 +0800 feat(protocol): grant `securityCouncil` the `PROPOSER` role (#15355) commit 75b2ef9 Author: jeff <[email protected]> Date: Thu Dec 7 19:02:42 2023 -0800 feat(guardian-prover-health-check): ui + api (#15324) commit 06ce873 Author: Daniel Wang <[email protected]> Date: Thu Dec 7 16:01:42 2023 +0800 chore(protocol): apply fixes based on OZ's inspector reports (#15320) commit 8fc51b4 Author: CeciliaZ030 <[email protected]> Date: Thu Dec 7 05:32:31 2023 +0300 fix(protocol): Non-recursive abi.encode for Zk Verifier (#15344)
- Loading branch information
1 parent
a3f95f1
commit 796a1f0
Showing
101 changed files
with
1,306 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
HTTP_PORT=4103 | ||
PROMETHEUS_HTTP_PORT=6062 | ||
METRICS_HTTP_PORT=6062 | ||
DATABASE_USER=root | ||
DATABASE_PASSWORD=root | ||
DATABASE_NAME=healthcheck | ||
DATABASE_HOST=localhost:3306 | ||
DATABASE_MAX_IDLE_CONNS=50 | ||
DATABASE_MAX_OPEN_CONNS=3000 | ||
DATABASE_CONN_MAX_LIFETIME_IN_MS=100000 | ||
GUARDIAN_PROVER_CONTRACT_ADDRESS=0x0E801D84Fa97b50751Dbf25036d067dCf18858bF | ||
GUARDIAN_PROVER_ENDPOINTS=https://guardian-prover-1.internal.taiko.xyz,https://guardian-prover-2.internal.taiko.xyz,https://guardian-prover-3.internal.taiko.xyz,https://guardian-prover-4.internal.taiko.xyz,https://guardian-prover-5.internal.taiko.xyz | ||
RPC_URL=wss://l1ws.internal.taiko.xyz | ||
GUARDIAN_PROVER_CONTRACT_ADDRESS=0xDf8038e9f4535040D7421A89ead398b3A38366EC | ||
L1_RPC_URL=wss://l1ws.internal.taiko.xyz | ||
L2_RPC_URL=wss://ws.internal.taiko.xyz | ||
INTERVAL=12s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,47 @@ | ||
package guardianproverhealthcheck | ||
|
||
import ( | ||
"encoding/base64" | ||
"errors" | ||
"math/big" | ||
"net/url" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/crypto" | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
type GuardianProver struct { | ||
Address common.Address | ||
ID *big.Int | ||
Endpoint *url.URL | ||
Address common.Address | ||
ID *big.Int | ||
HealthCheckCounter prometheus.Counter | ||
SignedBlockCounter prometheus.Counter | ||
} | ||
|
||
func SignatureToGuardianProver( | ||
msg []byte, | ||
b64EncodedSig string, | ||
guardianProvers []GuardianProver, | ||
) (*GuardianProver, error) { | ||
b64DecodedSig, err := base64.StdEncoding.DecodeString(b64EncodedSig) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// recover the public key from the signature | ||
r, err := crypto.SigToPub(msg, b64DecodedSig) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// convert it to address type | ||
recoveredAddr := crypto.PubkeyToAddress(*r) | ||
|
||
// see if any of our known guardian provers have that recovered address | ||
for _, p := range guardianProvers { | ||
if recoveredAddr.Cmp(p.Address) == 0 { | ||
return &p, nil | ||
} | ||
} | ||
|
||
return nil, errors.New("signature does not recover to known guardian prover") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.