v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-10-12 18:55:17 +00:00
|
|
|
"encoding/binary"
|
2024-10-17 04:51:27 +00:00
|
|
|
"encoding/hex"
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
"os"
|
|
|
|
"runtime"
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
|
2024-10-17 04:51:27 +00:00
|
|
|
"golang.org/x/crypto/sha3"
|
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/config"
|
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/consensus/data"
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/crypto"
|
2024-10-14 01:37:19 +00:00
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/execution/intrinsics/token"
|
2024-10-12 18:55:17 +00:00
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/p2p"
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
|
2024-10-17 04:51:27 +00:00
|
|
|
pcrypto "github.com/libp2p/go-libp2p/core/crypto"
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
"github.com/multiformats/go-multiaddr"
|
|
|
|
mn "github.com/multiformats/go-multiaddr/net"
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
"google.golang.org/grpc/reflection"
|
2024-10-12 18:55:17 +00:00
|
|
|
"google.golang.org/protobuf/proto"
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
|
|
|
)
|
|
|
|
|
|
|
|
type DataWorkerIPCServer struct {
|
|
|
|
protobufs.UnimplementedDataIPCServiceServer
|
|
|
|
listenAddrGRPC string
|
|
|
|
logger *zap.Logger
|
|
|
|
coreId uint32
|
|
|
|
prover crypto.FrameProver
|
2024-10-12 18:55:17 +00:00
|
|
|
indices []int
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
parentProcessId int
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetFrameInfo implements protobufs.NodeServiceServer.
|
|
|
|
func (r *DataWorkerIPCServer) CalculateChallengeProof(
|
|
|
|
ctx context.Context,
|
|
|
|
req *protobufs.ChallengeProofRequest,
|
|
|
|
) (*protobufs.ChallengeProofResponse, error) {
|
2024-10-12 18:55:17 +00:00
|
|
|
challenge := []byte{}
|
|
|
|
challenge = append(challenge, req.PeerId...)
|
|
|
|
challenge = binary.BigEndian.AppendUint64(
|
|
|
|
challenge,
|
|
|
|
req.ClockFrame.FrameNumber,
|
|
|
|
)
|
|
|
|
found := false
|
|
|
|
for _, proof := range req.ClockFrame.AggregateProofs {
|
|
|
|
for _, c := range proof.InclusionCommitments {
|
|
|
|
o := &protobufs.IntrinsicExecutionOutput{}
|
|
|
|
err := proto.Unmarshal(c.Data, o)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
outputs := &protobufs.TokenOutputs{}
|
|
|
|
err = proto.Unmarshal(o.Output, outputs)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
inRange:
|
|
|
|
for _, out := range outputs.Outputs {
|
|
|
|
switch e := out.Output.(type) {
|
|
|
|
case *protobufs.TokenOutput_Coin:
|
2024-10-14 01:37:19 +00:00
|
|
|
addr, err := token.GetAddressOfCoin(
|
|
|
|
e.Coin,
|
|
|
|
req.ClockFrame.FrameNumber,
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2024-10-12 18:55:17 +00:00
|
|
|
for _, idx := range p2p.GetOnesIndices(
|
|
|
|
p2p.GetBloomFilter(
|
2024-10-14 01:37:19 +00:00
|
|
|
addr,
|
2024-10-12 18:55:17 +00:00
|
|
|
1024,
|
|
|
|
64,
|
|
|
|
),
|
|
|
|
) {
|
|
|
|
for _, i := range r.indices {
|
|
|
|
if i == idx {
|
|
|
|
challenge = append(challenge, req.ClockFrame.Filter...)
|
|
|
|
challenge = append(challenge, req.ClockFrame.Input...)
|
|
|
|
challenge = append(challenge, c.Data...)
|
|
|
|
found = true
|
|
|
|
break inRange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case *protobufs.TokenOutput_DeletedCoin:
|
|
|
|
for _, idx := range p2p.GetOnesIndices(
|
|
|
|
p2p.GetBloomFilter(
|
2024-10-14 01:37:19 +00:00
|
|
|
e.DeletedCoin.Address,
|
2024-10-12 18:55:17 +00:00
|
|
|
1024,
|
|
|
|
64,
|
|
|
|
),
|
|
|
|
) {
|
|
|
|
for _, i := range r.indices {
|
|
|
|
if i == idx {
|
|
|
|
challenge = append(challenge, req.ClockFrame.Filter...)
|
|
|
|
challenge = append(challenge, req.ClockFrame.Input...)
|
|
|
|
challenge = append(challenge, c.Data...)
|
|
|
|
found = true
|
|
|
|
break inRange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case *protobufs.TokenOutput_DeletedProof:
|
|
|
|
for _, idx := range p2p.GetOnesIndices(
|
|
|
|
p2p.GetBloomFilter(
|
|
|
|
e.DeletedProof.Owner.GetImplicitAccount().Address,
|
|
|
|
1024,
|
|
|
|
64,
|
|
|
|
),
|
|
|
|
) {
|
|
|
|
for _, i := range r.indices {
|
|
|
|
if i == idx {
|
|
|
|
challenge = append(challenge, req.ClockFrame.Filter...)
|
|
|
|
challenge = append(challenge, req.ClockFrame.Input...)
|
|
|
|
challenge = append(challenge, c.Data...)
|
|
|
|
found = true
|
|
|
|
break inRange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case *protobufs.TokenOutput_Proof:
|
|
|
|
for _, idx := range p2p.GetOnesIndices(
|
|
|
|
p2p.GetBloomFilter(
|
|
|
|
e.Proof.Owner.GetImplicitAccount().Address,
|
|
|
|
1024,
|
|
|
|
64,
|
|
|
|
),
|
|
|
|
) {
|
|
|
|
for _, i := range r.indices {
|
|
|
|
if i == idx {
|
|
|
|
challenge = append(challenge, req.ClockFrame.Filter...)
|
|
|
|
challenge = append(challenge, req.ClockFrame.Input...)
|
|
|
|
challenge = append(challenge, c.Data...)
|
|
|
|
found = true
|
|
|
|
break inRange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !found {
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
return nil, errors.Wrap(
|
2024-10-17 04:51:27 +00:00
|
|
|
data.ErrNoApplicableChallenge,
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
"calculate challenge proof",
|
|
|
|
)
|
|
|
|
}
|
2024-06-08 11:32:45 +00:00
|
|
|
proof, err := r.prover.CalculateChallengeProof(
|
2024-10-12 18:55:17 +00:00
|
|
|
challenge,
|
|
|
|
req.ClockFrame.Difficulty,
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
return nil, errors.Wrap(err, "calculate challenge proof")
|
|
|
|
}
|
|
|
|
|
|
|
|
return &protobufs.ChallengeProofResponse{
|
2024-06-08 11:32:45 +00:00
|
|
|
Output: proof,
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDataWorkerIPCServer(
|
|
|
|
listenAddrGRPC string,
|
|
|
|
logger *zap.Logger,
|
|
|
|
coreId uint32,
|
|
|
|
prover crypto.FrameProver,
|
2024-10-17 04:51:27 +00:00
|
|
|
config *config.Config,
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
parentProcessId int,
|
|
|
|
) (*DataWorkerIPCServer, error) {
|
2024-10-17 04:51:27 +00:00
|
|
|
peerPrivKey, err := hex.DecodeString(config.P2P.PeerPrivKey)
|
|
|
|
if err != nil {
|
|
|
|
panic(errors.Wrap(err, "error unmarshaling peerkey"))
|
|
|
|
}
|
|
|
|
|
|
|
|
privKey, err := pcrypto.UnmarshalEd448PrivateKey(peerPrivKey)
|
|
|
|
if err != nil {
|
|
|
|
panic(errors.Wrap(err, "error unmarshaling peerkey"))
|
|
|
|
}
|
|
|
|
|
|
|
|
pub := privKey.GetPublic()
|
|
|
|
|
|
|
|
pubKey, err := pub.Raw()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
digest := make([]byte, 128)
|
|
|
|
s := sha3.NewShake256()
|
|
|
|
s.Write([]byte(pubKey))
|
|
|
|
_, err = s.Read(digest)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2024-10-17 05:47:12 +00:00
|
|
|
indices := p2p.GetOnesIndices(p2p.GetBloomFilter(digest, 1024, 64))
|
|
|
|
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
return &DataWorkerIPCServer{
|
2024-10-17 04:51:27 +00:00
|
|
|
listenAddrGRPC: listenAddrGRPC,
|
|
|
|
logger: logger,
|
|
|
|
coreId: coreId,
|
|
|
|
prover: prover,
|
|
|
|
indices: []int{
|
2024-10-17 05:47:12 +00:00
|
|
|
indices[int(coreId)%len(indices)],
|
2024-10-17 04:51:27 +00:00
|
|
|
},
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
parentProcessId: parentProcessId,
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *DataWorkerIPCServer) Start() error {
|
|
|
|
s := grpc.NewServer(
|
2024-10-14 01:37:19 +00:00
|
|
|
grpc.MaxRecvMsgSize(600*1024*1024),
|
|
|
|
grpc.MaxSendMsgSize(600*1024*1024),
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
)
|
|
|
|
protobufs.RegisterDataIPCServiceServer(s, r)
|
|
|
|
reflection.Register(s)
|
|
|
|
|
|
|
|
mg, err := multiaddr.NewMultiaddr(r.listenAddrGRPC)
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "start")
|
|
|
|
}
|
|
|
|
|
|
|
|
lis, err := mn.Listen(mg)
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "start")
|
|
|
|
}
|
|
|
|
|
|
|
|
go r.monitorParent()
|
|
|
|
|
2024-06-08 11:32:45 +00:00
|
|
|
r.logger.Info(
|
|
|
|
"data worker listening",
|
|
|
|
zap.String("address", r.listenAddrGRPC),
|
|
|
|
)
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
if err := s.Serve(mn.NetListener(lis)); err != nil {
|
2024-06-08 11:32:45 +00:00
|
|
|
r.logger.Error("terminating server", zap.Error(err))
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *DataWorkerIPCServer) monitorParent() {
|
2024-06-08 11:32:45 +00:00
|
|
|
if r.parentProcessId == 0 {
|
|
|
|
r.logger.Info(
|
|
|
|
"no parent process id specified, running in detached worker mode",
|
|
|
|
zap.Uint32("core_id", r.coreId),
|
|
|
|
)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
v1.4.18-patch-2 (#230)
* feat: IPC for wesolowski
* update self peer info
* remove digests and signatures
* add new binaries and digests
* Signatory #13 added
* Signatory #4 added (#231)
* added sig.6 files (#232)
* Signatory #9 added (#233)
* Added signatories #1, #2, #3, #5, #8, #12, #14, #15, #16, #17
* remove binaries, release ready
---------
Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com>
Co-authored-by: Freekers <1370857+Freekers@users.noreply.github.com>
2024-05-29 17:51:47 +00:00
|
|
|
for {
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
proc, err := os.FindProcess(r.parentProcessId)
|
|
|
|
if err != nil {
|
|
|
|
r.logger.Error("parent process not found, terminating")
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Windows returns an error if the process is dead, nobody else does
|
|
|
|
if runtime.GOOS != "windows" {
|
|
|
|
err := proc.Signal(syscall.Signal(0))
|
|
|
|
if err != nil {
|
|
|
|
r.logger.Error("parent process not found, terminating")
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|