Compare commits

...

81 Commits

Author SHA1 Message Date
HAOYUatHZ
7e33f15b25 Merge branch 'develop' into move_coordinator_api 2023-07-20 15:43:14 +08:00
Xi Lin
571a577231 doc(contracts)/fix(contracts): OZ-L1-M03 WithdrawTrieVerifier Proves Intermediate Nodes (#619)
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-07-20 15:42:11 +08:00
Lawliet-Chan
57a29be6f9 Merge branch 'miners' into move_coordinator_api 2023-07-20 15:20:39 +08:00
HAOYUatHZ
fc2ec7f1e0 Merge branch 'develop' into miners 2023-07-20 15:12:11 +08:00
HAOYUatHZ
8ca10f6163 Update version.go 2023-07-20 15:10:17 +08:00
xinran chen
28ff90cd86 define listProver api 2023-07-20 14:50:57 +08:00
xinran chen
f85e39aa7f fix 2023-07-19 11:11:05 +08:00
xinran chen
383d06717e check pubkey exists 2023-07-19 10:58:44 +08:00
xinran chen
a8f6d83b45 fix lint 2023-07-19 10:53:43 +08:00
xinran chen
11f167b560 fix ci 2023-07-19 10:48:30 +08:00
xinran chen
94ac36e1bb fix test and lint 2023-07-19 10:45:00 +08:00
georgehao
256e1261b2 feat: format import 2023-07-19 10:27:53 +08:00
georgehao
c6e2b7ebda feat: comment tidy 2023-07-19 10:23:59 +08:00
georgehao
821fac837b feat: rename variable name 2023-07-19 10:13:33 +08:00
georgehao
32ef144834 feat: add empty line 2023-07-19 10:03:55 +08:00
georgehao
502a8a7cae feat: add empty line 2023-07-19 09:58:49 +08:00
Lawliet-Chan
bf0f52d5c0 Merge branch 'develop' into miners 2023-07-19 09:54:56 +08:00
xinran chen
2c3cce3876 change field 2023-07-19 09:51:11 +08:00
xinran chen
f33b4b0d3a some fix 2023-07-18 22:03:03 +08:00
xinran chen
5d40552d72 some fix 2023-07-18 21:18:30 +08:00
xinran chen
35ffa7356e fix test 2023-07-18 18:02:10 +08:00
xinran chen
27d6098b77 fix lint 2023-07-18 17:05:02 +08:00
georgehao
274d5fa957 feat: update readme 2023-07-18 17:00:48 +08:00
georgehao
56399ad054 feat: update prover stats api some files 2023-07-18 16:56:21 +08:00
xinran chen
d3af1cdcf3 statusOK 2023-07-17 11:15:20 +08:00
xinran chen
7d2d922d84 fix test 2023-07-17 11:03:28 +08:00
Lawliet-Chan
21f924e384 Merge branch 'develop' into miners 2023-07-17 10:21:14 +08:00
xinran chen
a7b3c07e6b wrap resp 2023-07-17 10:19:56 +08:00
Lawliet-Chan
c4abe27b40 Merge branch 'develop' into miners 2023-07-14 15:30:54 +08:00
xinran chen
3332ef3416 fix lint 2023-07-14 10:54:01 +08:00
xinran chen
c850e77773 fix test 2023-07-14 10:48:49 +08:00
xinran chen
b5195b7c82 fix 2023-07-14 10:44:30 +08:00
xinran chen
1f7b698c54 fix 2023-07-14 10:43:36 +08:00
xinran chen
28d61aaf6a fix go mod tidy 2023-07-14 10:17:32 +08:00
xinran chen
c8ef6a1778 add metrics 2023-07-13 17:56:54 +08:00
Lawliet-Chan
4f5c96859b Merge branch 'develop' into miners 2023-07-13 17:44:17 +08:00
xinran chen
60f0ed9a7c fix tests 2023-07-13 17:34:20 +08:00
xinran chen
10ab92ae34 trigger ci 2023-07-13 16:20:58 +08:00
xinran chen
30171c2958 debug 2023-07-13 16:17:50 +08:00
xinran chen
c1bf3c17e1 fix skip paths 2023-07-13 16:12:48 +08:00
xinran chen
a5c50ada8d add jwt 2023-07-13 16:04:24 +08:00
xinran chen
e67448c012 fix ci name 2023-07-13 14:35:07 +08:00
xinran chen
cbe66b85bc rename to logic 2023-07-13 11:43:50 +08:00
xinran chen
08d4ee292d fix test path 2023-07-13 11:16:06 +08:00
xinran chen
e47e020ece tidy layout 2023-07-13 11:09:39 +08:00
xinran chen
9bbf0f692e modify ci 2023-07-13 11:03:52 +08:00
xinran chen
8588d4d701 rename to prover_stats_api 2023-07-13 10:41:26 +08:00
Lawliet-Chan
ed75791ac2 Merge branch 'develop' into miners 2023-07-13 10:31:27 +08:00
xinran chen
e642c91cb5 trigger ci 2023-07-12 15:05:11 +08:00
xinran chen
9d22a49cd6 Revert "fix ci"
This reverts commit 6d3e15c262.
2023-07-12 14:59:43 +08:00
xinran chen
6d3e15c262 fix ci 2023-07-12 14:57:07 +08:00
xinran chen
b472f30b36 change port 2023-07-12 12:13:07 +08:00
xinran chen
e0679b2387 ignore go mod tidy 2023-07-12 12:09:15 +08:00
xinran chen
78ee952555 big.Int 2023-07-12 12:08:35 +08:00
Lawliet-Chan
9e8215c94f Merge branch 'develop' into miners 2023-07-12 12:07:51 +08:00
xinran chen
4c86e2f3ad try fix 2023-07-12 11:35:40 +08:00
xinran chen
97d6c277c0 desc 2023-07-12 11:04:15 +08:00
xinran chen
2c8f4f33ce .taskID 2023-07-12 10:54:40 +08:00
xinran chen
cd807da186 service tests 2023-07-12 10:41:50 +08:00
xinran chen
23db3bf09f port 2023-07-12 00:59:06 +08:00
Lawliet-Chan
a3daec8f29 Merge branch 'develop' into miners 2023-07-12 00:50:28 +08:00
xinran chen
2ef214c34a try fix 2023-07-12 00:43:53 +08:00
xinran chen
a8b31bb7dc try fix 2023-07-12 00:14:47 +08:00
xinran chen
f294cdcc57 some modify 2023-07-12 00:06:04 +08:00
xinran chen
b443aa9ca1 fix 2023-07-11 23:48:48 +08:00
xinran chen
18b332a358 add orm test 2023-07-11 23:39:08 +08:00
xinran chen
dc22675a38 fix 2023-07-11 23:25:17 +08:00
xinran chen
fcaa1ea9f7 fix 2023-07-11 23:07:03 +08:00
xinran chen
a2dfc39ec1 fix makefile 2023-07-11 22:54:43 +08:00
xinran chen
c04883efb5 fix 2023-07-11 22:49:08 +08:00
xinran chen
5eddde0388 fix 2023-07-11 22:40:44 +08:00
xinran chen
e2fe308330 gitignore 2023-07-11 22:34:18 +08:00
Lawliet-Chan
f6f3d0bb51 Merge branch 'develop' into miners 2023-07-11 21:54:10 +08:00
xinran chen
598ccc3df1 make test 2023-07-11 21:52:30 +08:00
xinran chen
4df562b487 add test and config 2023-07-11 21:49:09 +08:00
xinran chen
aa4df0e02a import swag 2023-07-11 17:09:06 +08:00
xinran chen
2cc77ad275 swag doc 2023-07-11 16:58:42 +08:00
xinran chen
489888446a add makefile 2023-07-11 14:21:21 +08:00
xinran chen
38f32b2559 add service 2023-07-11 14:10:38 +08:00
xinran chen
7e780ec145 add ci 2023-07-11 13:46:41 +08:00
xinran chen
a59651105f add miner api 2023-07-11 13:41:02 +08:00
4 changed files with 68 additions and 0 deletions

View File

@@ -2,7 +2,23 @@
pragma solidity ^0.8.0;
// solhint-disable no-inline-assembly
library WithdrawTrieVerifier {
/// @dev Verify the merkle proof given root, leaf node and proof.
///
/// Vulnerability:
/// The initially provided message hash can be hashed with the first hash of the proof,
/// thereby giving an intermediate node of the trie. This can then be used with a shortened
/// proof to pass the verification, which may lead to replayability.
///
/// However, it is designed to verify the withdraw trie in `L2MessageQueue`. The `_hash` given
/// in the parameter is always a leaf node. So we assume the length of proof is correct and
/// cannot be shortened.
/// @param _root The expected root node hash of the withdraw trie.
/// @param _hash The leaf node hash of the withdraw trie.
/// @param _nonce The index of the leaf node from left to right, starting from 0.
/// @param _proof The concatenated merkle proof verified the leaf node.
function verifyMerkleProof(
bytes32 _root,
bytes32 _hash,

View File

@@ -0,0 +1,19 @@
package controller
import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"scroll-tech/prover-stats-api/internal/logic"
)
type ProverController struct {
logic *logic.ProverLogic
}
func NewProverController(db *gorm.DB) *ProverController {
return &ProverController{logic: logic.NewProverLogic(db)}
}
func (p *ProverTaskController) ListProvers(ctx *gin.Context) {
}

View File

@@ -0,0 +1,18 @@
package logic
import (
"gorm.io/gorm"
"scroll-tech/prover-stats-api/internal/orm"
)
type ProverLogic struct {
proverOrm *orm.Prover
}
func NewProverLogic(db *gorm.DB) *ProverLogic {
return &ProverLogic{proverOrm: orm.NewProver(db)}
}
func (p *ProverLogic) ListProvers() {
}

View File

@@ -0,0 +1,15 @@
package orm
import "gorm.io/gorm"
type Prover struct {
db *gorm.DB
}
func NewProver(db *gorm.DB) *Prover {
return &Prover{db: db}
}
func (p *Prover) ListProvers() {
}